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

EXIT from Program

Former Member
0 Likes
1,121

Hi

I have to exit the entire program if an internal table contains 0 records.

Can I use the EXIT statement for this purpose?

Like....

if itab[] is initial.

exit.

else.

-


endif.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,092

Hi,

You can use EXIT command in the Report programme..

Better to use Leave to List Processing.

Regards,

Deepthi.

8 REPLIES 8
Read only

Former Member
0 Likes
1,092

Hmm

Read only

0 Likes
1,092

Sorry? U mean YES?

Read only

0 Likes
1,092

Exit will only breaks your

if itab[] is initial.

exit.

.......

condition.

rest program processing would continue .

Read only

Former Member
0 Likes
1,092

Hi,

Try leave program.

Cheers

Read only

Former Member
0 Likes
1,092

Hi,

Is this a Report program?. If yes, Then try the following which will suit well instead of Exit.

LEAVE LIST-PROCESSING

Cheers,

Kothand

Read only

Former Member
0 Likes
1,093

Hi,

You can use EXIT command in the Report programme..

Better to use Leave to List Processing.

Regards,

Deepthi.

Read only

Former Member
0 Likes
1,092

Hi,

...

start-of-selection.

fill itab.

if itab[] is initial.

message ...

exit.

endif.

......

end-of-selection.

Regards, Dieter

Read only

Former Member
0 Likes
1,092

Hi,

Yes, Youn can write that statement.

Data : itab type table of spfli,
       wa type spfli.

parameters : p_carrid like spfli-carrid.

start-of-selection.

select * from spfli into table itab where carrid = p_carrid.

if itab[] is initial.
EXIT.
endif.

Regards,

Kasuladevi.