‎2011 Jul 16 10:27 AM
hi all,
I want to insert a particular field in an internal table to a field in a data base table.Note that the fields in the internal table and database table are not of the same name since i need to insert data from different internal tables.can some one tell me how to do this?
in short i want to do something like the foll:
INSERT INTO ZMIS_CODES-CODE VALUE '1'.
*INSERT INTO ZMIS_CODES-COL1 VALUE DATA_MTD-AUFNR .(zmis_codes is the db table and data_mtd is the int.table)
‎2011 Jul 17 5:34 PM
Hi subhabrata bishnu choudhury,
you have no other choice than either inserting one whole record with all fields from a structured data object (what is important is the order of the fields is identical (and preferrably the data types of course), not the names), or several records (and all fields) from an internal table (same remark as for the structure).
Refer to the ABAP documentation for more information about INSERT (dbtab).
Sandra
‎2011 Jul 18 7:12 AM
‎2011 Jul 19 10:23 AM
Do you have just one field in you Ztable? If yes make sure the technical attributes of the fields & matches with the field in the internal table
‎2011 Jul 20 8:29 AM
REPORT ZINSERT.
tables kna1.
data: itab LIKE KNA1.
data lv_kUNAG LIKE KNA1-KUNNR.
lv_kuNAG = '0000010223'.
ITAB-kuNNR = lv_kuNAG.
ITAB-name1 = 'XYZ'.
INSERT INTO KNA1 VALUES ITAB.
IF SY-SUBRC = 0.
WRITE:/ 'SUCCESS'.
ELSE.
WRITE:/ 'FAILED'.
ENDIF.
Here lv_kunag is ref to kna1 kunnr passed in different name
In internal table .
Try and let me know if this logic dint work.