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

Hardcore ABAP question.

Former Member
0 Likes
1,200

When I give the data as :

code:

DATA BEGIN OF gt_list OCCURS 0.

INCLUDE STRUCTURE SFLIGHT.

DATA END OF gt_list.

...

SELECT * FROM sflight

UP TO 100 ROWS

INTO TABLE gt_list.

then in debugging the field value of table gt_list shows that the table is non-character like structure.

But, when I declare the same data as:

DATA gt_list TYPE STANDARD TABLE OF sflight.

Then I don not get such a message rather I see Table [100 x 80] in the field value of the debugger/.

What is the difference between the two ways of declaring?

Thanks,

Charles.

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
0 Likes
693

With the first option, try to see the values like GT_LIST[]. Here you will see [100X80].

GT_LIST[] represents the internal table when table is created with hte header line

GT_LIST represents the header line of that internal table. So, you get the characther like structure.

Regards

Naimesh Patel

With the first option, try to see the values like GT_LIST[]. Here you will see [100X80].

GT_LIST[] represents the internal table when table is created with hte header line

GT_LIST represents the header line of that internal table. So, you get the characther like structure.

Regards

Naimesh Patel

3 REPLIES 3
Read only

naimesh_patel
Active Contributor
0 Likes
694

With the first option, try to see the values like GT_LIST[]. Here you will see [100X80].

GT_LIST[] represents the internal table when table is created with hte header line

GT_LIST represents the header line of that internal table. So, you get the characther like structure.

Regards

Naimesh Patel

Read only

0 Likes
693

Just adding to what Naimesh mentioned, with BEGIN OF...declaration internal table is created with header line where with TYPE TABLE OF....declaration you get an internal table without a header line.

So when so refer to gt_list without [], you are referring to the <b>header line</b> and not the table body. Where as with the other declaration, gt_list refers to the table body as there is no header line.

Anyways, stop using OCCURRS.. as it is obsolete now.

Thanks

Sanjeev

Read only

Former Member
0 Likes
693

hi,

In the first case GT_LIST is a table with header line.

In the second case GT_LIST is table without header line.

Regards,

Vara