cancel
Showing results for 
Search instead for 
Did you mean: 

Internal Table creation - Urgent

Former Member
0 Kudos
53

Hi,

I want a clarification regarding internal table creation.

One internal table has been created as below.

DATA: BEGIN OF I_ITAB OCCURS 0,

END OF I_DOCUMENT.

Now I have to create same internal table same contents as above and process it..

Do let me know how to proceed with it.

Regards,

SP

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

the 1st itab is this

DATA: BEGIN OF I_ITAB OCCURS 0,

END OF I_DOCUMENT.

now declare

data: itab2 like i_itab occurs 0 with header line

itab2 = i_itab

then these two internal tables will the same structure and the same data.

regards,

Venkatesh

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Sandeep,

Create the other internal table itab2 like this.

DATA: itab2 like itab1.

move itab1[] to itab2[].

That’s it, the contents of itab1 will be there in itab2.

Reward if helpful.

Former Member
0 Kudos

Hi,

DATA: BEGIN OF I_DOCUMENT OCCURS 0, "ur first table right
END OF I_DOCUMENT.

now do like this .......

data : i_second like I_DOCUMENT occurs 0.
................
................
i_second[] = i_document[] "to move contents of i_document to i_second

Cheers,

jose.

Former Member
0 Kudos

HI,

in the way u declared then internal table will be created with header line

data:

begin of itab occurs 0,

.......

endof itab.

u can declare other table in the same structre of the above declared table

u can do like this

data:

it_temp like standard table of itab.

for this header line is not created

if u want header line create like this

data:

it_temp like standard table of itab with header line.

i think i am clear to u

if it is usefull plzz reward..

plzzz dont forget to reward....

Former Member
0 Kudos

Hi,

For cteating the internal tables use following steps.

1.Create the structure first

TYPES: BEGIN OF T_VBAK,

VBELN TYPE VBAK-VBELN,

ERDAT TYPE VBAK-ERDAT,

ERNAM TYPE VBAK-ERNAM,

AUDAT TYPE VBAK-AUDAT,

VBTYP TYPE VBAK-VBTYP,

NETWR TYPE VBAK-NETWR,

VKORG TYPE VBAK-VKORG,

VKGRP TYPE VBAK-VKGRP,

VBKLT TYPE VBAK-VBKLT,

LINE_COLOR(4) TYPE C,

END OF T_VBAK.

2.Define the internal table as follows.

DATA: IT_VBAK TYPE STANDARD TABLE OF T_VBAK INITIAL SIZE 0.

3.Create the work area as follows.

DATA: WA_VBAK TYPE T_VBAK.

This is the efficient way to create the internal tables.

In this way create the internal tables of same type by using the structure.

Reward points,if it is useful.

Thanks,

chandu.

Former Member
0 Kudos

hi,

create in the same way but with different name or u can use

data :itab1 type standard table of itab (previous internal table name which u have created) with header line

keep that table in loop and end loop and procesds it

depending upon the operation

Edited by: Nandini P on Feb 7, 2008 7:20 AM