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

modify

Former Member
0 Likes
1,047

Hi All,

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

Thanks in Advance.

Thanks&Regards

Ramu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,008

Hi Ramu,

You can use the Update statement.

UPDATE VBAK SET <Field> = <value>

WHERE VBELN = '1001'.

Manoj

6 REPLIES 6
Read only

Former Member
0 Likes
1,008

hi Ramu,

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

Regards,

Santosh

Read only

Former Member
0 Likes
1,009

Hi Ramu,

You can use the Update statement.

UPDATE VBAK SET <Field> = <value>

WHERE VBELN = '1001'.

Manoj

Read only

Former Member
0 Likes
1,008

HI,

Try This...

<b>Modify DBTAB from ITAB

transporting URFIELDNAME

where vbeln = vbap-vbeln

and posnr = vbap-posnr.</b>

REgards,

kishore.

Read only

Former Member
0 Likes
1,008

UPDATE VBAK SET fieldname = value

WHERE vbeln = Sales_Document_No.

Regards,

Prakash.

Read only

Former Member
0 Likes
1,008

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

Read only

LeonardoAraujo
SAP Mentor
SAP Mentor
0 Likes
1,008

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