Simple way of defining Select-options in Module Pool Programming
Defining select-options in selection-screen is easy task but in module pool it is slightly tricky.
Selection-screen can be defined as subscreen and can be applied in the subscreen area of module pool program.
Create report with following code.
REPORT zselectoptions.
TABLES : vbrk , vbrp .
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
PARAMETERS : p_vkorg TYPE vbrk-vkorg OBLIGATORY DEFAULT '1000'.
SELECT-OPTIONS : s_vbeln FOR vbrk-vbeln,
s_posnr FOR vbrp-posnr.
SELECTION-SCREEN END OF SCREEN 400 .
START-OF-SELECTION .
CALL SCREEN 100 .
*&---------------------------------------------------------------------*
*& Module STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_0100 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_0100 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE USER_COMMAND_0100 INPUT.
ENDMODULE. " USER_COMMAND_0100 INPUT
Define screen 100 with subcreen area SEL as shown in below .
Define PF status and title bar with any names. This is not shown in screen shot.
Put code in PBO and PAI of screen as shown in below screen shot.
Call subscreen sel including sy-repid ‘400’.
Activate all objects and execute the report you should get following module pool screen with select-options.
No comments:
Post a Comment