2015 Dec 20 11:06 AM
Hi all,
this is a question from a noob. I have two variations of a program. The first is with the standard 'selection screen 1000' and the second is with the 'selection screen begin of 200'.
The difference is that the first (1000) program returns from the error to a blanck screen with five options (Execute, Get Variant..., All Selections, Choose Selection, Program Documentation) and the second returns from the error to blanck screen with no options at all and then I must open the source code again and execute it.
My question is: How can I change the second program so that it displays the same options with the first program?
It would be optimal if I also could return to the selection screen after the error message or before, but as I saw, it is not possible using message type 'e'.
So, the program takes the input from the selection screen, calls a function, if the function returns an error, then it tries to return to selection screen
*----------------Variation 1000 Start-------------------------------
SELECTION-SCREEN...
PARAMETERS ...
SELECTION-SCREEN...
*--------Vaiation 1000 End------------------------------------
*----------------Variation 200 Start-------------------------------
SELECTION-SCREEN: BEGIN OF SCREEN 200.
PARAMETERS ...
SELECTION-SCREEN END OF SCREEN 200.
CALL SELECTION-SCREEN 200.
*--------Vaiation 200 End------------------------------------
AT SELECTION-SCREEN.
START-OF-SELECTION.
CALL FUNCTION 'Z_...'
EXPORTING
...
IMPORTING
...
EXCEPTIONS
error1 = 5
IF sy-subrc = 5.
MESSAGE e002.
* Leave list-processing.
* LEAVE PROGRAM.
* LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
* CALL SELECTION-SCREEN 200.
* STOP.
* RETURN
else
...
...
ENDIF
I use Netweaver 7.4.
Thank you in advance for your time!
Hi,
the cause of your problem is, that on direct program execution the SAP standard calls screen 1000 even if it is not defined. Afterwards your screen 200 is called by CALL SELECTION-SCREEN 200. So in fact you have called two selection screens one after the other... even if you cannot see the first one.
Try to create a transaction code with option 'program and selection screen'. Type in your program name and screen number 200 and it should work like you want it to.
Best regards,
Andreas
2015 Dec 21 11:02 AM
selection screen 1000 is a sap standard selection screen.
however screen 200 wont give the same as of screen 1000 is because you donot have created buttons, text views etc (PBO and PAI ) as of screen 1000 in your screen 200.
Meaning there is a logic (module pool programming) behind screen 1000 that displays those options. But there is nothing behind your screen 200 that would display the same result.
BR,
Ashish Suri.
2015 Dec 21 6:24 PM
Hi,
the cause of your problem is, that on direct program execution the SAP standard calls screen 1000 even if it is not defined. Afterwards your screen 200 is called by CALL SELECTION-SCREEN 200. So in fact you have called two selection screens one after the other... even if you cannot see the first one.
Try to create a transaction code with option 'program and selection screen'. Type in your program name and screen number 200 and it should work like you want it to.
Best regards,
Andreas
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |