Contents:: Screen Objects
Contents:: Screen Objects
Screen Objects
Contents:
Subscreens on the Selection Screen
Tabstrips on the Selection Screen
Context Menu
SAP AG 1999
SAP AG 1999
Good Bye
Enhancements
and Modifications
1 12 1 Course Overview
BAPIs
1
New Concepts
0
9 1
2 3
News in ABAP
ABAP Objects Workbench
ABAP Language
4
Graphical Query
8
Tools
7 5
Screen Objects 6 Logical Databases
ABAP Dictionary
SAP AG 1999
From To Info
Country DE
Displays various components
City Berlin
of an application on a single
Airport TXL screen and allows the user
Time 10:10:00 to navigate between the
components
Container for other screen
objects
SAP AG 1999
Tabstrip controls provide you with an easy, user-friendly way of displaying different components of
an application on a single screen and allowing the user to navigate between them. Their intuitive
design makes navigation much easier for end users.
Tabstrip controls are a useful way of simplifying complex applications. You can use tabstrip
controls wherever you have different components of an application that form a logical unit. For
example, you might have a set of header data which remains constant, while underneath it, you want
to display various other sets of data.
You should not use tabstrip controls if
You need to change the screen environment (menus, pushbuttons, header data, and so on) while
processing the application components. The screen surrounding the tabstrip must remain
constant.
The components must be processed in a certain order. Tabstrips are designed to allow users to
navigate freely between components.
The components are processed dynamically, that is, if user input on one tab page leads to other
tab pages suddenly appearing.
Tabstrip controls are compatible with batch input processing.
Pushbutton
Pushbutton
Text
Text
+
Text
Subscreen
= area
CONTENTS
+
Contents
=
Subscreen
screen
SAP AG 1999
SAP AG 1999
You can now create tabstrip controls on selection screens. They allow you to create logical groups
of fields, and make large selection screens more user-friendly.
The following requirements must be met if you are to use selection screens with tabstrip controls in
your R/3 System:
SAP AG 1999
Since it is possible to define selection screens as subscreens, you can include selection fields that you
create in this way in any other screens. Selection screens as subscreens are processed similarly to
other screens.
SELECTION-SCREEN
SELECTION-SCREEN BEGIN
BEGIN OF
OF TABBED
TABBED BLOCK
BLOCK blockname
blockname FOR
FOR nn LINES.
LINES.
SELECTION-SCREEN
SELECTION-SCREEN TAB
TAB (length
( length)
(length)) tabname1
tabname1 USER-COMMAND
USER-COMMAND ucomm1
ucomm1 DEFAULT
DEFAULT SCREEN
SCREEN 101.
SELECTION-SCREEN
SELECTION-SCREEN TAB
TAB (length
( length)
(length)) tabname2
tabname2 USER-COMMAND
USER-COMMAND ucomm2
ucomm2 DEFAULT
DEFAULT SCREEN
SCREEN 102.
SELECTION-SCREEN
SELECTION-SCREEN END
END OF
OF BLOCK
BLOCK blockname.
blockname.
blockname .
INITIALIZATION.
INITIALIZATION.
tabname1= =TEXT-001.
tabname1 TEXT-001. "TEXT-001DE:
"TEXT-001 EN:Verbindung
Connection
tabname2==TEXT-002.
tabname2 TEXT-002. "TEXT-002 DE:
"TEXT-002 EN:Flug
Flight
.
Connection Flight
Airline
Flight No.
SAP AG 1999
You define a subscreen area for a tabstrip control on a selection screen as follows: SELECTION-
SCREEN BEGIN OF TABBED BLOCK <blockname> FOR <n> LINES.
SELECTION-SCREEN END OF BLOCK <blockname>.
The size of the subscreen area in lines is defined by <n>.
You can delay specifying the link between the tab title and the selection screen until runtime. You
can also change an existing assignment at runtime. To do this, fill the structure blockname. This is
created automatically for every tabstrip block. The structure has the same name as the tabstrip block,
and contains the fields PROG, DYNNR, and ACTIVETAB. For further information, refer to the online
documentation in appendix reference SUB-2.
Contents:
Creating interfaces using the Menu Painter
Titles
Menu bars
Standard toolbars and
Application toolbars
SAP AG 1999
GUI title
SET TITLEBAR <n>.
SAP AG 1999
START-OF-SELECTION.
SAP AG 1999
You can create and maintain statuses in one of three different ways:
By using the object list of the Object Navigator
By using forward navigation in the ABAP Editor,
By directly using the Menu Painter.
When creating a status you can either create a new menu bar, application toolbar, and new key
settings yourself (top down), or use existing objects for your interface (bottom up), or a use
combination of both methods.
Status names can have a maximum of 20 characters. (Letters must be upper-case).
By choosing a status type, you determine whether a status refers to a normal screen or a dialog box.
According to what you have choosen, different types of functions are put at your disposal.
Use the statement SET PF-STATUS '<NAME>' to set the status of the basic list by programming
it into one of the processing blocks that are processed before the basic list is sent.
A d ju s t s ta tu s te m p la te
In c lu d e t e m p la t e in
U s e r -O r ie n te d
S ta tu s B A S E
D e s ig n
S t a t u s t e m p la te .. .
L is t s ta tu s
S e le c tio n S c r e e n
...
M e n u b a rs L in e s e le c tio n lis t
L is t E d it G o to
A p p lic a tio n to o lb a r
K e y s e ttin g s L in e s e le c tio n lis t
SAP AG 1999
The 'Adjust template' function found in the Extras menu allows you to include standardized
function codes in your status. This function further allows you to include objects from a status of
your choice with the existing status. This allows you to choose norms for list statuses and selection
screens or use any other status you want from another ABAP program.
Screen area
SAP AG 1999
Context menus (right mouse key, SHIFT F10) are shortcuts for functions that are frequently used.
They can be used to display context-sensitive menus. The context is defined by the position (cursor
for SHIFT F10, mouse location for right mouse key) where the user called the context menu. If
needed, you can specify the context more precisely with the displayed contents. This permits the user
to select functions that are relevant for the current context using the context menu.
You define whether a context menu should be offered when you create a screen object (screens,
input fields, table controls, boxes, ...). When the user selects a context menu on an object, an event
mechanism (as understood by ABAP objects) calls a certain subroutine in the application program.
The program is assigned a menu reference. The program uses this menu reference to build the
display menu. Menus defined with the Menu Painter and dynamic menus can be used here.
After the user executes a menu function, the application program regains control and can react to the
user input.
Context menus are assigned to output fields. When you assign a context menu to a box, table control
or screen (normal or subscreen), all the subordinate output fields that do not have a context menu
inherit that one.
Object
Object
Navigator
Navigator
<Program name>
Program xxxxx
Status SUB130
Status attribute
Short text Table Control Subscreen
Status type
Dialog status
Dialog box
Context menu
SAP AG 1999
You can create a context menu from within the object list of the Object Navigator. Position the
cursor on GUI status and right-click. The Object Navigator automatically opens the Menu Painter.
Of course you can also create a context menu directly in the Menu Painter.
A context menu is a special GUI status. Assign it a name, a descriptive text and status type Context
menu.
Context menu
Code Text
Sort > SRTD Descending
SRTU Ascending
LIST Booking list
F4
Function list
M
M 11
M
M 11 M
M 11
BACK M
M 11 M
M 11
BACK
EXIT
EXIT ...
...
INFO
INFO DETL
DETL
SAP AG 1999
In a context menu you can link any function codes and function texts. In particular, you can take
advantage of your screen pushbuttons. The functions already provided in the interface can be used as
an F4 input help.
The link technique ensures consistent context menus in large applications.
You should observe the following rules when designing context menus.
Do not use any functions that cannot be found elsewhere in the system (pushbuttons or interface).
Avoid using more than two hierarchy levels in context menus.
Do not use more than 10 entries, but map all the available pushbuttons.
Use separators to structure the context menu optically.
Place object-specific statements at the beginning of the menu.
*-------------------------------
*** INCLUDE SAPBC410CONDF01
*-------------------------------
Screen Painter
...
Object Attributes
FORM on_ctmenu_rbgframe
Context Menu Form USING p_menu TYPE REF TO cl_ctmenu.
...
ON_CTMENU_ RBGFRAME ENDFORM.
...
Screen Attributes
FORM on_ctmenu_sub130
General Attributes USING p_menu TYPE REF TO cl_ctmenu.
...
Context Menu Form ENDFORM.
ON_CTMENU_ SUB130
ABAP
SAP AG 1999
Pressing the right mouse key triggers a callback routine in your program. You can create this
callback routine in your application program with forward navigation. It is named
ON_CTMENU_<name>. You define which callback routine is called in the Screen Painter.
You can directly assign a callback routine to input/output fields, text fields and status icons.
Checkboxes, radio buttons and pushbuttons do not have their own callback routines. However, these
fields can inherit context menus from boxes or screens.
If you assign a callback routine to a table control, it is triggered for all the fields of the table control
that do not have their own callback routine.
The callback routine has the following form:
Flight Flight
FORM on_ctmenu_sub130
USING p_menu TYPE REF TO cl_ctmenu.
ENDFORM.
SAP AG 1999
ABAP
Clicking with the right mouse key on an output field triggers the corresponding callback routine.
You can now use the static method load_gui_status of class cl_ctmenu to load a context
menu that was predefined in the Menu Painter. Using other methods of class cl_ctmenu (see next
slide) you can also completely rebuild the context menu or modify a loaded menu.
If the user triggers a function in the context menu, the corresponding function code is placed in the
command field and triggered depending on function type PAI of the screen.
Method Meaning
ADD_FUNCTION Add a function
SAP AG 1999
The class cl_ctmenu provides a number of other methods in addition to the static method
load_gui_status. You can use them to adjust the context menu at runtime (e.g. using the
values in data fields).
The corresponding methods are called within the callback routine.
You can find further information in the documentation for class cl_ctmenu in the Class Builder.
Airline Lufthansa
Lauda Air
Delta Airlines
Airline: LH
Connection number 0400
Flight date
F4
09/09/1999
10/10/1999
11/29/1999
12/02/1999
12/19/1999
12/21/1999
SAP AG 1999
You can help the user with input by using dropdown list boxes containing the possible entries.
Input help (F4 help) is a standard function in the R/3 System. It allows the user to display a list of
possible entries for a screen field. If the field is ready for input, the user can place a value in it by
selecting it from the list.
If a field has input help, the possible entries button appears on its right hand side. The button is
visible whenever the cursor is placed in the field. You can start the help either by clicking the button
or choosing F4.
As well as the possible entries, the input help displays relevant additional information about the
entries. This is especially useful when the field requires a formal key.
Since the input help is a standard function, it should have the same appearance and behavior
throughout the system. There are utilities in the ABAP Workbench that allow you to assign
standardized input help to a screen field.
The precise description of the input help of a field usually arises from its semantics. Consequently,
input help is usually defined in the ABAP Dictionary.
Value list
SAP AG 1999
Dropdown list boxes allow the user to choose an entry from a pull-down list containing the possible
entries. The user cannot enter values freely, but must choose a value from the list.
To create a dropdown list box for an input field, you must do the following in the Screen Painter:
Set the Dropdown attribute to list box.
Change the visLength attribute to the displayed length of the descriptive text.
Set the Value list attribute to ' ' to use value help from the ABAP Dictionary.
If required, set the function code for the selection. Like a menu entry, this function code triggers
the PAI, and you can interpret it using the OK_CODE field.
Important: The visible length of the field determines the width of the field (including button) and
the selection list, and you must normally change it when you convert the field to a dropdown box.
The values are filled automatically using the search help assigned to the ABAP Dictionary field. The
Dictionary field must have a search help (check table) with two columns or a table of fixed values.
Search help
Internal behavior
Interface
Connection
in Dict.
Input screen
F4
Field 1 Search field Field 3 ...
Field 1 Table/structure
Search field
Field 3 Definitions in
Screen Painter
SAP AG 1999
A search help describes the process of an input help. In order for it to work, we need a mechanism
that assigns the search help to the field. This is called the search help connection.
Connecting a search help to a field affects its behavior. It is therefore regarded as part of the field
definition.
The semantic and technical attributes of a screen field (type, length, F1 help) are normally not
defined directly when you define the screen. Normally, you use a reference in the Screen Painter to
an existing field in the ABAP Dictionary. The screen field then inherits the attributes of the ABAP
Dictionary field.
The same principle applies when you define input help for a screen field. The link between the
search help and the search field is established using the ABAP Dictionary field, not the screen field.
When you assign a search help, its interface parameters are asssigned to the screen fields that are
filled by the search help, or which pass information to it from the screen. The search field must be
assigned to an EXPORT parameter of the search help. You should also make the search field an
IMPORT parameter, so that the search help can take into account a search pattern already entered in
the field by the user.
A field can have input help even if it does not have a search help - there are other mechanisms for F4
help (for example, fixed values for a domain).
SAP AG 1999
Make the functions for your table control available in a context menu.
Create a GUI status with type context menu and use it for the output fields on screen 130.
Copy the model template SAPD346AWT_TABLE_CONTROL3). You can use the
model solution SAPD346AWS_CONTEXTMENU for orientation.
Create the GUI status sub130 with type context menu and the short description Table
control subscreen. Assign the following functions to the menu:
*&-----------------------------------------------------------------*
*& Form ON_CTMENU_SUB130
*&-----------------------------------------------------------------*
FORM on_ctmenu_sub130 USING p_menu TYPE REF TO cl_ctmenu.
data fcodes type ui_functions.
load of the context menu defined in the menu painter