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

Difference between EXIT and LEAVE THE PROGRAM in WHEN statement.

Former Member
0 Likes
650

Hi ABAP experts,

Can anyone please tell the difference between EXIT and LEAVE THE PROGRAM in WHEN statement.

Thanks,

Creasy Matt

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
585

Hi,

EXIT will take you out from the Current Processing Block i.e WHEN , whereas LEAVE PROGRAM will terminate the program.......

3 REPLIES 3
Read only

Former Member
0 Likes
586

Hi,

EXIT will take you out from the Current Processing Block i.e WHEN , whereas LEAVE PROGRAM will terminate the program.......

Read only

Former Member
0 Likes
585

Hi,

LEAVE PROGRAM always leaves the current program - there is never any processing after LEAVE PROGRAM !

While If you use the EXIT statement within an event block but not in a loop, the system stops processing the block immediatelyand If the EXIT statement occurs inside a DO, WHILE, or LOOP loop, it is the loop that terminates, not the processing block.

I think it will help you.

regards,

Lokesh

Read only

Former Member
0 Likes
585

Hi Mathew,

The EXIT stmt will leave the current porcessing block

The LEAVE PROGRAM stmt will leave the Executing Program.

Regards

GP