01-24-2007 4:10 AM
I have to modify a custom table with the contents in the internal table. here ztable has more fields than that of itab.I appreciate if anyone can help me with this
MODIFY Ztable FROM TABLE ITAB.
01-24-2007 4:14 AM
i think this query will work if order of field in ztable and itab is same try it.
01-24-2007 4:20 AM
Hi Deepthi ,
All you need to do is move the data from your internal table into an internal table with the structure same as your ztable.
Please make sure that you populate all the primary keys , once you have done you can use the command MODIFY Ztable FROM TABLE ITAB , to add data to your table.
Here is a sample code for the same
-
Data : it_1 type table of Z01F_TRV001 ,
wa_1 like line of it_1.
start-of-selection.
wa_1-PERNR = '100'.
wa_1-REINR = '00001'.
wa_1-RECEIPTNO = 'ABC'.
append wa_1 to it_1.
modify Z01F_TRV001 from table it_1.
write sy-subrc.
-
here i just fill up the primary keys only and a new record is created in the table
Regards
Arun
01-24-2007 4:22 AM
i think the itab must be as long as the dbtab and it will read from left to right so the fields in itab should be like dbtab. other wise run time error may occur.
regards
shiba dutta
01-24-2007 4:45 AM