Entering content frame

Subscreens on Selection Screens Locate the document in its SAP Library structure

Displaying a subscreen in a subscreen area on a selection screen is a special case of a tabstrip control on a selection screen. To define a subscreen area on a selection screen, use these statements:

SELECTION-SCREEN: BEGIN OF TABBED BLOCK sub_area FOR n LINES,
                  END OF BLOCK sub_area.

Defining a subscreen area is the equivalent of defining a tabstrip area without tab titles. Before the selection screen is displayed, you must assign a subscreen to the subscreen area sub_area. To do this, use the components prog and dynnr of the structure sub_area, which is created automatically when you define the subscreen area. Assign the program name of the subscreen screen to the component prog, and its screen number to dynnr. You can use the following subscreens:

        A subscreen screen defined using the Screen Painter.

        A selection screen subscreen, defined in an ABAP program.

If you have not assigned a subscreen when the selection screen is displayed, a runtime error occurs.

Example

REPORT demo_sel_screen_with_subscreen.

TABLES sscrfields.

* SUBSCREEN 1

SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-010.
PARAMETERS: p1(10) TYPE c,
            p2(10) TYPE c,
            p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN END OF SCREEN 100.

* SUBSCREEN 2

SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-020.
PARAMETERS: q1(10) TYPE c,
            q2(10) TYPE c,
            q3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN END OF SCREEN 200.

* SUBSCREEN 3

SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-030.
PARAMETERS: r1(10) TYPE c,
            r2(10) TYPE c,
            r3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN END OF SCREEN 300.

* STANDARD SELECTION SCREEN

SELECTION-SCREEN: FUNCTION KEY 1,
                  FUNCTION KEY 2.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK sub FOR 10 LINES,
                  END OF BLOCK sub.

INITIALIZATION.
  sscrfields-functxt_01 = '@0D@'.
  sscrfields-functxt_02 = '@0E@'.
  sub-prog = sy-repid.
  sub-dynnr = 100.

AT SELECTION-SCREEN.
  CASE sy-dynnr.
    WHEN 100.
      IF sscrfields-ucomm = 'FC01'.

        sub-dynnr = 300.
      ELSEIF sscrfields-ucomm = 'FC02'.

        sub-dynnr = 200.
      ENDIF.

    WHEN 200.
      IF sscrfields-ucomm = 'FC01'.

        sub-dynnr = 100.
      ELSEIF sscrfields-ucomm = 'FC02'.

        sub-dynnr = 300.
      ENDIF.

    WHEN 300.
      IF sscrfields-ucomm = 'FC01'.

        sub-dynnr = 200.
      ELSEIF sscrfields-ucomm = 'FC02'.

        sub-dynnr = 100.
      ENDIF.

  ENDCASE.

START-OF-SELECTION.
  WRITE: / 'P1:', p1,'Q1:', q1, 'R1:', r1,
         / 'P2:', p2,'Q2:', q2, 'R2:', r2,
         / 'P3:', p3,'Q3:', q3, 'R3:', r3.

This program defines three subscreeen selection screens, 100, 200, and 300. It also defines a subscreen area sub on the standard selection screen. There are two pushbuttons in the application toolbar.

In the INITIALIZATION event, the subscreen selection screen 100 is assigned to the subscreen area. In the AT SELECTION-SCREEN event, the function keys are processed, and one of the other subscreens is assigned according to the user’s choice.

 

 

Leaving content frame