Defining a Tabstrip Control 

To define a simple tabstrip control, you must:

  1. Define the tabstrip area.
  2. Define the tab titles.
  3. Define and assign a subscreen area.
  4. Program the flow logic.

To find out how to create a tabstrip control in the alphanumeric Screen Painter, refer to Creating Tabstrip Controls in Alphanumeric Mode.

Procedure

Defining the Tabstrip Area.

To define a tabstrip area using the graphical layout editor:

  1. With the Screen Painter in change mode, choose the tabstrip control icon from the element palette.
    The mouse pointer changes its shape.
  2. Set the position of the top left-hand corner of the tabstrip with a single click, and keep the mouse button pressed.
  3. Drag the object out to the required size and release the mouse button.
  4. If necessary, you can still change the position and size of the tabstrip control.
  5. Assign a name <tab_strip_name> to the new tabstrip control.
  6. Enter any further tabstrip attributes as required.

The element name of the tabstrip control is the name that you use to declare the tabstrip control in your ABAP program using the following statement:
CONTROLS <tab_strip_name> TYPE TABSTRIP.

Defining The Tab Titles

By default new tabstrip controls come with two tab titles. In technical terms, you process tab titles exactly like pushbuttons. If you want your tabstrip control to have more than two tab titles, you must change the Tab titles attribute..

  1. Double-click a tab title to open the corresponding attribute window (for the pushbutton)
  2. Assign the tab title attributes:
  3. Attribute

    Meaning

    Name

    Name of the pushbutton that forms the tab title

    Text

    Text for the button

    Icon name

    Icon to be displayed as part of the title.
    Note: this is not recommended for ergonomic reasons.
    The exception to this are icons for status displays, or icons that are genuinely self-explanatory (phone, fax, alarm…) used instead of text.

    FctCode

    Function code that triggers the PAI event. When the user clicks the tab, the function code is placed in the system field SY-UCOMM.
    If you are scrolling at the backend, the function code is also placed in the OK_CODE field.

    FctType

    A tab title may have the function type <P> or <SPACE>. To scroll locally at the frontend, use type <P>. In this case, the PAI event is not triggered when the user chooses a tab title, and there is no data transfer to the application server.
    To scroll at the backend, use function type <SPACE> (no special type assignment). In this case, the PAI event is triggered when the user chooses a tab title, and the function code is placed in the OK_CODE field.

  4. Repeat steps 1 and 2 for each new tab title.

Just like normal pushbuttons, you can assign dynamic texts to tab titles.

Assigning a Subscreen Area

You must assign a subscreen area to each tab page. If you are using local scrolling at the frontend (function type <P>) you must assign a separate subscreen area to each tab page.
If you are scrolling at the backend (function type <SPACE>), you can use one shared subscreen area for all tab pages.

To assign a subscreen area to a tab page:

  1. Select a tab title.
  2. Choose Subscreen area from the element toolbar.
  3. Position the subscreen area within the tabstrip control, and drag it to the required size.
  4. Enter a name <subscreen_area> for the subscreen area.
    This name also appears as the reference field in the tab title attributes.

You can also assign the subscreen area manually by entering the name of the subscreen name in the reference field attribute. Note that this only works if you are using backend scrolling.

Programming the Flow Logic

This explanation of the flow logic is restricted to that necessary to include the appropriate subscreen screens in the right subscreen areas in the tabstrip control. There are two ways of doing this, depending on the scrolling method you are using.

Local Scrolling at the Frontend

If you are using frontend scrolling, you must include subscreen screens in all of your subscreen areas in the tabstrip control.

You can do this in the screen flow logic as follows:

  1. Add the following statements to the PBO event of your flow logic:

    PROCESS BFORE OUTPUT.

        CALL SUBSCREEN: <subscreen_area1> INCLUDING [<progname 1>] <subscreen_scrn 1>,
                       <subscreen_area2> INCLUDING [<progname 2>] <subscreen_scrn 2>,
                       <subscreen_area3> INCLUDING [<progname 3>] <subscreen_scrn 3>,
                      ...
    ...
  2. Note that you can take the individual subscreen screens from different ABAP programs.

  3. Add the following statements to the PAI event of your flow logic:

    PROCESS AFTER INPUT.
    ...
        CALL SUBSCREEN: <subscreen_area1>,
                        <subscreen_area2>,
                        <subscreen_area3>,
                        ...
    ...

Scrolling at the Application Server

If you are scrolling at the application server, you only need to include one subscreen at a time in a single subscreen area.

To do this, you must:

  1. Add the following statement to the PBO event of your flow logic:

    PROCESS BFORE OUTPUT.
    ...
    CALL SUBSCREEN < subscreen_area> INCLUDING [<progname>] <subscreen_scrn>.
    ...
  2. Add the following statement to the PAI event of your flow logic:
    PROCESS AFTER INPUT.
    ...
    CALL SUBSCREEN < subscreen_area>.

Result

You have now created a tabstrip control in the Screen Painter, and determined whether the tab pages should be scrolled at the frontend or on the application server.
You can now turn your attention to programming the reaction to user input in your tabstrip control.

For further information about handling tabstrip controls in your ABAP programs, refer to the Tabstrip Control section of the ABAP Programming Guide.