I have requirement on updating route value in sales order during creation and change.
When we enter special processing indicator(SDABW) in va01 or va02 tcode and press save button, it need to trigger the user exit and update the route value from ztable based on SDABW.
Please let me know about the same
Hi Chandra Mohan,
Create.> ZTable.>Maintain table maintenance generator -> Update The Table .> Then Goto-> Se38-> Click on spiral symbol->under application bar-> right click the mouse and click on enhancement -> click on create and use the user exit : MV45AFZZ and Write the Appropriate codes ------>Then it will Update the sales order R OUTINE....
Try using this code snippet
IF vbkd-sdabw NE 'NA3Z'.
READ TABLE xvbap INTO wa_xvbap WHERE posnr = vbkd-posnr.
IF sy-subrc EQ 0.
lv_tabix = sy-tabix.
wa_xvbap-route = <your value>.
MODIFY xvbap from wa_xvbap INDEX lv_tabix TRANSPORTING route.
This should work as the form USEREXIT_MOVE_FIELD_TO_VBKD, triggers everytime there is a change in any business data (data from VBKD table).
Also, can you please share the code that you have written in the exit.
Thanks for helping lot. when we creating new sales order, b4 entering the value for SDABW field this user exit triggers. I want to trigger the user exit after enetring the SDABW value. As my functional suggests use USEREXIT_SAVE_DOCUMENT_PREPARE.
Please clarify this soon.
Thanks & regards,
I would not suggets using USEREXIT_SAVE_DOCUMENT_PREPARE, as if there is some standard logic working based on the ROUTE, that will not be triggered at USEREXIT_SAVE_DOCUMENT_PREPARE.
Also, if you look closely at the code snippet that was mentioned in my prevoius comment, that code part will modify XVBAP when you have VBKD-SDABW = 'NA3Z', in rest all cases, the system will behave as per standard.
In USEREXIT_SAVE_DOCUMENT_PREPARE only I can do the code part. I chekd in debug mode. but b4 I just changing the route value directly means XVBAP-ROUTE. We need to change the route field for evry line item, so change the value under XVBAP-ROUTE in debug mode for line item 1, same for line item2, 3 4, etc.... But in coding we can do normal coding like loop for XVBAP and modify XVBAP.
1. Goto MV45AFZZ-> userexit_save_document_prepare
Here do the code part.
2. Check sales org, Disb channel and doc type, then check the special processing indicator(SDABW) = 'specific Value'.
Update the route field from custom table.I.E. Loop for XVBAP, Modify XVBAP