10-05-2007 2:53 PM
Hi ,
I have a Z table , now I want to perform the following operations on it from my internal table.
1) Move the entire internal table to the Z table and delete the original contents of the Z table.
2) Move selected rows into the Z table from the itnernal table while retaining the original contents of the Z table
Can anyone give me the code for these.
3) Modify the Z table from the internal table and not insert duplicate entries.
I also want to know if coding is the only way to update Z tables , or can we use any SAP function modules.
Thank you .
10-05-2007 3:01 PM
hi
good
Loop at Itab.
Write : / itab-matnr,itab-maktx.
read table t_ztable with key itab-matnr.
if sy-subrc = 0.
t_ztable-maktx = itab-maktx.
modify table t_ztable from t_ztable transporting maktx.
else.
t_ztable-matnr = itab-matnr.
t_ztable-maktx = itab-maktx.
append t_ztable.
endif.
Endloop.
modify ztable from table t_ztable.
thanks
mrutyun^
10-05-2007 3:03 PM
HI,
U can try this for Inserting into Z-Table.
Eg:
TABLES SPFLI.
DATA WA TYPE SPFLI.
WA-CARRID = 'LH'.
WA-CITYFROM = 'WASHINGTON'.
...
INSERT INTO SPFLI VALUES WA.
WA-CARRID = 'UA'.
WA-CITYFROM = 'LONDON'.
...
INSERT SPFLI FROM WA.
SPFLI-CARRID = 'LH'.
SPFLI-CITYFROM = 'BERLIN'.
...
INSERT SPFLI.
For Modifying Z-Table,
MODIFY <Z-Table> FROM <wa> .
Regards,
Padmam.
10-05-2007 3:12 PM
I would like to know all the other operations -
like how to delete the contents of the entire table ,
where commit work is used. and all that
Thank you .
10-05-2007 3:13 PM