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

check internal tabel

Former Member
0 Likes
901

can u please tell to code to check internal table for no record. i want to check the content of internal table and write code if internal table has no record. my internal table name is wa

please help

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
881

if wa[] is initial.

message 'No records in internal table!!' type 'E'.

endif.

7 REPLIES 7
Read only

Former Member
0 Likes
881

if itab[] is initial.

message 'No data ' type 'E'.

else.

loop at itab.

write : ...

endloop.

endif.

regards

shiba dutta

Read only

Former Member
0 Likes
881

hi,

if not wa[] is initial.

message 'no records are avbl'.

esle.

your logic.

endif.

reward points if useful,

regards,

seshu.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
881

Hi,

here is code

if LINES(wa) LE 0.

Regards,

Sesh

.

Read only

Former Member
0 Likes
881

Hi,

Check this..



DESCRIBE TABLE WA.

IF SY-TFILL IS INITIAL.
  WRITE: / 'No records'.
ENDIF.

Thanks,

Naren

Read only

Former Member
0 Likes
882

if wa[] is initial.

message 'No records in internal table!!' type 'E'.

endif.

Read only

anversha_s
Active Contributor
0 Likes
881

hi,

chk this.

if itab[] is initial.
*no data.
else
*data available.
endif.

Rgds

Anver

Read only

former_member673464
Active Contributor
0 Likes
881

hi..

Use loopat for your requirement .When there is any record in the internal table sy-subrc is 0, otherwise if internal table has no records then the sy-subrc will set to 4. (or )use describe to get number of records .If number of records or zero.You can write the code as per your requirement.

regards,

veeresh