2007 Dec 06 8:43 PM
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.
2007 Dec 06 8:56 PM
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
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.
2007 Dec 06 8:56 PM
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
2007 Dec 06 9:52 PM
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
2007 Dec 06 10:43 PM
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
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |