10-12-2006 12:44 PM
Hi All,
how to modify a perticular field in data base table based on vbeln.
Thanks in Advance.
Thanks&Regards
Ramu.
10-12-2006 12:50 PM
Hi Ramu,
You can use the Update statement.
UPDATE VBAK SET <Field> = <value>
WHERE VBELN = '1001'.
Manoj
10-12-2006 12:48 PM
hi Ramu,
can you eloborate something on this?? modify which field? ..
Regards,
Santosh
10-12-2006 12:50 PM
Hi Ramu,
You can use the Update statement.
UPDATE VBAK SET <Field> = <value>
WHERE VBELN = '1001'.
Manoj
10-12-2006 12:51 PM
HI,
Try This...
<b>Modify DBTAB from ITAB
transporting URFIELDNAME
where vbeln = vbap-vbeln
and posnr = vbap-posnr.</b>
REgards,
kishore.
10-12-2006 12:51 PM
UPDATE VBAK SET fieldname = value
WHERE vbeln = Sales_Document_No.
Regards,
Prakash.
10-12-2006 12:53 PM
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
10-12-2006 12:54 PM
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