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

Leaving the screen

sharadendu_agrawal
Active Participant
0 Likes
821

Hi All-

I want to come out of the main program if the condition failed in the user-exit...

I have standard SAP program(SAPMQEVA) and inside that there is a user-exit(EXIT_SAPMQEVA_010 ). Whenver the cursor goes inside the user-exit and if the condition failed then the entire process should terminate and come out of the main program and the screen we get after logging into the SAP system(when we first enter the transaction) should appear.

Plz help me.

Sharadendu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
771

Hi,

Use Leave Program .

reward points if helpful.

Revert back if any issues.

Regards,

Naveen

Hi All-

I want to come out of the main program if the condition failed in the user-exit...

I have standard SAP program(SAPMQEVA) and inside that there is a user-exit(EXIT_SAPMQEVA_010 ). Whenver the cursor goes inside the user-exit and if the condition failed then the entire process should terminate and come out of the main program and the screen we get after logging into the SAP system(when we first enter the transaction) should appear.

Plz help me.

Sharadendu

4 REPLIES 4
Read only

Former Member
0 Likes
772

Hi,

Use Leave Program .

reward points if helpful.

Revert back if any issues.

Regards,

Naveen

Read only

Former Member
0 Likes
771

Hi

Generally we use

EXIT or STOP

commands

in the report programs to comeout of that process loop.

You can use one of them and check, what happens.

Ofcourse in Module pool we may use LEAVE PROGRAM.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
771

u can use,

EXIT PROGRAM.

please reward some points if useful.

Regards,

Padmakar

Read only

Former Member
0 Likes
771

You check the condition and place a error message. It will take u out from the program.

If sy-subrc <> 0.
   message e000(001) with 'no data'.
endif.