10-07-2008 9:32 AM
I am selecting some values using select statement
If the select fails i.e sy-subrc ne 0 i need to leave the program.
Is there any way
10-07-2008 9:34 AM
Hi you can code like this
Select kunnr
name1
ort01
land1 from kna1 into table it_kna1.
if it_kna1 is not inital.
loop at it_kna1.
ur code
endloop.
Else.
Message 'No data Available' type 'S'.
endif.
Regards
10-07-2008 9:34 AM
Hi you can code like this
Select kunnr
name1
ort01
land1 from kna1 into table it_kna1.
if it_kna1 is not inital.
loop at it_kna1.
ur code
endloop.
Else.
Message 'No data Available' type 'S'.
endif.
Regards
10-07-2008 9:38 AM
10-07-2008 9:42 AM
after select statement just check the sy-subrc value.
if sy-sbbrc ne 0.
exit. (or) LEAVE LIST-PROCESSING
endif.
Regards,
Suresh
10-07-2008 9:42 AM
10-07-2008 9:48 AM
Hi,
Leave list-processing is the better way of leaving the program.
10-07-2008 9:50 AM
10-07-2008 9:51 AM
10-07-2008 10:09 AM
Hi,
if sy-subrc ne 0.
STOP.
endif.
or
if sy-subrc ne 0.
message i398(00) with 'No Data Found'.
STOP.
endif.
Thanks,
Durai.V
10-07-2008 10:12 AM