‎2006 Jul 16 3:21 PM
Hi friends,
I have a problem with the selection screen 1000. The buttons on the standard toolbar wont work when i call the screen 1000 in the program. what do i do?
thanks
‎2006 Jul 17 11:21 AM
Hi Reson,
Got your problem.
Happening the same with me its looping. Not able to come out of selection screen by clicking back.
You can click <b>EXIT</b> .
Consider this code.
REPORT zztest.
SELECTION-SCREEN BEGIN OF BLOCK abc WITH FRAME .
PARAMETERS : p_matnr TYPE mara-matnr,
p_werks TYPE t001w-werks.
SELECTION-SCREEN END OF BLOCK abc.
AT SELECTION-SCREEN ON p_matnr.
SELECT SINGLE matnr FROM mara INTO (p_matnr) WHERE matnr = p_matnr.
IF sy-subrc NE 0.
MESSAGE 'Enter correct Material Number' TYPE 'S' DISPLAY LIKE 'E'.
CALL SELECTION-SCREEN 1000.
ENDIF.
AT SELECTION-SCREEN ON p_werks.
SELECT SINGLE werks FROM t001w INTO (p_werks) WHERE werks = p_werks.
IF sy-subrc NE 0.
MESSAGE 'Enter correct Plant' TYPE 'S' DISPLAY LIKE 'E'.
CALL SELECTION-SCREEN 1000.
ENDIF.
Regards,
Arun Sambargi.
‎2006 Jul 16 3:45 PM
Hi Reson,
Just tested this code, its working fine for me.
REPORT zztest.
SELECTION-SCREEN BEGIN OF BLOCK abc WITH FRAME .
PARAMETERS : matnr TYPE mara-matnr.
SELECTION-SCREEN END OF BLOCK abc.
SELECTION-SCREEN BEGIN OF SCREEN 1001.
PARAMETERS: ptest(5).
SELECTION-SCREEN END OF SCREEN 1001.
START-OF-SELECTION.
IF matnr IS INITIAL .
CALL SELECTION-SCREEN 1000.
ELSE.
CALL SELECTION-SCREEN 1001.
ENDIF.
Check whether you have used custom GUI-status for your program using the statement <b>SET PF-STATUS</b>, if used then define the standard application keys there (SE41 Menu Painter).
Regards,
Arun Sambargi.
‎2006 Jul 17 11:08 AM
Hi Arun,
What you are suggesting has two screens on it. Can we not do with a single screen i.e. 1000 only. Using your sample code it takes me to screen 1001 and then kicks me out. In my case when i hit the back button after i execute the selection parameters the program loops me at the same screen(screen 1000) till i pass the parameters that have valid data in the database.
Scenario: I am calling screen 100 in a loop till the selection values passed by the user fetches the data. If there is no data then the screen 1000 is called again. During this time if the user wants to kick out of the screen 1000 he should hit the back or cancel button. In my case at this point those buttons continue to loop to the same screen 1000.
Thanks
‎2006 Jul 16 5:39 PM
Could you please explain in detail, which buttons you are referring to? By default, all it will have is a execute button ... What is the problem you are facing?
Regards,
Ravi
‎2006 Jul 17 10:47 AM
Hi folks,
Sorry for not having stated my problem clearly. You are right about having only the execute button on the application bar for screen 1000. I was referring to the standard tool bar buttons like the back save exit cancel etc. None of these buttons work for me. All they do is take me back to the screen 1000 and i loop at that point. Do i have to put a check condition using some system variables that get triggered when i hit those buttons.
Thanks.
‎2006 Jul 17 11:12 AM
1. If you are using the BACK/EXIT/ CANCEL button from the output of the report they will take you to the selection screen.
2. If you are using these from the selection screen they will take you out of the selection screen.
What do you mean its going in loop?
Regards,
Ravi
Note : Please mark all the helpful answers
‎2006 Jul 17 3:21 AM
Hi Reson,
I agree with Ravi, the application toolbar will have 'Execute' button plugging in. However, if you need to add additional button in selection screen 1000, please refer the following code:
Add customize button on the application toolbar.
TABLES sscrfields. "Fields on selection screens
SELECTION-SCREEN FUNCTION KEY 1. "button on the application toolbar
INITIALIZATION.
*
Populate button name on the application toolbar.
MOVE 'Button 1' TO sscrfields-functxt_01.
AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'FC01'.
message 'New button added at application toolbar.' type 'I'.
ENDIF.
Thanks and regards,
Patrick
‎2006 Jul 17 11:21 AM
Hi Reson,
Got your problem.
Happening the same with me its looping. Not able to come out of selection screen by clicking back.
You can click <b>EXIT</b> .
Consider this code.
REPORT zztest.
SELECTION-SCREEN BEGIN OF BLOCK abc WITH FRAME .
PARAMETERS : p_matnr TYPE mara-matnr,
p_werks TYPE t001w-werks.
SELECTION-SCREEN END OF BLOCK abc.
AT SELECTION-SCREEN ON p_matnr.
SELECT SINGLE matnr FROM mara INTO (p_matnr) WHERE matnr = p_matnr.
IF sy-subrc NE 0.
MESSAGE 'Enter correct Material Number' TYPE 'S' DISPLAY LIKE 'E'.
CALL SELECTION-SCREEN 1000.
ENDIF.
AT SELECTION-SCREEN ON p_werks.
SELECT SINGLE werks FROM t001w INTO (p_werks) WHERE werks = p_werks.
IF sy-subrc NE 0.
MESSAGE 'Enter correct Plant' TYPE 'S' DISPLAY LIKE 'E'.
CALL SELECTION-SCREEN 1000.
ENDIF.
Regards,
Arun Sambargi.
‎2006 Jul 17 11:33 AM
Hi Reson,
This code solves your problem.
REPORT zztest.
SELECTION-SCREEN BEGIN OF BLOCK abc WITH FRAME .
PARAMETERS : p_matnr TYPE mara-matnr,
p_werks TYPE t001w-werks.
SELECTION-SCREEN END OF BLOCK abc.
AT SELECTION-SCREEN ON p_matnr.
IF p_matnr IS NOT INITIAL.
SELECT SINGLE matnr FROM mara INTO (p_matnr) WHERE matnr = p_matnr.
IF sy-subrc NE 0.
MESSAGE 'Enter correct Material Number' TYPE 'S' DISPLAY LIKE 'E'.
CALL SELECTION-SCREEN 1000.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON p_werks.
IF p_werks IS NOT INITIAL.
SELECT SINGLE werks FROM t001w INTO (p_werks) WHERE werks = p_werks.
IF sy-subrc NE 0.
MESSAGE 'Enter correct Plant' TYPE 'S' DISPLAY LIKE 'E'.
CALL SELECTION-SCREEN 1000.
ENDIF.
ENDIF.
*This event is executed at the exit command of the *selection screen - that is, at <b>Back</b>, <b>Cancel</b>, or <b>End</b>
<b> AT SELECTION-SCREEN ON EXIT-COMMAND .
LEAVE PROGRAM.</b>
Close the thread if your problem is solved.
Regards,
Arun Sambargi.