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: 

USEREXIT_REFRESH_DOCUMENT via EDI mode doesnt' trigger

maria_merino
Active Participant
0 Kudos

Hi expers,

Whenever I créate a new sales order through VA01, after saving it, some changes are made in user exit USEREXIT_REFRESH_DOCUMENT.

The problem is whenever I créate the sales order through EDI (tx. WE19). The programa doesn't run this exit.

I tried to to my changes in USEREXIT_SAVE_DOCUMENT but at this momento I don't have all the required data, so I need to do my changes later.

Is there any possibility to do that?

thanks in advance,

Maria

4 REPLIES 4

Jelena
Active Contributor
0 Kudos

What changes exactly are you making?

maria_merino
Active Participant
0 Kudos

They need to change carrier partner depending on the value they have at this moment. The problem is that this carrier doesnt' exist at this moment in SAP, so when I chexk its ADRNR there is no value, even if I have already the sales order number.

I tried to do my changes in user exit EXIT_SAPLVEDA_004 and it seems it works using bapi BAPI_SALESORDER_CHANGE. But maybe there is an easier way to do this.

Thanks!

Jelena
Active Contributor
0 Kudos

In case of EDI, you can simply add a partner segment using an EDI user exit before the order gets posted. There are also user exits in the partner determination process. Google -> sales order partner determination user exits site:sap.com

Based on what value exactly are you changing the carrier? It really should not be changed "behind the scenes" after it's determined. It's just not a good design.

maria_merino
Active Participant
0 Kudos
If the partner already exists, the user wants to check in ADRC the city and postcode. If it matches some values, I need to change this carrier to another already existing in SAP.

When I create a sales order using VA01, the carrier exits in SAP so I have no problems in userexit save_document_prepare. But in this case, EDI, the carrier doesn't exist when executing the userexit. That's why I'm now using IDOC_INPUT_ORDERS's userexits..