Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Difference between standard 'selection screen 1000' and 'selection screen begin of...' after error return

Former Member
0 Likes
2,470

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

2 REPLIES 2
Read only

ashish_suri29
Associate
Associate
0 Likes
1,300

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.

Read only

apratsch
Explorer
0 Likes
1,300

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