Wednesday 21 March 2018

Selection Screen as dynpros

Selection Screen as dynpros
Selection screens are special dynpros that can be defined in executable programs, function groups, and module pools. Selection screens are defined in the global declaration section of the mentioned ABAP programs with the statements SELECT-OPTIONS, SELECTION-SCREEN and PARAMETERS without using Screen Painter. The screens of selection screens can contain a subset of the screen elements of general dynpros.

Selection screens lie in the same namespace as the dynpros of the program. Additionally, dynpro number 1000 is reserved for a standard selection screen. Apart from the standard selection screen, standalone selection screens can also be defined. Standalone selection screens can only be defined in function groups and module pools.

Following example illustrate SELECTION SCREENS.

 
REPORT YUA_SELSCREEN.


************ Selection Screen 100 *********************

SELECTION-SCREEN BEGIN OF SCREEN 100.
SELECTION-SCREEN BEGIN OF BLOCK sel1 WITH FRAME TITLE tit1.
PARAMETERScityfr TYPE spfli-cityfrom,
            cityto 
TYPE spfli-cityto.
SELECTION-SCREEN END OF BLOCK sel1.
SELECTION-SCREEN END OF SCREEN 100.

************ Selection Screen 200 *********************
SELECTION-SCREEN BEGIN OF SCREEN 200 AS WINDOW.
SELECTION-SCREEN INCLUDE BLOCKS sel1.
SELECTION-SCREEN BEGIN OF BLOCK sel2
                          
WITH FRAME TITLE tit2.
PARAMETERSairpfr TYPE spfli-airpfrom,
            airpto 
TYPE spfli-airpto.
SELECTION-SCREEN END OF BLOCK sel2.
SELECTION-SCREEN END OF SCREEN 200.


CLASS start DEFINITION.
  
PUBLIC SECTION.
    
CLASS-METHODS main.
ENDCLASS.

CLASS start IMPLEMENTATION.
  
METHOD main.
    tit1 
'Cities ( selection-screen 100 )'.
    
CALL SELECTION-SCREEN 100 STARTING AT 10 10.
    tit1 
'Cities for Airports ( selection-screen 200 )'.
    tit2 
'Airports'.
    
CALL SELECTION-SCREEN 200 STARTING AT 10 10.
    tit1 
'Cities again ( selection-screen 100 ) '.
    
CALL SELECTION-SCREEN 100 STARTING AT 10 10.
    
ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  start
=>main( ).


 

Output of above ABAP Program is generated as below














No comments:

Post a Comment

Code Inspector

The Code Inspector tests single objects or object sets (programs, function groups, classes, interfaces, Dictionary objects) for performanc...