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

Commit Work and Rollback

0 Likes
1,378

Hello Everybody,

I´ve applied the sap note 743744 and there is an instructions that i can´t use ROLLBACK or COMIIT WORK statemet, because they may lead data inconsistencies.

But i need use the command comit work after MRM_INVOICE_POST function module n my program

.

In the Note has a ROLLBACK command , and i believe the Dump is trigered cause i can´t use a commit work over a rollback .

Is possible to clean the buffer ? what command can i use ?

thank a lot

1 ACCEPTED SOLUTION
Read only

former_member776318
Participant
0 Likes
1,112

Are you trying to post the invoice in middle of any other transaction?

If so, the note restricts you to perform COMMIT WORK or ROLLBACK because if you do so, if will end the current SAP LUW and will start a new one. This might trigger an abnormal termination (short-dump).

You can just post the invoice the usual way but do not commit or rollback. When the LUW of other transaction ends, the invoice will also be posted i.e. you invoice data will be saved or rollback depending on the situation.

Let me know if you have any queries.

Thanks,

Saurabh

Edited by: SaurabhBuksh on Jun 2, 2010 10:59 PM

Edited by: SaurabhBuksh on Jun 2, 2010 10:59 PM

6 REPLIES 6
Read only

former_member776318
Participant
0 Likes
1,113

Are you trying to post the invoice in middle of any other transaction?

If so, the note restricts you to perform COMMIT WORK or ROLLBACK because if you do so, if will end the current SAP LUW and will start a new one. This might trigger an abnormal termination (short-dump).

You can just post the invoice the usual way but do not commit or rollback. When the LUW of other transaction ends, the invoice will also be posted i.e. you invoice data will be saved or rollback depending on the situation.

Let me know if you have any queries.

Thanks,

Saurabh

Edited by: SaurabhBuksh on Jun 2, 2010 10:59 PM

Edited by: SaurabhBuksh on Jun 2, 2010 10:59 PM

Read only

0 Likes
1,112

Hi SaurabhBuksh,

First thak you for your atention.. yes my commit work statement is in the mddle of another transaction.

But my program was structured in this way, for another person. So i need find a solution for that ...

The problem is, if i take off the commit work, the program rollbacking , and do nothing.....!!!

thank

Read only

0 Likes
1,112

Okay, I think, your requirement is that even if your super-transaction performs a ROLLBACK (or may be COMMIT-WORK), you still want to post your invoice.

If that is the case, you should try using CALL FUNCTION 'MRM_INVOICE_POST' IN UPDATE TASK.

The update task addition would would start the function module processing in a separate session. The processing starts when the super (wrapper) transaction performs the COMMIT WORK or ROLLBACK.

Note that, you would not be able to debug the function-module directly. If you want so, you would need to perform the following steps:

1. Start your super-transaction.

2. Enter /H to start the debugger and then press the save button.

3. Press the 'Settings' button on top-right.

4. Mark the check box 'Update Debugging'.

5. Upon commit work, you function module call would appear in a separate session.

Hope that will help you.

Let me know if that works for you.

Regards,

Saurabh

Read only

0 Likes
1,112

unhappily doesn´t work....

DUMP :

text

Non-update function module called for update

thank a lot

Read only

0 Likes
1,112

Oops!! My Bad!!

I am so sorry. Forgot to check the type of Function module.

You can try the following, but I don't guarantee it because somebody told me that since the super-transaction is rolling back, therefore, this will also be rollback.

You can include your function-module MRM_INVOICE_POST in a separate executable program (Type-1 program).

After calling your function module, do a COMMIT WORK AND WAIT.

Instead of doing CALL FUNCTION directly, use SUBMIT statement to call this program. The SUBMIT statement runs the program in a separate session.

Hope that works. I am leaving now.

Regards,

Saurabh

Read only

0 Likes
1,112

Call MRM_INVOICE_POST function module in a new wapper V2 update function module.