09-11-2007 1:28 PM
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
09-11-2007 1:36 PM
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
09-11-2007 1:32 PM
09-11-2007 1:34 PM
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
09-11-2007 1:34 PM
Use Modify statment
select *
from std table
into corresponding fields of itab.
modify ztab from table itab.
REgards,
09-11-2007 1:36 PM
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