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,404

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,375

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,375

Hmm

Read only

0 Likes
1,375

Sorry? U mean YES?

Read only

0 Likes
1,375

Exit will only breaks your

if itab[] is initial.

exit.

.......

condition.

rest program processing would continue .

Read only

Former Member
0 Likes
1,375

Hi,

Try leave program.

Cheers

Read only

Former Member
0 Likes
1,375

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,376

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,375

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,375

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.