2015 Jul 03 8:20 AM
Hi Experts,
My requirement is to trigger a piece of my code only after Sales Order details been Saved (COMMIT) in the Database.
I'm looking for BADI/EXIT or SPOT etc...
Kindly let me know the exact place.
Observations:
1. In TCode VA01, sales order creation happens.
2. Respective Sales Order details been committed into the Database.
3. Now my code should trigger.
With Regards,
Sudhir.
2015 Jul 13 2:54 PM
Hi,
In the highlighted subroutine you can put your logic using some implicit/explicit which will trigger after updating the database of that particulat order.
Let me know if you need any assistance.
Thanks,
Pawan.
2015 Jul 03 9:55 AM
In exit MV45AFZZ and form USEREXIT_SAVE_DOCUMENT you can call your code "IN UPDATE TASK", so it will be triggered right after COMMIT.
FORM USEREXIT_SAVE_DOCUMENT
* This userexit can be used to save data in additional tables
* when a document is saved.
*
* If field T180-TRTYP contents 'H', the document will be
* created, else it will be changed.
*
* This form is called at from form BELEG_SICHERN, before COMMIT
2015 Jul 13 9:32 AM
Hi Tomas,
Using USEREXIT_SAVE_DOCUMENT, i'm getting the Sales Oder details, but the respective SO is not the committed one.
I need a place where exactly the SO is committed into the DB. So that i can write my own code only after SO is committed into the Database.
Kindly let me know the solution.
With Regards,
Sudhir.
2015 Jul 13 11:29 AM
Have you tried call your code "IN UPDATE TASK" ?
2015 Jul 13 11:53 AM
Hi Tomas,
Thank you so much for your reply.
Your point is very valid. I didn't call my code using "IN UPDATE TASK".
As I have to call a REPORT in USEREXIT_SAVE_DOCUMENT, i've used SUBMIT <Report Name>.
Where inside that Report there is an RFC which will ping to PI System.
Now in this scenario, how to apply "IN UPDATE TASK"?
Kindly let me know the solution.
With Regards,
Sudhir.
2015 Jul 13 12:54 PM
You can wrap this SUBMIT inside new FM 🙂
Edit: submit in update task will not work
2015 Jul 13 1:26 PM
Hi Thomas,
I'm calling a FM with IN UPADTE TASK and inside that FM, SUBMIT <Report Name>.
Using the above scenario, will i get committed SO?
If not kindly let me know the solution.
With Regards,
Sudhir.
2015 Jul 13 2:05 PM
Check VBAK-VBELN and XVBAP in MV45AFZZ.
But sadly you can not do SUBMIT in CALL FUNCTION - IN UPDATE TASK. Info from ABAP Keyword Documentation:
During the processing of an update function module in the update work process, the statements SUBMIT, CALL DIALOG, CALL SCREEN, CALL TRANSACTION, COMMIT WORK, and ROLLBACK WORK, as well as all other statements that create a database commit, must not be executed.
2015 Jul 13 2:39 PM
One twick you may try. Inside your CALL FUNCTION.... IN UPDATE TASK.
Try to CALL another FM in BACKGROUND TASK, inside that you can SUBMIT your program.
Or else.. What has said can be a good alternative.
You can go for a standard task where you use BUS2032.CREATED/ BUS2032.CHANGED as triggering event and write your code in the Method. you get lots of help over the internet about how to use macros inside a workflow method
R
2015 Jul 06 6:48 AM
hI,
why dont you go for USEREXIT_SAVE_DOCUMET_PREPARE
This form is used to check any changes when sale order has saved.
2015 Jul 13 9:46 AM
Hi Balaji,
I need a place where exactly the SO is committed into the DB. So that i can write my own code only after SO is committed into the Database.
Kindly let me know the solution.
Note:
Both USEREXIT_SAVE_DOCUMENT and USEREXIT_SAVE_DOCUMET_PREPARE will get the Sales Order details, but that respective SO is not committed into the DB.
With Regards,
Sudhir.
2015 Jul 13 12:16 PM
Hi Yarnagula,
If you want to execute your process just after saved or create SO, then i would suggest, go with Business Object BUS2032 (t-code SWO1). Activate CREATE Event and do some activation in SWE2 t-code to trigger the same after completion of VA01.
It's workflow process, but the same you can use in you requirement.
Regards,
Praveer.
2015 Jul 13 2:54 PM
Hi,
In the highlighted subroutine you can put your logic using some implicit/explicit which will trigger after updating the database of that particulat order.
Let me know if you need any assistance.
Thanks,
Pawan.
2015 Jul 14 6:55 AM
Hi Sriram,
You are right. Thank you so much.
At Perform beleg_initialisieren I'm getting the Committed SO.
Now I made an Implict enhancement inside the perform.
Now calling my report over to that place is working fine.
Issue resolved.
With Regards,
Sudhir.
2024 Nov 12 8:42 AM
Is there any BADI can do same things ? I'm looking for a BADI which can be triggered after sales document(order, delivery, billing, purchasing...) saving to DB.