When the transaction grows, the concept of a subscreen can be introduced. Standard SAP transactions can't do without. Here's how they work...
A subscreen is a screen type for a DYNPRO that is included in another DYNPRO. The SUBSCREEN
can be created as a screen of this type, with its own process logic with field checks etc. The following steps have to be taken to include/incorporate a subscreen in another DYNPRO:
- Define with the screen painter (full screen) an area for the subscreen in the DYNPRO. Place the cursor at the right hand top of the area to define. Menu: Processing => Subscreen => enter name of the area.
- The process logic for Process Before Output on the main (mother) screen is set up as follows:
CALL SUBSCREEN AREA INCLUDING reportname screennumber.
reportname is the ABAP name where the subscreen resides and screen number (PANEL in SAP's explanation) is the number of the subscreen.
CALL SUBSCREEN area INCLUDING 'TESTPROG' '0300'.
The screen painter has an annoying detail: the defined subscreen disappears from time to time without reason. When generating, the message "The include-block has not been indicated to defined or error writing" sometimes pops up. Just indicate the area again. Or prevent this problem from happening by starting the screen painter via the menu and not from ABAP editor (3.0b).
- The process logic for Process After Input has to be set up as follows:
CALL SUBSCREEN area.
The subscreen's Process After Input is only processed when the above line is in the Process After Input of the calling screen.
The main screen displays an area with the name "B_STORAGE".
Example: Calling a subscreen (flow logic example)
*----------------------------------------------------------------------- PROCESS BEFORE OUTPUT. *----------------------------------------------------------------------- MODULE D900_INIT. CALL SUBSCREEN B_STORAGE INCLUDING SY-REPID '0910'. *----------------------------------------------------------------------- PROCESS AFTER INPUT. *----------------------------------------------------------------------- FIELD MARA-MATNR MODULE D900_MATNR ON REQUEST. CALL SUBSCREEN B_STORAGE. MODULE D900_MENU_RESPONS.
The subscreen would have a "normal" flow logic:
*----------------------------------------------------------------------- PROCESS BEFORE OUTPUT. *----------------------------------------------------------------------- LOOP AT MAGAZIJNEN CURSOR POSITIE_MAGAZIJN. ENDLOOP. *----------------------------------------------------------------------- PROCESS AFTER INPUT. *----------------------------------------------------------------------- LOOP AT MAGAZIJNEN. ENDLOOP.