cancel
Showing results for 
Search instead for 
Did you mean: 

two bapi calls in the same session using PI

Former Member
0 Kudos

Hi,

I have a file to RFC scenario wherein I need to call a BAPI (L_TO_CANCEL) and then again, I need to call another bapi called

"BAPI_TRANSACTION_COMMIT" in the same session. My question is, if I use RFC adapter, do I have to call the commit bapi again?

If yes, is there anyway I can do that ?

I believe that will be the case only if I use a proxy. Is that correct ?

The requirement is to call these two BAPIs and finally include a success or error message in the response.

Thanks.

Accepted Solutions (0)

Answers (4)

Answers (4)

stefan_grube
Active Contributor
0 Kudos

> I have a file to RFC scenario wherein I need to call a BAPI (L_TO_CANCEL) and then again, I need to call another bapi called

> "BAPI_TRANSACTION_COMMIT" in the same session. My question is, if I use RFC adapter, do I have to call the commit bapi again?

L_TO_CANCEL is not a BAPI and it commits by its own, when you set the parameter I_COMMIT_WORK.

So there is no need to call a second RFC for committing.

Former Member
0 Kudos

The BAPI that I am trying to call is "L_TO_CANCEL" which has a fault message type but in my operations mapping, I am not able to specify the mapping program as I donot have the "fault" tab.

So do I have to go for proxy in this case ? It just seems weird.

Thanks,

Venkat.

stefan_grube
Active Contributor
0 Kudos

> I am not able to specify the mapping program as I donot have the "fault" tab.

> So do I have to go for proxy in this case ? It just seems weird.

When you have file -> SAP, then this is async. So the RFC response is not sent back.

For improving monitoring, you can create an ABAP proxy as wrapper for the RFC, but if you want to do something with the response, you need a BPM.

Former Member
0 Kudos

hi stefan,

I am having an async-sync bridge as I have to persist the request message that I get into BPM.

The requirement is to be able to send error message back as in the .error object back and map it accorindgly.

I do have the mapping done for the exception object but my issue is , I cannot specify that anywhere in the operations mapping as the OP has the request and response tabs and nothing else.

So, I believe I have to go for a proxy in this case. Is that correct ?

Thanks,

Venkat.

stefan_grube
Active Contributor
0 Kudos

Inside the BPM you do not have a specific exception message. You can do an exception handling based on the exception, but the excpetion itself is not a real message.

If you want a real message, you could create an ABAP proxy, which has a message like this:

root

- part1

- rfc response

- part2

- error text

then you can split this inside BPM and send a the response or the error.

Of course there are other possible solutions.

aashish_sinha
Active Contributor
0 Kudos

Hi,

Create a wrapper RFC and call these 2 BAPI's inside that wrapper and return the message .

Regards

Aashish Sinha

Former Member
0 Kudos

You can commit the BAPI from the RFC reciever adapter. Check the option commit BAPI in the adapter. Then you need not to cal external BAPI "BAPI_TRANSACTION_COMMIT".