Application Development 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: 

modify

Former Member
0 Kudos

Hi All,

how to modify a perticular field in data base table based on vbeln.

Thanks in Advance.

Thanks&Regards

Ramu.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ramu,

You can use the Update statement.

UPDATE VBAK SET <Field> = <value>

WHERE VBELN = '1001'.

Manoj

6 REPLIES 6

Former Member
0 Kudos

hi Ramu,

can you eloborate something on this?? modify which field? ..

Regards,

Santosh

Former Member
0 Kudos

Hi Ramu,

You can use the Update statement.

UPDATE VBAK SET <Field> = <value>

WHERE VBELN = '1001'.

Manoj

Former Member
0 Kudos

HI,

Try This...

<b>Modify DBTAB from ITAB

transporting URFIELDNAME

where vbeln = vbap-vbeln

and posnr = vbap-posnr.</b>

REgards,

kishore.

Former Member
0 Kudos

UPDATE VBAK SET fieldname = value

WHERE vbeln = Sales_Document_No.

Regards,

Prakash.

Former Member
0 Kudos

Hi Ramu,

Dont use update statement and try to update if it is a standard table

check if any BAPI exists for that and then use that

LeonardoAraujo
Active Contributor
0 Kudos

First, you should not change a standard field directly using ABAP, not best practices.

In an user exit that allows you to change some standard fields it would be better.

Here are examples of both:

ABAP driven (not recommended!!!): Example only, dont do it, unless, like this example, it handles ZZ fields.


Data: wa_vbak   type vbak.

select single * from wa_vbak into wa_vbak where vbeln = vbeln.
if sy-subrc = 0.
wa_vbak-ZZUPDATED = 'X'.
modify vbak from wa_vbak.
endif.

Now, if you want to use user-exits, (recommended), here is an example of using USEREXIT_MOVE_FIELD_TO_VBAK in mv45afzz (old technology since it is sales related):


form userexit_move_field_to_vbak.

  vbak-zzupdate = 'X'.

endform.

This second variant will be processed once the document is saved.

Hope it helps,

Leonardo De Araujo