cancel
Showing results for 
Search instead for 
Did you mean: 

Execute custom program after sales order is being saved into database

rego2
Explorer
0 Kudos
442

Hello Experts, 

I would like to run a custom program after the order is being saved into database.

What would we like to achieve?

We would like to run BAPIs right after the sales order is saved so we can pull data from the database and run our BAPIs with those parameters.

I have found a place in program SAPMV45A at the end of include MV45AF0B_BELEG_SICHERN (line 3371) where the order should have been created, this is where we placed our new code.

 

What we have tried and did NOT work?

There is an update task running in parallel to MV45AF0B_BELEG_SICHERN what is actually saving the order into database.

Unfortunately, the task is not finished running until the end of MV45AF0B_BELEG_SICHERN.

This means there is no sales order data saved into the database at the moment our code is running.

We also tried to put our code in program MV45AZZ, but this is called from include MV45AF0B_BELEG_SICHERN before the commit statement.

Please help us identify the enchantment point(s) where the sales order is already saved into database and we could run our custom code.

Any other suggestions are also welcome.

View Entire Topic
Rajasekhar_Dina
Participant
0 Kudos

Hi

You can use the enhance spot at of MV45AF0B_BELEG_SICHERN.

capture.png

 

rego2
Explorer
0 Kudos
Unfortunately this is not working. The update task is not finished until our code runs, this means there is no sales order data in the database to pull data from. Alternatively, we could put our code in program MV45AZZ, but this is called from include MV45AF0B_BELEG_SICHERN before the commit statement. In both cases, there has no sales order created yet at the moment of our code running. Please help us identify the enchantment(s) point where the sales order is already saved into database and we could run our custom code.