Defining a tab strip in the Screen Painter

To define a tab strip at the current development stage, you must use the graphical Screen Painter.

Execute the following steps to create a simple tab strip:

  1. Set the tab strip borders.
  2. Define the tab titles.
  3. Define and allocate the subscreen area.
  4. Program the flow logic.

Set the tab strip borders

To determine the tab strip area, proceed as follows:

  1. Click on the tab strip icon in the elements palette of the Screen Painter.
  2. Determine the area by dragging the mouse over the screen.
  3. Specify the field name for the new screen element. The field name is the area name you use in the ABAP statement CONTROLS.

Define the tab titles

By default, the new tab strip contains two tab titles. Technically, tab titles are treated like pushbuttons. This becomes obvious when you double-click on a tab title in the attributes window. For each tab title, enter field name, field text, and function code.

You can also define tab titles as templates and fill them with texts at runtime.

To create additional tab titles, drag pushbuttons into the tab titles line.

Define the subscreen area

Each tab title must be allocated to a subscreen area.

Proceed as follows:

  1. Select one or more tab titles.
  2. Click on the subscreen icon.
  3. Define the subscreen area within the tab strip by dragging the mouse. Caution: the first line of the tab strip is locked.

You can also allocate the subscreen by entering the name of the subscreen area into the reference field in the attributes window or in the field list (se Fig. 4).

Program the flow logic

Include the subscreens you use into the flow logic as follows:

PROCESS BEFORE OUTPUT.
...
CALL SUBSCREEN <area> INCLUDING <program> <screen>.
...

PROCESS AFTER INPUT.
...
CALL SUBSCREEN <area>.
...

In the module pool, declare the tab strip similar to the table control using the CONTROLS statement.

CONTROLS: MYTABSTRIP TYPE TABSTRIP.

In this example, MYTABSTRIP is the field name of the tab strip in the Screen Painter. At runtime, at present only the attribute ACTIVETAB is available, which determines the currently active tab page. You fill it with the function code of the corresponding tab title.

To activate the tab title whose function code is "F1", use the statement

MYTABSTRIP-ACTIVETAB ='F1'.

The tab strip controlling is fully integrated into the screen concept, allowing you to use it for batch input.

Scrolling via the backend

data: dynpronr(4) type c,
modul(30) type c value ‘Programmname’,
ok_code like SY-UCOMM
....

controls: tabstrip1 type tabstrip.
...

 

Flow logic:

PROCESS BEFORE OUTPUT.
Module setpage.
Module modifyscreen.
CALL SUBSCREEN
sub1 INCLUDING modul dynpronr.
...

PROCESS AFTER INPUT.
CALL SUBSCREEN SUB1.
Module fcode.
...

*-------------------------------------------*

Module setpage output.
if dynpronr is initial.
dynpronr = ‘0200’.
tabstrip1-activetab = ‘TAB1’.
endif.
endmodule.

*-------------------------------------------*

Module modifyscreen output.
LOOP AT SCREEN.
...
MODIFY SCREEN.
ENDLOOP.

*-------------------------------------------*

Module fcode.
case ok_code.
when ‘TAB1’.
dynpronr = ‘0200’.
tabstrip1-activetab = ok_code.
clear ok-code.
when ‘TAB2’.
dynpronr = ‘0300’.
tabstrip1-activetab = ok_code.
....

Scrolling locally using the GUI

Ablauflogik:

PROCESS BFORE OUTPUT.

CALL SUBSCREEN sub1 INCLUDING ‘modul1’ ‘0100’.
CALL SUBSCREEN sub2 INCLUDING ‘modul2’ ‘0101’.
CALL SUBSCREEN sub3 INCLUDING ‘modul3’ ‘0102’.
...

PROCESS AFTER INPUT.

CALL SUBSCREEN sub1.
CALL SUBSCREEN sub2.
CALL SUBSCREEN sub3.
...