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

inserting fields

Former Member
0 Likes
446

Hi all,

i have two internal tables.

one table have Mandt key extra comparing to other internal table.

and both have remaining all the fields same.

Now i want to insert all the fields from the internal table which dont have mandt key to another internal table which have mandt key.

i dont want to use loop.

how can i insert the fields.???

Regards,

CSR.

3 REPLIES 3
Read only

Former Member
0 Likes
423

Hi CSR,

You can use following syntax,

1) ITAB1[] = ITAB2[].

or 2) move ITAB2[] to ITAB1[].

Please reward if helpful.

Regards.

Srikanta Gope.

Read only

Former Member
0 Likes
423

see the below code which is inserting data from work area to internal table .


DATA: BEGIN OF connection, 
        cityfrom TYPE spfli-cityfrom, 
        cityto   TYPE spfli-cityto, 
        distid   TYPE spfli-distid, 
        distance TYPE spfli-distance, 
      END OF connection. 
 
DATA connection_tab LIKE SORTED TABLE OF connection 
                    WITH UNIQUE KEY cityfrom cityto 
                                    distid distance. 
 
SELECT cityfrom cityto distid distance 
       FROM spfli 
       INTO connection. 
  INSERT connection INTO TABLE connection_tab. 
ENDSELECT.

reward points if it is usefull....

Girish

Read only

che_eky
Active Contributor
0 Likes
423

I don;t think you can do this without a LOOP statement as both tables have different structures.