CALL SUBSCREEN
A subscreen is an independent screen that is displayed in an area of another (“main”) screen.
Subscreens allow you to embed one screen within another at runtime. You can include multiple sub-screens on main screen.
The term subscreen applies both to the screen that you embed, and the area on the main screen in which you place it. This tutorial is about subscreen areas. The actual screens created through SE51 transaction, are called subscreen screens if defined in screen attributes.
When you use a subscreen, the flow logic of the embedded screen is also embedded in the flow logic of the main screen.Hence, Using subscreens on screens is like using includes in ABAP programs.
To use a subscreen, you must follow three simple steps
Define the subscreen area(s) on a screen
Define suitable subscreen screens
Include the subscreen screen in the subscreen area.
Also, you need to adjust the frame of sub-screen and main screen. You need to name it in the field name field. Further, you also need to adjust the fields within the subscreen to make them appear in main screen. In case the sub-screen is defined to be larger than the available area in the main screen, only the part of subscreen will be visible that fits in the the area available. The area is always measured from the top left corner of screen. Hence you should take adequate care while defining sub-screen areas and creating sub-screens. EXAMPLE For instance here we have defined two sub-screen areas on main screen and have attached two different Sub-screen to corresponding areas. Whenever main screen is called, the PBO of main screen is called. But before display, the PBO’s of each screen attached with sub-screen areas on main screen are also called.
You can include a subscreen screen using the CALL SUBSCREEN statement in the flow logic of the main screen.
To include a subscreen screen in the subscreen area of the main screen and call its PBO flow logic, use the following statement in the PBO event of the main screen:
This statement assigns the subscreen screen with number
Names of elements of sub-screens within a screen should be unique You should not have OK_CODE or FCODE attached with sub-screen. The OK_CODE of main screen itself is OK_CODE of sub-screen Sub-screens cannot have any dialog modules containing SET TITLEBAR, SET PF-STATUS, SET SCREEN, LEAVE SCREEN or LEAVE TO SCREEN. This will cause runtime error. You need to call it in the flow logic (both PBO and PAI) of the main screen. CALL SUBSCREEN is not allowed in CHAIN..ENDCHAIN and LOOP ENDLOOP statements Can not have an AT EXIT-COMMAND module The fields that you use are the global fields. They must be declared in the top include If using subscreens from another dialog program the data transfer will not happen unless you add specific code.