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.