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

filling internal tables

Former Member
0 Likes
470

Hello gurus

I am new to abap development.

I am using two internal tables i.e ITAB1 & ITAB2 in ECC 6.0

ITAB1 has got 6 fields.

ITAB2 also has got 6 fields out of which 2 fields are common to both ITAB1 and ITAB2.

The common fields have got same data types.

I want to know how to copy data from ITAB1 to ITAB2 based on the above scenario.

regards

krishna

Moderator Message: Please read F1 help, search for the available information, do some research your self.

Message was edited by: Kesavadas Thekkillath

Hello gurus

I am new to abap development.

I am using two internal tables i.e ITAB1 & ITAB2 in ECC 6.0

ITAB1 has got 6 fields.

ITAB2 also has got 6 fields out of which 2 fields are common to both ITAB1 and ITAB2.

The common fields have got same data types.

I want to know how to copy data from ITAB1 to ITAB2 based on the above scenario.

regards

krishna

Moderator Message: Please read F1 help, search for the available information, do some research your self.

Message was edited by: Kesavadas Thekkillath

2 REPLIES 2
Read only

Kartik2
Contributor
0 Likes
447

Hi,

Here is what you can do,

Loop at itab2.

Read table itab1 with the common fields from itab2.

Now based on the data in read statement, modify itab2 with required fields.

Hope this helps. Thank you.

Regards,

Kartik

Read only

former_member214878
Active Participant
0 Likes
447

Hello Krishna,

As Kartik suggested u can loop ITAB2 and assigning fields in to Field Symbol can update ITAB1.

I think its pretty easy if dig on more SCN.

Still sending u for just to kick start -----

1. FILL BOTH INTERNAL TABLE.

2. DECLARE FIELD-SYMBOL.

<CODE>

LOOP AT IT_TAB2 ASSIGNING <LS_TAB2>.

     READ TABLE IT_TAB1 INDES SY-TABIX.

     <LT_TAB2>-COMMON_FIELD(s) = IT_TAB1-COMMON_FIELD(S).

      .....

     ......

ENDLOOP.

</CODE>

Thanks and Regards,

Ravindra Sonar.