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

Types and Data - Internal Tables

Former Member
0 Likes
646

Hi All,

I have a small question. Please help me resolve this.

I am declaring 2 internal tables.

TYPES: BEGIN OF ITAB1,

COL1(5),

COL2(5),

END OF ITAB1.

DATA: ITAB2 TYPE TABLE OF ITAB1 WITH HEADERLINE.

DATA: BEGIN OF ITAB3,

COL1(5),

COL2(5),

END OF ITAB1.

DATA: ITAB4 LIKE TABLE OF ITAB3 WITH HEADERLINE.

Both the tables ITAB2 and ITAB4 have body and the work area defined in that.. Am I right?

And ITAB3 as such can be separately used as workarea, but ITAB1 cannot be used... Is this right?

Expecting the reply at the earliest...

Thanks in advance,

Smitha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
626

Hi,

Both the tables ITAB2 and ITAB4 have body and the work area defined in that.. Am I right? Yes, you are right.

And ITAB3 as such can be separately used as workarea, but ITAB1 cannot be used... Is this right? Yes, this is right.

Regards,

Ferry Lianto

Hi All,

I have a small question. Please help me resolve this.

I am declaring 2 internal tables.

TYPES: BEGIN OF ITAB1,

COL1(5),

COL2(5),

END OF ITAB1.

DATA: ITAB2 TYPE TABLE OF ITAB1 WITH HEADERLINE.

DATA: BEGIN OF ITAB3,

COL1(5),

COL2(5),

END OF ITAB1.

DATA: ITAB4 LIKE TABLE OF ITAB3 WITH HEADERLINE.

Both the tables ITAB2 and ITAB4 have body and the work area defined in that.. Am I right?

And ITAB3 as such can be separately used as workarea, but ITAB1 cannot be used... Is this right?

Expecting the reply at the earliest...

Thanks in advance,

Smitha

4 REPLIES 4
Read only

Former Member
0 Likes
627

Hi,

Both the tables ITAB2 and ITAB4 have body and the work area defined in that.. Am I right? Yes, you are right.

And ITAB3 as such can be separately used as workarea, but ITAB1 cannot be used... Is this right? Yes, this is right.

Regards,

Ferry Lianto

Read only

0 Likes
626

Hi Ferry Lianto,

Thankyou very much...

Also my doubt is that ITAB1 is not even a structure, which cannot be used as work area..?

Thanks,

Smitha

Read only

Former Member
0 Likes
626

hi Smitha,

u can Declare the itab3 using HeaderLine 2, only insert "Occurs n" at code, like:

DATA: BEGIN OF ITAB3 <b>occurs 0</b>,

COL1(5),

COL2(5),

END OF ITAB1.

maybe it's help u 2...

Regards

Allan Cristian

Read only

Former Member
0 Likes
626

Both are correct.

Type declarations you do when ever you wanted to create your own structure....

In ECC some rules for the internal tables should be followed i guess...

do not used header line.

compsary used work area.

so some examples

data: it_db type standard table of kna1,

wa_db type kna1.

types: begin of ty_itab,

fiel1..

2

3

end of ty_itab.

data: it_db type standard table of ty_itab,

wa_db type ty_itab.

so thats y u used types declaration....