Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Update is working modify is not working

Former Member
0 Likes
791

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.

7 REPLIES 7
Read only

Former Member
0 Likes
770

after modify use commit work.

what is the sy-subrc after the modify statement

Read only

0 Likes
770

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

Read only

0 Likes
770

hi,

do this way ...


* Note the structure of both itab and zmaterial table has to be same ...
modify zmaterial from table itab.
commit work.

Read only

0 Likes
770

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.

Read only

0 Likes
770

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

Read only

0 Likes
770
UPDATE  tablename FROM TABLE it_tab.
if sy-subrc eq 0.
 commit work.
endif.
Read only

Former Member
0 Likes
770

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