2013 Nov 29 11:17 AM
Hello Experts,
I've a requirement where I need to make changes to VBAP fields (KWMENG and ABGRU) and VBAK fields (FAKSK and NETWR) when a sales order is saved. I've done some research and found that the following user exit get's call when SAP saves a sales order.
MV45AFZZ
USEREXIT_MOVE_FIELD_TO_VBAK
USEREXIT_MOVE_FIELD_TO_VBAP
Now I'm not sure which table/structures in the above forms I can use to make the required change that will reflect when order has been saved. Can somebody please make any suggestion?
Many thanks in advance.
Hello Experts,
I've a requirement where I need to make changes to VBAP fields (KWMENG and ABGRU) and VBAK fields (FAKSK and NETWR) when a sales order is saved. I've done some research and found that the following user exit get's call when SAP saves a sales order.
MV45AFZZ
USEREXIT_MOVE_FIELD_TO_VBAK
USEREXIT_MOVE_FIELD_TO_VBAP
Now I'm not sure which table/structures in the above forms I can use to make the required change that will reflect when order has been saved. Can somebody please make any suggestion?
Many thanks in advance.
2013 Nov 29 11:28 AM
Hi
Those exit are always called, in generally they should be used to move data to custom fields, of course you can try to fill the standard one, but you make sure the value is not replaced in the next step of the program.
Here you need to fill VBAK and VBAP
The user-exit calls before saving the Sales Order is USEREXIT_SAVE_DOCUMENT_PREPARE, here you need to fill VBAK for header data and internal table XVBAP for items data
Max
2013 Nov 29 11:29 AM
Hi Zero,
go in debug and test it ..
VBAK
VBAP
XVBPA
XVBFA
..
regards
Fred
2013 Nov 29 2:24 PM
Hi - Use 'Use USEREXIT_SAVE_DOCUMENT_PREPARE' if you want change before save.
Let us know, in case any further help.
Regards,
Atul Mohanty
2013 Nov 29 4:40 PM
Many thanks guys for all of your valuable input but I'm not sure why debug does stop at USEREXIT_SAVE_DOCUMENT_PREPARE so that I can make changes. Actually we're making change in the orders by using BAPI_SALESORDER_CHANGE. Therefore, I'm wondering will USEREXIT_SAVE_DOCUMENT_PREPARE still be triggered and changes can be made?
Many thanks in advance.
2013 Nov 29 5:05 PM
Hi
II'm sure the exit USEREXIT_SAVE_DOCUMENT_PREPARE is triggered as soon as the sales order is saved (for the changing too).
It's usually the best place where it can change the data before the saving, but here you have the whole document.
Max
2013 Nov 29 5:29 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |