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

regarding exiting from a program

Former Member
0 Likes
813

is there any statement to come completly out of the i f som econdition fails

thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
783

Hello Mohan,

U can use Leave Program Stmt.

Or Stop.

If u use stop the control will directly goes to the end of selection.

Hope this will be useful for u.

Don't FOrget to reward points.

Regards,

Vasanth

7 REPLIES 7
Read only

Laxmana_Appana_
Active Contributor
0 Likes
783

Hi,

Use EXIT statement.

Laxman

Read only

Former Member
0 Likes
783

you can use

<b>EXIT

CONTINUE</b>

Or use the <b>CHECK</b> statement instead of IF Statement

Read only

Former Member
0 Likes
784

Hello Mohan,

U can use Leave Program Stmt.

Or Stop.

If u use stop the control will directly goes to the end of selection.

Hope this will be useful for u.

Don't FOrget to reward points.

Regards,

Vasanth

Read only

Former Member
0 Likes
783

hi mohan,

give leave program.

if sy-ucomm = 'BACK'.

leave program.

endif.

Read only

Former Member
0 Likes
783

You can use the keyword STOP if you are using a report program. It will stop the execution of the program.

Hope this helps.

Sudha

Read only

0 Likes
783

It depends on how you want to end it. Do you want to give some message to the user and end? If so, you can give an abend message.

message A001(00) with 'This program is ending'.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
783

Hi mohan,

if cond = true.

.

.

else.

exit.

endif.

regards,

keerthi.