Application Development 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: 

hi all--reg insert statement

Former Member
0 Kudos

hi all ,

i have a z table which consisits of 13 fields. i have to insert field from 4 internal tables. but the fields in z table is is not in order as that of internal tables.

when i try insert , it is showing error,,,, is there any option to insert into corresponding fields,,,,,,,

regards

karthi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

if the field names are same you can use the MOVE-CORRESPONDING, but instead of MOVE-CORRESPONDING, you can use the MOVE statment ..

Here is the example:

Read First table

ZTABLE-FIELD3 = ITAB1-field3 .

ZTABLE-FIELD4 = ITAB1-field4 .

Read second internal table

ZTABLE-FIELD2 = ITAB2-field2 .

ZTABLE-FIELD5 = ITAB2-field5 .

Read Third internal table

ZTABLE-FIELD1 = ITAB3-field1 .

ZTABLE-FIELD6 = ITAB3-field6 .

INSERT ZTABLE.

Regards

Sudheer

4 REPLIES 4

Former Member
0 Kudos

Used corresponsing.

i.e. move corresponding

with modify or append

Former Member
0 Kudos

Hi,

Declare one more int table with structure same as DB table and fill the table from existing 4 tables.

Use insert command now using this new int table as it should be same as DB table.

Regards,

Amit

Former Member
0 Kudos

Use Modify statment

select *

from std table

into corresponding fields of itab.

modify ztab from table itab.

REgards,

Former Member
0 Kudos

Hi,

if the field names are same you can use the MOVE-CORRESPONDING, but instead of MOVE-CORRESPONDING, you can use the MOVE statment ..

Here is the example:

Read First table

ZTABLE-FIELD3 = ITAB1-field3 .

ZTABLE-FIELD4 = ITAB1-field4 .

Read second internal table

ZTABLE-FIELD2 = ITAB2-field2 .

ZTABLE-FIELD5 = ITAB2-field5 .

Read Third internal table

ZTABLE-FIELD1 = ITAB3-field1 .

ZTABLE-FIELD6 = ITAB3-field6 .

INSERT ZTABLE.

Regards

Sudheer