Application Development and Automation 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: 
Read only

Question about ROLL BACK

Former Member
0 Likes
770

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

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
669

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

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

2 REPLIES 2
Read only

PankajJain777
Explorer
0 Likes
669

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

Read only

RaymondGiuseppi
Active Contributor
0 Likes
670

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