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: 

Leave to screen 0 with error message

Former Member
0 Kudos
917

Hi experts,

how can I break the execution and leave the to the initial screen with an error message?

1 ACCEPTED SOLUTION

abapdeveloper20
Contributor
0 Kudos
318

Hi...

Call POP_TO_INFORM function module with an error message to display...

then code... LEAVE TO SCREEN 0 or LEAVE TO SCREEN -1.

4 REPLIES 4

Former Member
0 Kudos
318

Hi,

you can use LEAVE SCREEN or LEAVE TO SCREEN n

and for the message, you can use

MESSAGE ID mid TYPE mtype NUMBER num.

where mtype is 'E' or 'A'

Read the documentation for these instructions.

abapdeveloper20
Contributor
0 Kudos
319

Hi...

Call POP_TO_INFORM function module with an error message to display...

then code... LEAVE TO SCREEN 0 or LEAVE TO SCREEN -1.

Former Member
0 Kudos
318

Hi,

Set some global flag (variable available to both calling and called screen).

leave to screen 0.

Check the flag in called screen and give error message in called screen.

Regards,

Mohaiyuddin

Former Member
0 Kudos
318

Issuing an error message will always stop the execution of the program. Its better to use an information message and use LEAVE TO SCREEN 0.