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

Itab Declaration

Former Member
0 Likes
703

TYPES: BEGIN OF LINE,

COL1,

COL2,

END OF LINE.

TYPES: ITAB TYPE TABLE OF LINE.

-


TYPES: BEGIN OF LINE,

COL1,

COL2,

END OF LINE.

DATA : ITAB LIKE TABLE OF LINE.

-


DATA: BEGIN OF LINE,

COL1,

COL2,

END OF LINE.

DATA: ITAB LIKE TABLE OF LINE.

-


Which is the Correct Declaration of INTERNAL TABLE ?

Thanks in Advance

Krish...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
678

Hi,

the third declaration i.e.DATA: BEGIN OF LINE,

COL1,

COL2,

END OF LINE.

DATA: ITAB LIKE TABLE OF LINE.

is correct but modify it as:

DATA: ITAB LIKE TABLE OF LINE <b>WITH HEADER LINE</b>.

Hope it helps.

Reward if helpful.

Regards,

Sipra

7 REPLIES 7
Read only

Former Member
0 Likes
678
TYPES: BEGIN OF LINE,
COL1,
COL2,
END OF LINE.

DATA : ITAB LIKE TABLE OF LINE.
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
678

Hi,

TYPES: BEGIN OF LINE,

COL1,

COL2,

END OF LINE.

Data ITAB TYPE TABLE OF LINE.

is the correct one.

DATA: BEGIN OF LINE,

COL1,

COL2,

END OF LINE.

DATA: ITAB LIKE TABLE OF LINE.

will create line as internal table and itab as work area.

Message was edited by:

Jayanthi Jayaraman

Read only

Former Member
0 Likes
678

1 .


   TYPES: BEGIN OF LINE,
COL1,
COL2,
END OF LINE.

DATA : ITAB TYPE TABLE OF LINE with header line.

2.

 DATA: BEGIN OF LINE, occurs 0
COL1,
COL2,
END OF LINE.

Read only

Former Member
0 Likes
678

hi,

the third one is rite.

1st one creates only table type.

second one will throw an error saying there is no object line.

the third one is perfect

santhosh

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
678

Hi,

The third one is the right option, LIKE you can use for DATA only.

First one creates a TABLE TYPE not the internal table.

Second one is syntactically wrong.

So the third one is correct.

Regards,

Sesh

Read only

Former Member
0 Likes
678

hi,

this declaration is correct.

DATA: BEGIN OF LINE,

COL1,

COL2,

END OF LINE.

DATA: ITAB LIKE TABLE OF LINE.

-


regards,

Ajith

mark if useful.

Read only

Former Member
0 Likes
679

Hi,

the third declaration i.e.DATA: BEGIN OF LINE,

COL1,

COL2,

END OF LINE.

DATA: ITAB LIKE TABLE OF LINE.

is correct but modify it as:

DATA: ITAB LIKE TABLE OF LINE <b>WITH HEADER LINE</b>.

Hope it helps.

Reward if helpful.

Regards,

Sipra