09-09-2008 7:38 AM
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
09-09-2008 8:03 AM
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
09-09-2008 7:42 AM
parameters:
p_matnr like mara-matnr.
start-of-selection.
message 'error' type 'I'.
09-09-2008 7:42 AM
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
09-09-2008 7:48 AM
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
09-09-2008 7:58 AM
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
09-09-2008 8:03 AM
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