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 initial

Former Member
0 Likes
2,110

Hi all,

I have defined a type and then then standard table of this type.

itab TYPE STANDARD TABLE OF ty_itab.

Now I am checking for not blank internal table

if not itab is initial.

Will it work or I need to put [].

Regards,

Jeetu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,211

No need to put [] when checking the table itab.

As the table is defined without header line

itab TYPE STANDARD TABLE OF ty_itab.

So no need to put []with table name when checking it's content.

if i_tab is initial. << Here itab indicates table itself not the header line

So this statement works fine in ur case.

Regards,

Joy.

Edited by: Joyjit Ghosh on Jul 2, 2008 1:09 PM

6 REPLIES 6
Read only

Former Member
0 Likes
1,211

if not itab is initial. <-- this will check only the header line ..

U need to put [].

Read only

Former Member
0 Likes
1,211

Hi,

You need to put [ ].

Thanks,

Sriram Ponna.

Read only

sachin_mathapati
Contributor
0 Likes
1,211

itab without square brackets '[]' checks only for header line..

Hence to check if internal table is initial or not u need to use [].

If itab[] is initial.

Endif.

Read only

Former Member
0 Likes
1,211

data: i_tab type standard table of x_tab initial size 0.

if i_tab is not initial.
*The check will happen for table body as the table has *no header line
endif.
data:i_tabh like x_tab occurs 0.

if i_tabh is not initial.
*The check will happen for table header as the table *has header line
endif. 

so in your case no need for []

Read only

Former Member
0 Likes
1,211

Hi,

As you have define your internal table as :

itab TYPE STANDARD TABLE OF ty_itab

it is a internal table with headerline.

so you need to put itab[] : will check the body of internal table.

itab : will check the headerline.

plz reward if useful.

thanks,

dhanashri.

Read only

Former Member
0 Likes
1,212

No need to put [] when checking the table itab.

As the table is defined without header line

itab TYPE STANDARD TABLE OF ty_itab.

So no need to put []with table name when checking it's content.

if i_tab is initial. << Here itab indicates table itself not the header line

So this statement works fine in ur case.

Regards,

Joy.

Edited by: Joyjit Ghosh on Jul 2, 2008 1:09 PM