2014 Mar 19 11:01 AM
Hi experts,
Backgroud:
I want to implement method POST( ) in BADI ME_PROCESS_PO_CUST, and in this mothod I will invoke BAPI_REQUISITION_DELETE. But if error occurs when calling BAPI_REQUISITION_DELETE, system will roll back inside BAPI_REQUISITION_DELETE, then no purchase order will be created, which is not what I expect.
So if I create a function module, in which I put BAPI_REQUISITION_DELETE, and call this FM inside POST( ), will purchase order still be created if error occurs when calling BAPI_REQUISITION_DELETE (roll back occures inside BAPI)?
In other words, if ROLL BACK occurs in the invoked function module, will the invoking program ROLL BACK too?
Thanks,
Shelwin
2014 Mar 19 12:12 PM
Create a RFC enabled FM to wrap BAPI_REQUISITION_DELETE and BAPI_TRANSACTION_COMMIT/ROLLBACK and call it IN BACKGROUND TASK so it will trigger after update of purchase order is performed in database, and in another luw, you could even analyze error with transaction SM58 (If you decide to trigger an error if RETURN contains any error of course).
Regards,
Raymond
Hi experts,
Backgroud:
I want to implement method POST( ) in BADI ME_PROCESS_PO_CUST, and in this mothod I will invoke BAPI_REQUISITION_DELETE. But if error occurs when calling BAPI_REQUISITION_DELETE, system will roll back inside BAPI_REQUISITION_DELETE, then no purchase order will be created, which is not what I expect.
So if I create a function module, in which I put BAPI_REQUISITION_DELETE, and call this FM inside POST( ), will purchase order still be created if error occurs when calling BAPI_REQUISITION_DELETE (roll back occures inside BAPI)?
In other words, if ROLL BACK occurs in the invoked function module, will the invoking program ROLL BACK too?
Thanks,
Shelwin
2014 Mar 19 11:18 AM
Hi Shelwin,
If you call BAPI BAPI_REQUISITION_DELETE as
call function 'BAPI_REQUISITION_DELETE' STARTING NEW TASK taskname
<parameters>
In this way you can process this bapi asynchronously
2014 Mar 19 12:12 PM
Create a RFC enabled FM to wrap BAPI_REQUISITION_DELETE and BAPI_TRANSACTION_COMMIT/ROLLBACK and call it IN BACKGROUND TASK so it will trigger after update of purchase order is performed in database, and in another luw, you could even analyze error with transaction SM58 (If you decide to trigger an error if RETURN contains any error of course).
Regards,
Raymond
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |