You can display a details list in a dialog box instead of on the full screen using the WINDOW statement in the event blocks of list processing:
WINDOW STARTING AT left upper [ ENDING AT right lower ].
When you use this statement, the system displays the screen of the current list (index sy-lsind ) as a dialog box. Use left and upper to specify the column and line of the top left-hand corner of the dialog box in relation to the screen containing the basic list. If upper is 0, the list appears on a full screen. The coordinates of the lower right-hand corner depend on the space required by the secondary list. You can specify the ENDING option, using right and lower to set the column and line of the lower right-hand corner. The window will not exceed these values. By default, the system uses the values of the lower right corner of the window on which the event occurred.
If the width of the dialog box is smaller than that of the preceding list, the system creates a horizontal scrollbar on the dialog box. To prevent this, you must adapt the width of the details list to the width of the dialog box by using the following statement:
NEW-PAGE LINE-SIZE width .
The WINDOW statement takes effect only within the processing block of an interactive event - that is only for details lists. The list functions for lists in dialog box are the same as for fullscreen lists.
The GUI status type is different for dialog boxes. Dialog boxes have no menu bar and no standard toolbar . The application toolbar appears at the bottom of the dialog box. This is the general feature of dialog boxes.
If you do not set your own status but have defined processing blocks for AT LINE-SELECTION or AT PFnn in your program, the system uses a standard list status for a dialog box containing the corresponding function codes.
To define a status for a dialog box, choose Dialog Box as the status type in the Menu Painter. The system does not provide a menu bar or a standard toolbar. In the application toolbar, the function codes PRI, %SC, %SC+, and RW are preset to allow the user to print the list, search for patterns, and leave the window.
REPORT demo_list_window NO STANDARD PAGE HEADING. START-OF_SELECTION. SET PF-STATUS 'BASIC'. WRITE 'Select line for a demonstration of windows'. AT USER-COMMAND. CASE sy-ucomm. WHEN 'SELE'. IF sy-lsind = 1. SET PF-STATUS 'DIALOG'. SET TITLEBAR 'WI1'. WINDOW STARTING AT 5 3 ENDING AT 40 10. WRITE 'Select line for a second window'. ELSEIF sy-lsind = 2. SET PF-STATUS 'DIALOG' EXCLUDING 'SELE'. SET TITLEBAR 'WI2'. WINDOW STARTING AT 45 10 ENDING AT 60 12. WRITE 'Last window'. ENDIF. ENDCASE.
This program sets status BASIC for the basic list. In status BASIC , the function code PICK proposed for function key F2 is replaced by the user-defined function code SELE (text SELECT ), which is also assigned to the pushbutton:
For this reason, SELECT , F2 , and double-clicking the mouse all trigger the event AT USER-COMMAND . In the corresponding processing block, list levels 1 and 2 have the status DIALOG and appear as a dialog box. In the status DIALOG , exactly as for status BASIC , the proposed function code PICK is replaced in the status type Dialog box by SELE and assigned to the application toolbar after RW.
Titles WI1 and WI2 are defined for the dialog boxes. In the second dialog box, the EXCLUDING addition of the SET PF-STATUS statement deactivates function code SELE.
The dialog boxes are displayed with horizontal scrollbars, since the list always has the standard list width of the basic list, and cannot be adapted to the dialog box.