Application Development 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: 

tRFCs from non-SAP client

Former Member
0 Kudos

Hi,

I want to call two or more RFCs from some non-SAP client (Java, .NET, whatever) where all the database changes caused by these RFCs should only be committed after I finally send BAPI_TRANSACTION_COMMIT. The Problem I have is that every RFC by itself is automatically committed when the RFC ends. I can't find a way that the automatic commit at the end of some RFC is postponed till the last RFC has been executed.

I tried to execute CALL FUNCTION '...' IN UPDATE TASK several times and then do a commit. This only works when all the calls using CALL FUNCTION '...' IN UPDATE TASK are issued from within the same function. What I need to do is to call the function which executes a single CALL FUNCTION '...' IN UPDATE TASK several times and then do a commit (I can't do any generic transactional programming in my non-SAP client without this).

I wonder whether this can be done at all. That's why I would like to ask some experienced ABAP people before I continue with further investigations that in the end are useless, because it cannot be done.

I'm now looking at tRFCs using CALL... IN BACKGROUND TASK. My hope is that with the use of the TID the SAP system which called RFC belong to the same transaction. Any change to get my problem solved this way?

Thanks, Oliver Plohmann

5 REPLIES 5

christian_wohlfahrt
Active Contributor
0 Kudos

Hi!

There were already some discussions with RFC and commit work. Just follow the following links - looks like you need a lot of additional handling to get everything working.

/people/thomas.jung3/blog/2005/02/14/webservices-a-real-world-implementation-experience

/people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap

/people/thomas.jung3/blog/2004/11/15/bsp-150-a-developer146s-journal-part-xiii-developing-abap-webservices

Regards,

Christian

0 Kudos

Hi Christian,

I spent quite some time looking through all those links. What is explained there is how to call a RFC from a web service. That alone does not tell me how to solve my fundamental problem: make two RFC calls or more from outside SAP and then send commit for everything done by >all< RFCs since the last commit. The articles you mention all do a >single< RFC call with in implicit commit.

I would be happy if just someone made a quick sketch that explains how do use tRFC to get the problem solved I have. The SAP people here have never done such a thing before.

Regards, Oliver Plohmann

0 Kudos

There is no solution for you're problem yet. Remote function calls do a commit. If you have several calls, one after the other, you can wrap them all together in a selfwritten function call. But this is not working if there is something like a dialog between non-sap and sap.

0 Kudos

Hi Rainer,

I'm preatty sure that it can be done. In the JCo Extension Library from arasoft.de there are transactions you can use. I asked the guy from arasoft.de how he did that, but he only wanted to tell that for money. In my opinion, it should be explained in the SAP documentation.

Regards, Oliver

0 Kudos

For example, you can call wrapper RFCs that do nothing but writing the parameters of the RFCs into separate tables. When the client sends commit the parameters are loaded from the separate tables and the non-wrapped RFCs are called with these parameters who really change the database. Finally a commit is called. My understanding was from reading SAP online doc that tRFCs do this in a generic way.

Regards, Oliver

Message was edited by: Oliver Plohmann