USER EXIT to change VBAP-VSTEL
Hi all, i have a question
i'm fighting with consultant about this issue.
We have a order type (ZRI0) with many Order Reasons, for a specific order reason (Z30) i want to change the default Shipping Point (VBAP-VSTEL)from V_TVSTZ-VSTEL (FAM1) to V_TVSTZ-VSTE1 (FAM2)
the customization of table TVSTZ is that FAM1 is the default Shipping Point and FAM2 is the Manual Shipping Point
So i asked an user exit that for the specific order reason changes Shipping Point to V_TVSTZ-VSTE1 (FAM2)
they say it's impossible , they can modify only exit MV45AFZZ FORM userexit_move_field_to_vbap
i tried to modifying exit MV45AFZZ FORM userexit_save_document but nothing change, it seems that the customizing overwrites our modifications.
So the question is : where can i insert this modification on document saving?
Amit Iyer replied
There's no flag as such.
What you can try is :
Along with the modification of VBAP structure try modifying XVBAP too using the following code.
SELECT SINGLE mtart INTO mara-mtart FROM mara WHERE matnr = vbap-matnr. IF mara-mtart 'DI' . if vbak-vkorg = 'FA01' and vbak-augru = 'Z30' and vbak-auart = 'ZRI0'. move 'FRGA' to vbap-lgort. move 'FAM2' to *X*vbap-vstel. move 'FA01' TO VBAP-WERKS. loop at xvbap. xvbap-vstel = 'FAM2'. xvbap-lgort = 'FRGA'. modify xvbap. endloop. endif. endif.
Hope you are still writing this logic under save_document_prepare. It should work.
Make sure my syntax is proper. Its been a while I lost tocuh with ABAP.
Edited by: Amit Iyer on Jun 10, 2011 1:07 PM