2008 Jul 30 7:31 PM
Hi gurus
I have written a code, in that i am trying to update some records to the table, in that code if i write UPDATE it is working but when i write MODIFY it is not updating records. Can u ppl suggest why it is happening??
Regards
kumar.
Hi gurus
I have written a code, in that i am trying to update some records to the table, in that code if i write UPDATE it is working but when i write MODIFY it is not updating records. Can u ppl suggest why it is happening??
Regards
kumar.
2008 Jul 30 7:33 PM
after modify use commit work.
what is the sy-subrc after the modify statement
2008 Jul 30 7:49 PM
Hi Vijay
The Sy-subrc value is 0, and i even kept the commit work after the MODIFY statement.
This is the code
tables: zmaterial.
data:
begin of itab occurs 0,
material type /bi0/pmaterial-material,
end of itab.
itab-Material = '0000123'.
append itab.
itab-Material = '0000124'.
append itab.
itab-Material = '0000125'.
append itab.
itab-Material = '0000126'.
append itab.
itab-Material = '0000129'.
append itab.
modify zmaterial from table itab.
commit work.
Regards
Kumar
Edited by: BW Kumar on Jul 30, 2008 8:50 PM
2008 Jul 30 7:55 PM
hi,
do this way ...
* Note the structure of both itab and zmaterial table has to be same ...
modify zmaterial from table itab.
commit work.
2008 Jul 30 8:03 PM
Thanks santhosh
I am sorry frnds my question was bit mistake, modify is working fine but update is not working, i am bit confused.
Regards
Kumar.
2008 Jul 30 8:07 PM
hi,
Update statement will only update the existing record but will not insert the new record on to your database table ...
Usage of Update
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/update.htm
Regards,
Santosh
2008 Jul 30 8:09 PM
UPDATE tablename FROM TABLE it_tab.
if sy-subrc eq 0.
commit work.
endif.
2008 Jul 30 7:36 PM
hi,
Please paste the piece of code here ...Also check out the below link
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/modify.htm
Regards,
Santosh
Edited by: Santosh Kumar Patha on Jul 31, 2008 12:09 AM