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

Doubt in Internal table

Former Member
0 Likes
1,059

Hi All.

I need to create one internal table(it_doc) with reference on another internal table(it_mer).

after that i need to move all records from it_mer to it_doc.

pls refer my code.iam getting error like "it_doc is not an internal table".

DATA: BEGIN OF wa_mer,

lifnr TYPE ekko-lifnr,

ekorg TYPE ekko-ekorg,

verkf TYPE ekko-verkf,

ekgrp_allow TYPE ekko-ekgrp_allow,

ebelp TYPE ekpo-ebelp,

matnr TYPE ekpo-matnr,

werks TYPE ekpo-werks,

bednr TYPE ekpo-bednr,

matkl TYPE ekpo-matkl,

END OF wa_mer.

DATA:it_mer LIKE TABLE OF wa_mer WITH HEADER LINE.

DATA:it_doc like it_mer with header line.

(some process for fetch records from database......)

it_doc_loc_coll[] = it_merge[].

where i done mistake.pls help me.

To be reward all helpfull answers.

Regards.

Jay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,041

DATA:it_doc like it_mer <b>occurs 0</b> with header line.

regards

shiba dutta

Hi All.

I need to create one internal table(it_doc) with reference on another internal table(it_mer).

after that i need to move all records from it_mer to it_doc.

pls refer my code.iam getting error like "it_doc is not an internal table".

DATA: BEGIN OF wa_mer,

lifnr TYPE ekko-lifnr,

ekorg TYPE ekko-ekorg,

verkf TYPE ekko-verkf,

ekgrp_allow TYPE ekko-ekgrp_allow,

ebelp TYPE ekpo-ebelp,

matnr TYPE ekpo-matnr,

werks TYPE ekpo-werks,

bednr TYPE ekpo-bednr,

matkl TYPE ekpo-matkl,

END OF wa_mer.

DATA:it_mer LIKE TABLE OF wa_mer WITH HEADER LINE.

DATA:it_doc like it_mer with header line.

(some process for fetch records from database......)

it_doc_loc_coll[] = it_merge[].

where i done mistake.pls help me.

To be reward all helpfull answers.

Regards.

Jay

8 REPLIES 8
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,041

Hi,

Try now

<b>TYPES:</b> BEGIN OF <b>wa_mer_type</b>,

lifnr TYPE ekko-lifnr,

ekorg TYPE ekko-ekorg,

verkf TYPE ekko-verkf,

ekgrp_allow TYPE ekko-ekgrp_allow,

ebelp TYPE ekpo-ebelp,

matnr TYPE ekpo-matnr,

werks TYPE ekpo-werks,

bednr TYPE ekpo-bednr,

matkl TYPE ekpo-matkl,

END OF wa_mer_type.

DATA:it_mer <b>TYPE TABLE OF wa_mer_type</b> WITH HEADER LINE.

DATA: wa_mer type wa_mer_type.

DATA:it_doc <b>TYPE TABLE OF wa_mer_type</b> WITH HEADER LINE..

(some process for fetch records from database......)

it_doc[] = it_mer[].

Regards,

Sesh

Read only

Former Member
0 Likes
1,042

DATA:it_doc like it_mer <b>occurs 0</b> with header line.

regards

shiba dutta

Read only

Former Member
0 Likes
1,041

Hi Jay,

As u have done it will create only structure it_doc of type wa_mer.

U need to specify either LIKE TABLE OF or OCCURS 0 in addition to declaration of it_doc.

Thanks & Regards

Santhosh

Read only

Former Member
0 Likes
1,041

DATA: BEGIN OF wa_mer,

lifnr TYPE ekko-lifnr,

ekorg TYPE ekko-ekorg,

verkf TYPE ekko-verkf,

<b>ekgrp_allow TYPE ekko-ekgrp,</b>

ebelp TYPE ekpo-ebelp,

matnr TYPE ekpo-matnr,

werks TYPE ekpo-werks,

bednr TYPE ekpo-bednr,

matkl TYPE ekpo-matkl,

END OF wa_mer.

DATA:it_mer LIKE TABLE OF wa_mer WITH HEADER LINE.

<b>DATA:it_doc like table of wa_mer with header line.</b>

*(some process for fetch records from database......)

<b>it_doc[] = it_mer[].</b>

Copy paste the above code, the errors are rectified...

Regards,

Pavan

Read only

Former Member
0 Likes
1,041

Here is the code of your

REPORT  ztest.

DATA: BEGIN OF wa_mer,
lifnr TYPE ekko-lifnr,
ekorg TYPE ekko-ekorg,
verkf TYPE ekko-verkf,
ekgrp_allow TYPE ekko-ekgrp_allow,
ebelp TYPE ekpo-ebelp,
matnr TYPE ekpo-matnr,
werks TYPE ekpo-werks,
bednr TYPE ekpo-bednr,
matkl TYPE ekpo-matkl,
END OF wa_mer.

DATA:it_mer LIKE TABLE OF wa_mer WITH HEADER LINE.
DATA:it_doc  LIKE TABLE OF wa_mer WITH HEADER LINE.

*(some process for fetch records from database......)

it_doc[] =  it_mer[].
append  it_doc .

reward points if it is usefull ... enjoy the weekend

Girish

Read only

Former Member
0 Likes
1,041

Hi,

Try to declre Types insted of data.

TYPES: BEGIN OF wa_mer_type

Regards

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,041

DATA:it_doc like table of it_mer with header line.

try this and reward if usefull

Read only

Former Member
0 Likes
1,041

used this syntax.

data: it type standard table of kna1

wa type kna1.