Skip to Content
author's profile photo Former Member
Former Member

Calling a RFC via WEB without doing a commit

Hello,

I have a RFC called from the WEB.

I have 2 steps in the RFC.

.1 CALL a BAPI (no commit inside the BAPI).

.2 Update a ZTABLE.

When I execute the RFC, the BAPI update nothing.

This is correct because the 'BAPI_TRANSACTION_COMMIT' is not executed.

But the ZTABLE is UPDATED and I don't want to update it.

<b>How I can manage the commit of the table?</b>

Thank you very much

Syme

Add comment
10|10000 characters needed characters exceeded

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 24, 2004 at 12:46 PM

    Hi,

    You can call your rfc enabled function module and the function module 'BAPI_TRANSACTION_COMMIT' in the same LUW.You can do this calling your FMs using 'in background task' addition of the Call Function(if it is an ABAP environment)

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 25, 2004 at 01:01 PM

    Hello,

    Like I said, the RFC is call from the WEB by a JAVA program.

    We want to give to the JAVA program the control of the COMMIT.

    The JAVA program call the RFC:

    inside the RFC we have:

    in step 1, a call of a BAPI_CHANGE_anything*

    in step 2, an update of a Ztable.

    The JAVA program in the next steps valid the return code.

    Call others RFCs, and at the end, do the BAPI_TRANSACTION_COMMIT if everything is ok.

    But if an error occurs during this process, we don't do the BAPI_TRANSACTION_COMMIT.

    The problem is when we don't do the COMMIT, the Ztable is update anyway.

    We don't want to update this Ztable.

    The only way I see, is to code a BAPI for every modifications we have to do in the Database.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      A limitation of the RFC protocol is that it performs an implicit commit at the end of each call. This is why the BAPI's must be written to perform updates asynchronously using PERFORM ... ON COMMIT or CALL FUNCTION ... IN UPDATE TASK.

      Of course, a downside of that asynchronous update approach is that in some scenarios it is difficult to chain BAPI calls into a single unit of work because the updates of the earlier calls are not effected when the logic of the latter call executes (for example, create customer bapi followed by create order bapi won't work in a standard LUW).

      The previous posting about using transaction RFC (such as CALL FUNCTION ... IN BACKGROUND TASK) may apply here. The ability to call functions transactionally has is supported by JCo and the RFC library - but it is more of a pain to do and get results back.

      Cheers,

      Scott

  • author's profile photo Former Member
    Former Member
    Posted on Jun 28, 2004 at 01:15 PM

    Thank you guys.

    You solved my problem.

    I call the sub-RFC in update task.

    Thank you again

    Add comment
    10|10000 characters needed characters exceeded