Calling two SAP RFCs as a sequence to perform a commit
-
PatrickHas successfully completed the online course Introduction10 months ago #41199
We created the SAP connector BAPI_BUPA_CREATE_FROM_DATA and a server-side business object that executes this RFC (only title_key, firstname and lastname in CENTRALDATA and CENTRALDATAPERSON, and PARTNERCATEGORY 1 as person). We receive back a successfully generated business partner number. But, because this created record is not finally saved, we suspect a missing commit. Neither a subsequent call to BAPI_TRANSACTION_COMMIT (WAIT = ‘X’) nor the auto-commit function within the connector has any effect. How can you execute these two BAPIs in a sequence so that a session is kept?
Christoph Hirschmann10 months ago #41228::Hi Patrick,
regarding the Autocommit: It’s currently under investigation
To solve your Problem:
On the export you need to change from “/result/execute/…” to /results[0]/execute/…”
So first the Plural and then the index of the FM you want to get the Data
Like:
/results[0]/execute/outputParameters/exportParameters/after/CENTRALDATAPatrickHas successfully completed the online course Introduction10 months ago #41989::Hi Christoph,
I was on vacation anyway!
We have now narrowed down the problem. The connector call in batch mode (BAPI_BUPA_CREATE_FROM_DATA and then BAPI_TRANSACTION_COMMIT) works when we create a business partner WITHOUT address data. The business partner is successfully saved in SAP. However, as soon as we want to create a business partner WITH address data, we only receive the business partner number back, but the business partner is not saved in SAP.
In my opinion, this no longer has anything to do with a simplifier configuration, so we’re done at this point. Thanks for your support!
PatrickHas successfully completed the online course Introduction10 months ago #41218::We’ve now put “[0]/” in front of all input parameters, except for “configuration” parameters. We only use a single function module. The data record of a business partner is then successfully created and saved in SAP (autocommit). But we no longer receive a response in the connector. For “result” parameters, we also didn’t put “[0]/” in front of them. How can we receive a response, especially the generated business partner number?
PatrickHas successfully completed the online course Introduction10 months ago #41258::Hello Christoph, the hint helped, now we get a response! Thank you!
When we create a business partner with an address in SAP, it is created and saved. We did it like this: SE37 > Function Module (Menu) > Execute > Test Sequence. First BAPI_BUPA_CREATE_FROM_DATA and then BAPI_TRANSACTION_COMMIT executed one after the other.
On the other hand, if we execute the same data in the Simplifier as a sequence, unfortunately it will not commit. To do this, we have configured the connector so that BAPI_BUPA_CREATE_FROM_DATA with [0]/… should be executed first and then BAPI_TRANSACTION_COMMIT with [1]/… (also the output parameters). We even receive a response with the generated business partner number. However, this is not finally saved.
Are two individual sessions started on SAP? I believe it is important that both BAPI calls run within a single session.
Attachments:
You must be logged in to view attached files.Christoph Hirschmann10 months ago #41581::Hi Patrick,
Sorry to get back in touch so late.
The session is the same in batch mode, like in the test sequence of SE37.
Interessting, that your safe doesn’t work.
Sounds weird but did you test it on a fresh call? Like setup the batch again in a new call or even new connector? I know, sounds strange but sometimes there’s a strange caching phenomenon which could explain this behavior
KR
Christoph
You must be logged in to reply to this topic.