Application Development 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: 

EXIT from Program

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

You can use EXIT command in the Report programme..

Better to use Leave to List Processing.

Regards,

Deepthi.

8 REPLIES 8

former_member181995
Active Contributor
0 Kudos

Hmm

0 Kudos

Sorry? U mean YES?

0 Kudos

Exit will only breaks your

if itab[] is initial.

exit.

.......

condition.

rest program processing would continue .

Former Member
0 Kudos

Hi,

Try leave program.

Cheers

Former Member
0 Kudos

Hi,

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

LEAVE LIST-PROCESSING

Cheers,

Kothand

Former Member
0 Kudos

Hi,

You can use EXIT command in the Report programme..

Better to use Leave to List Processing.

Regards,

Deepthi.

Former Member
0 Kudos

Hi,

...

start-of-selection.

fill itab.

if itab[] is initial.

message ...

exit.

endif.

......

end-of-selection.

Regards, Dieter

Former Member
0 Kudos

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.