08-28-2007 1:11 AM
Hi,
Im populating the internal table from DB table. and deleting one record from that internal table. and also im changing one record in that internal table. so the same should be updated to DB table also.<b>ie.,</b> deleted record should be deleted in DB table and also modified record should be modified in DB table.
How i can do this?
Regards,
Amal
08-28-2007 1:44 AM
Hi here is what the code should look like...
data : tab1 type standard table,
tab2 type standard table.
select * from DBTAB into table tab1.
tab2[] = tab1[].
*** change table one!
loop at tab2 into wa_tab2.
read table tab1 with key....
if sy-subrc ne 0. " record was deleted from tab2
delete DBTAB where KEY
endif.
endloop.
08-28-2007 1:27 AM
How are you displaying internal table from DB table or modifying the internal table? Are you using any Table control in screens?
-Kriss
08-28-2007 1:44 AM
Hi here is what the code should look like...
data : tab1 type standard table,
tab2 type standard table.
select * from DBTAB into table tab1.
tab2[] = tab1[].
*** change table one!
loop at tab2 into wa_tab2.
read table tab1 with key....
if sy-subrc ne 0. " record was deleted from tab2
delete DBTAB where KEY
endif.
endloop.
08-28-2007 2:15 AM
hI stephen,
use modify <db tab name> while looping the valies from itab.
reward if useful.
kishore