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

enpty table

Former Member
0 Likes
1,006

hi experts

how do i check if a table is empty

thanks

amit

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
983

hi,

do this way ..


if itab[] is initial.

endif.

hi experts

how do i check if a table is empty

thanks

amit

7 REPLIES 7
Read only

Former Member
0 Likes
983

if itab is initial

Read only

Former Member
0 Likes
983

hi

you can use IS INITIAL command in an if loop.

this will help.

reward if useful.

Regards

Sumit Agarwal

Read only

Former Member
0 Likes
984

hi,

do this way ..


if itab[] is initial.

endif.

Read only

Former Member
0 Likes
983

There are 2 alternatives:

1) After the select query check SY-SUBRC.

2)Use:

if itab[] is initial.

endif.

Read only

Former Member
0 Likes
983

hi,

if you check an internal table (Say, itab) with header line, then

if itab[] is initial.

endif.

if itab is without header line, then use

if itab is initial.

endif.

it will defenitely work.

Award if found helpful.

Anirban Bhattacharjee

Read only

Former Member
0 Likes
983

Hi,

Go to SE11.

Put The table name In Database 'Table Field'

click 'Diaplay' Or 'Change' Pushbutton Below.

The Press CtrlshiftF10 A screen is Displayed.

Noe In The Application toolber Click On 'Number Of Entries'

Button If Entry 0 Means Table is Empty.

Let Me know if any Confusion.

Read only

Former Member
0 Likes
983

Hi,

Fire a select query on that table and take the values in an internal table. If the internal table is empty, ur table is empty.

The command is

if itab[] is initial.

endif.

Nayan