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

ABAP Leave Program

Former Member
0 Likes
2,882

Hello Gurus !......I have been trying to leave a program after a report is displayed.  I have a selection screen and after pressing the back button during the report display it always takes me back to the selection screen.  I have tried all sorts of exit processing and nothing seems to work.  Any help would be appreciated.  Thanks, Mike

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,162

hello,

The usual report functionality brings the cursor or user input to the selection screen. If you want to change that, try LEAVE PROGRAM in your back button.

best regards,

swanand

11 REPLIES 11
Read only

former_member214709
Participant
0 Likes
2,162

Dear Michael ,

Try:

Case Sy-ucomm.

When 'BACK'   " For Back

LEAVE TO SCREEN 000. OR CALL TRANSACTION 000. LEAVE LIST PROCESSING

Endcase.

Regards

Dinesh

Read only

0 Likes
2,162

Hi Dinesh....I'm not sure which event block to put this code....I tried in start-of-selection and end-of-selection, but it doesn't seem to work in either of these locatons.....Thanks, Mike

Read only

0 Likes
2,162

Hi Michael,

Try to write the below code in At User-Command event after end-of-selection event.

Case sy-ucomm.

   when '&F03'.  "for Back Button.

      leave to screen 0.

endcase.

I believe you need not to create Gui status for this. Hope this will help you.

shravan

Read only

0 Likes
2,162

Hi Shravan.....I thought this code would work, but for whatever reason it didn't.....Thanks for contributing....Mike

Read only

Former Member
0 Likes
2,162

Hi Michael,

Check out the link given below.

http://wiki.sdn.sap.com/wiki/display/ABAP/GUI+Status+of+A+Program+using+Menu+Painter

Regards,

Akhil

Read only

0 Likes
2,162

Hi Akhil.....Thanks for the link....I didn't want to go down the path of making a GUI status for this, but maybe I'll have to.......Mike

Read only

Former Member
0 Likes
2,163

hello,

The usual report functionality brings the cursor or user input to the selection screen. If you want to change that, try LEAVE PROGRAM in your back button.

best regards,

swanand

Read only

0 Likes
2,162

Hi Swanand......Does this mean I'll have to create a GUI status and program the "BACK" button ?.....I didn't want to create a GUI status unless there was no other solution.......Thanks, Mike    

Read only

0 Likes
2,162

yes please.

Read only

0 Likes
2,162

Hi,

Nope, you don't have to... there's a trick

Instead of using a normal selection screen, define it as a screen...

Ex:

SELECTION-SCREEN BEGIN OF SCREEN 100.

PARAMETERS: p_par TYPE c.

SELECTION-SCREEN END OF SCREEN 100.

START-OF-SELECTION.

     CALL SELECTION-SCREEN 100.

     IF sy-subrc <> 0.

          EXIT.

     ENDIF.

     WRITE: 'Test...'.

Cheers,

Manu.

Read only

0 Likes
2,162

Hi Manu.....Thanks !!,,,This solution worked.....I haven't defined my own selections screen before, so that was new to me......There are alot of ways to do things in ABAP !!.....Thanks again and thanks to all who contributed !!....Mike