‎2012 Aug 09 2:35 PM
Hi,
I want to display 2 fields as select options in a custom module pool screen.
This screen will get trigger through a custom button in the ALV toolbar.
Also this screen has two push buttons which needs to be handled in the PAI.
The main problem here is to display the fields as select options. Declaring a selection screen as a subscreen and calling it here also wont help as this must trigger in the user command of the ALV screen.
I have attached the screenshot of the necessary screen which needs to be designed.
‎2012 Aug 09 3:22 PM
Hi
At first create a selection screen in your module as following
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW TITLE TEXT-T01.
SELECT-OPTIONS : S_BUKRS FOR T001-BUKRS,
S_LAND1 FOR T001-LAND1.
SELECTION-SCREEN END OF SCREEN 500.
At next in the user command form call the selection screen as the example
FORM USER_COMMAND USING IV_UCOMM TYPE SY-UCOMM
IS_SELFIELD TYPE SLIS_SELFIELD.
CASE IV_UCOMM.
WHEN 'UCOM1. "YOUR COMMAND CODE
CALL SELECTION-SCREEN '0500' STARTING AT 10 10.
WHEN OTHERS.
ENDCASE.
END FORM.
‎2012 Aug 09 3:22 PM
Hi
At first create a selection screen in your module as following
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW TITLE TEXT-T01.
SELECT-OPTIONS : S_BUKRS FOR T001-BUKRS,
S_LAND1 FOR T001-LAND1.
SELECTION-SCREEN END OF SCREEN 500.
At next in the user command form call the selection screen as the example
FORM USER_COMMAND USING IV_UCOMM TYPE SY-UCOMM
IS_SELFIELD TYPE SLIS_SELFIELD.
CASE IV_UCOMM.
WHEN 'UCOM1. "YOUR COMMAND CODE
CALL SELECTION-SCREEN '0500' STARTING AT 10 10.
WHEN OTHERS.
ENDCASE.
END FORM.
‎2012 Aug 09 3:45 PM
Also how to handle the push buttons in the screen? If we display it as you said default buttons of selection screen like execute,save,check and cancel will appear. Is there any way to suppress those?
‎2012 Aug 09 5:45 PM
Use this in combination with the response from Kumar Gourav.
You need to define the selection-screen as a Subscreen, not a Window. This will allow the main screen status to replace the selection-screen functions.
So, create screen 100 as Kumar G. suggested, and include the screen that George sugessted, but defined as subscreen instead. Make sure you include the subscreen in the flow logic of screen 100, the main screen.
Regards,
Vamshi J.
‎2012 Aug 10 11:25 AM
Try something like that.
PROGRAM Z_TEST.
TABLES : T001.
DATA ITAB TYPE TABLE OF T001.
DATA: GT_EXCLUDE TYPE TABLE OF RSEXFCODE,
GS_EXCLUDE TYPE RSEXFCODE.
INCLUDE <ICONS>.
*****1000
SELECT-OPTIONS S_BUK1 FOR T001-BUKRS.
*****0500
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW TITLE TEXT-T01.
SELECT-OPTIONS : S_BUKRS FOR T001-BUKRS,
S_LAND1 FOR T001-LAND1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN PUSHBUTTON 02(15) BUT1 USER-COMMAND BT01.
SELECTION-SCREEN PUSHBUTTON 30(15) BUT2 USER-COMMAND BT02.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF SCREEN 500.
INITIALIZATION.
GS_EXCLUDE-FCODE = 'ONLI'.
APPEND GS_EXCLUDE TO GT_EXCLUDE.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = ICON_OKAY
TEXT = ''
INFO = 'Continue'
IMPORTING
RESULT = BUT1
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
NAME = ICON_CANCEL
TEXT = ''
INFO = 'Cancel'
IMPORTING
RESULT = BUT2
EXCEPTIONS
OTHERS = 0.
AT SELECTION-SCREEN OUTPUT.
IF SY-DYNNR = '0500'.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
P_STATUS = '%_00'
P_PROGRAM = 'RSSYSTDB'
TABLES
P_EXCLUDE = GT_EXCLUDE.
ENDIF.
AT SELECTION-SCREEN.
IF SY-DYNNR = '0500'.
CASE SY-UCOMM.
WHEN 'BT01'.
WHEN 'BT02'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDIF.
START-OF-SELECTION.
SELECT * FROM T001 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE BUKRS IN S_BUK1.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
I_CALLBACK_PROGRAM = 'Z_GTREN_TEST'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME = 'T001'
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
*&---------------------------------------------------------------------*
*& Form USER_COMMAND
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->IV_UCOMM text
* -->IS_SELFIELD text
*----------------------------------------------------------------------*
FORM USER_COMMAND USING IV_UCOMM TYPE SY-UCOMM
IS_SELFIELD TYPE SLIS_SELFIELD.
CASE IV_UCOMM.
WHEN '&IC1'. "YOUR COMMAND CODE
CALL SELECTION-SCREEN '0500' STARTING AT 10 10.
WHEN OTHERS.
ENDCASE.
ENDFORM. "USER_COMMAND
‎2012 Aug 09 3:29 PM
Hi,
Can u try like this,
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 .
>
Now double click on cal screen 100 and follow this 4 steps
*&---------------------------------------------------------------------*
*& 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
>>
1)Then define screen 100 with subscreen area ,
2)Do not forget to define pf status,
3)Put code in PBO and PAI of screen as shown in below screen shot.
after this double click on all module & write logic in corresponding block.
4)At last carefully activate all objects and run it.
Regards
Kumar Gourav.
‎2012 Aug 09 3:38 PM
I cant call it in PBO.. It has to be triggered through the custom button in the ALV toolbar
‎2012 Aug 09 4:00 PM
This link in scn will help u for push button in selection screen concept,
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/content.htm
otherwise u can try this coding also as this is also for pushbutton help
http://www.sapdev.co.uk/reporting/selscr/but_buttons.htm
Gourav.
‎2012 Aug 09 4:06 PM
I dont think you understand my issue correctly.. My problem is not to display the push buttons in the screen.. How to display the screen and handle the buttons of the custom module pool screen..
‎2012 Aug 09 4:27 PM
‎2012 Aug 09 9:37 PM
The 'call subscreen' can be easily handled in the PBO and PAI of the screen you call and that has the pushbuttons. They can also be handled in the PAI of this screen.
- define screen with subscreen and pushbuttons
- define subscreen are in this screen
- call your selection screen defined before as subscreen in PBO and PAI (yes both!) of the button screen
- define PAI logic for the button screen
- call altogether from ALV user_command.
I don't see the big problem. Get involved with subscreens, there's good SAP help.
Regards
Clemens
‎2012 Sep 05 12:12 PM
Hi Sharan, I guess you are looking for way to create select-option in module pool program.. for this you can use FM - RS_COMPLEX_SELECTION.
Regards,
Rajesh
‎2012 Sep 05 12:50 PM
HI,
TABLES: MARA.
SELECTION-SCREEN: BEGIN OF SCREEN 0021 AS SUBSCREEN.
SELECT-OPTIONS: S_MAT FOR MARA-MATNR.
SELECTION-SCREEN: END OF SCREEN 0021.
create a subscreen area(layout) in your normal screen using 'layout' button.
this is normal screen flow-logic.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0001.
call SUBSCREEN SUB INCLUDING SY-REPID '0021'.
*
PROCESS AFTER INPUT.
call SUBSCREEN SUB .
* FIELD S_MAT
MODULE USER_COMMAND_0001.
hope it will work.
regards
Sabyasachi Karforma