Application Development 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: 

Update route in sales order

Former Member
0 Kudos

Hi All,

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

Thanks,

Mohan

1 ACCEPTED SOLUTION

former_member199637
Participant
0 Kudos

Hello Chandra,

Try updating the field in subroutine USEREXIT_MOVE_FIELD_TO_VBKD of userexit MV45AFZZ.

Modify the XVBAP based on your conditions there.

Regards,

Puneet Desai

14 REPLIES 14

Sijin_Chandran
Active Contributor
0 Kudos

Hi Mohan ,

Try with User Exit : MV45AFZZ

SAVE_DOCUMENT_PREPARE

kabil_g
Active Participant
0 Kudos

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....

Former Member
0 Kudos

Hi kabil,

Wat u are saying is correct. I want which user exit it will trigger. I tried it in user exit

  userexit_save_document_prepare. in debugging mode. The route field is not get updated.

Thanks,

Mohan

0 Kudos

Hi Chandra ,

Which is the field for Route while creating VA01 and your are looking for in userexit_save_document_prepare ?

Can you paste any related screen shots , it will make things more easy to understand.

Former Member
0 Kudos

Hi Sijin,

Field is VBAP-ROUTE. It is in item level shipping tab.

I want update this field based on special processing indicator, which is also in same screen VBKD-SDABW

Thanks,

Mohan

former_member199637
Participant
0 Kudos

Hello Chandra,

Try updating the field in subroutine USEREXIT_MOVE_FIELD_TO_VBKD of userexit MV45AFZZ.

Modify the XVBAP based on your conditions there.

Regards,

Puneet Desai

0 Kudos

Hi Puneeth,

This is working for VA02 but not working for VA01. Plz check this. In VA01 als I need to compare SDABW from VA01 and custom table. IF SDABW is NA3Z then update ROUTE field from custom table.

Thanks,

mohan

0 Kudos

Hello Chandra,

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.

     ENDIF.

ENDIF.

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.

Regards,

Puneet Desai

0 Kudos

Hi Puneeth,

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,

Mohan

0 Kudos

Hello Mohan,

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.

Regards,

Puneet Desai

0 Kudos

Hi All,

My Self I found it.

Thanks for your help.

Thanks

Mohan.

0 Kudos

Hi Chandra ,

Please share the solution.

I am very keen to know how you managed it

0 Kudos

Hi Puneeth,

I am using this for specifc to sales org and doc type.

I think so not a problem to use.

Thanks for your support.

Thanks,

Mohan

0 Kudos

Hi Puneeth,

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[1]-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.

Steps:

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

Thanks,

Mohan