‎2005 Oct 06 2:39 PM
Dear Friends,
I am preparing a module pool, in which from one screen, i have to call a selection screen. I want to define this selection screen in the same program. Under which event block, i can define this selection screen?
Once its called, how can i process the selection screen ( like START-OF-SELECTION etc ?). If i use a LEAVE TO LIST-PROCESSING to display some output, how can i process the user actions in this list?
Thanking you in anticipation.
Deepak
‎2005 Oct 06 2:45 PM
In this particular case, I would suggest using a separate report program to handle your selection screen and report output. I don't think that its worth the hassle or the code confustion. Develop you report in another report program and the call it in your module pool using the SUBMIT statement.
Regards,
Rich Heilman
‎2005 Oct 06 2:45 PM
In this particular case, I would suggest using a separate report program to handle your selection screen and report output. I don't think that its worth the hassle or the code confustion. Develop you report in another report program and the call it in your module pool using the SUBMIT statement.
Regards,
Rich Heilman
‎2005 Oct 06 2:46 PM
hi,
create a executable program with selection screen and include all your logic and create a tcode for that also.
call that report program from your module pool PAI event by using submit / call transaction
cheers,
sasi
‎2005 Oct 06 2:50 PM
Hi
You have to define your selection-screen in the top include: use the statament selection-screen:
SELECTION-SCREEN BEGIN OF SCREEN 100.
PARAMETERS: P_BUKRS LIKE T001-BUKRS.
SELECT-OPTION: S_VBELN FOR VBAK-VBELN.
.............
SELECTION-SCREEN END OF SCREEN 100.
After you should create a main screen when you call selection-screen in PBO
PROCESS PBO
MODULE SELECTION_SCREEN.
MODULE SELECTION_SCREEN.
CALL SELECTION-SCREEN 100.
IF SY-SUBRC = 0.
*------> User press F8
PERFORM WRITE_DATA.
ELSE.
*------> User press back, exit
ENDIF.
ENDMODULE
FORM WRITE_DATA.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
WRITE P_BUKRS.
LEAVE SCREEN.
ENDFORM.
max
Message was edited by: max bianchi
‎2005 Oct 07 7:46 AM
HI Max,
Thanks a lot for your reply. It was really helpfull. But my problem is not yet solved.
When i call the selection screen from the PBO of a screen, the selection screen is not being displayed. Only the blank screen is displayed. So i tried another way. I put the CALL SELECTION-ECREEN statement in the USER_COMMAN_100 module of PAI of the previous screen. (ie when user choose a button from the tool bar, in the initial screen the selection screen will be displayed.)
module user_command_0100 input.
OK_SAVE = OK100.
CLEAR OK100.
CASE OK_SAVE.
WHEN 'LIST'.
CALL SELECTION-SCREEN 200.
IF SY-SUBRC = 0.
PERFORM PROCESS_LIST.
ELSE.
leave screen.
ENDIF.
....
endmodule. " USER_COMMAND_0100 INPUT
form process_list.
... reading database...
IF SY-SUBRC = 0.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 100.
SET PF-STATUS 'GUI_LIST'.
LOOP AT ITAB.
WRITE :/ ITAB-BUKRS, ITAB-BELNR, ITAB-GJAHR.
ENDLOOP.
LEAVE SCREEN.
ENDIF.
endform. " PROCESS_LIST
Now i have two problems to solve.
1. I want to come back to the same selection screen (screen no 200) instead of screen 100, when the user click 'back' button in the list. but if i specify screen no 200 in
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 100.
it gives runtime error. ( Msg: Selection screen ZTEST3 0200 was not called using CALL SELECTION-SCREEN). How to return back to selection screen?
and
2. If the user selects a line from the list(PICK/F2), that value has to be passed to the input field of first screen( ie the initial screen from where i called the selection screen : screen no 100) For this, where can i write the code to process the user actions in the list?
Thanking you in anticipation
Deepak
‎2005 Oct 06 2:55 PM
Hi deepak,
Welcome to SDN world.
may be this can help you.
http://help.sap.com/saphelp_erp2004/helpdata/en/47/e07f682b9911d2954f0000e8353423/frameset.htm
reward points for helpfull answers by clicking left side radio buttons and close the thread if your question is solved.
regards,
venu.
‎2005 Oct 23 11:37 AM
HI
You can use this code
The selection screen is 1000
MODULE USER_COMMAND_9000 INPUT.
OK_CODE = sy-ucomm.
CASE OK_CODE.
WHEN'CANCEL'.
<b> IF SY-DYNNR = '1000' .
LEAVE PROGRAM.
ENDIF.
CALL SELECTION-SCREEN '1000'.
LEAVE PROGRAM.
CLEAR : OK_CODE.</b>
WHEN 'EXIT'.
<b> IF SY-DYNNR = '1000' .
LEAVE PROGRAM.
ENDIF.
LEAVE TO SCREEN '0'.
CLEAR : OK_CODE.</b> WHEN 'BACK' .
<b> IF SY-DYNNR = '1000' .
LEAVE PROGRAM.
ENDIF.
CALL SELECTION-SCREEN '1000'.
LEAVE PROGRAM.
CLEAR : OK_CODE.</b>
WHEN 'SAVE'.
PERFORM UPDATE_DB.
ENDCASE.
‎2007 Feb 26 11:50 AM