Application Development 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: 

exit and to back to selection screen

Former Member
0 Kudos

in a routine please advise how do i display an error message and go back to the selection screen????



start of selection
perform f_select

perform f_ALV

form f_select
select from table 

if sy-subrc NE 0
// if i put error message it will exit the program but i want to return to selection screen as well

// i trigger an error message and use EXIT but it continue to the program it only exit the routine
 
endif
endform


endofselectin

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

When you want to give your error message, do it as follows.

MESSAGE (msgnumber) TYPE S.

LEAVE TO LIST-PROCESSING.

The message type needs to be status message.

This would give a message, plus this would take you back to the selection screen.

Best Regards,

Ram.

Edited by: ram Kumar on Sep 9, 2008 9:04 AM

5 REPLIES 5

Former Member
0 Kudos

parameters:

p_matnr like mara-matnr.

start-of-selection.

message 'error' type 'I'.

Former Member
0 Kudos

If possible use message of type 'I' which will give pop-up message. and you click on 'OK' it will navigate to selection screen again.

Regards,

Aparna Gaikwad

0 Kudos

but with the information message it will continue with the program and will display an empty ALV list

i don't what to continue with the program and display an empty list

Former Member
0 Kudos

Hi,

You can try inside the sub Routine.

Message 'Some Msg' TYPE E.

Leave to Screen 1000.

As default Selection Screen No is 1000. I think that will help.

Regards

Sumit Agarwal

Former Member
0 Kudos

Hi,

When you want to give your error message, do it as follows.

MESSAGE (msgnumber) TYPE S.

LEAVE TO LIST-PROCESSING.

The message type needs to be status message.

This would give a message, plus this would take you back to the selection screen.

Best Regards,

Ram.

Edited by: ram Kumar on Sep 9, 2008 9:04 AM