cancel
Showing results for 
Search instead for 
Did you mean: 

how to call BAPI RFCs transactionally

0 Kudos

First of all I'm not a SAP/BAPI developer.

We have a java application that is calling some BAPIs over RFCs using JCo library.

The question is whether there is any way to call several of those in a single transaction.

I believe the correct way to do it would be to

- begin JCoContext

- execute some RFCs

- call BAPI_TRANSACTION_COMMIT

- end JCoContext

E.g. we'd like to call those system bapis this way:
BAPI_CATIMESHEETMGR_INSERT
BAPI_CATIMESHEETMGR_CHANGE

But for some reason all the stuff gets commited regardless of what we do.
I would like to understand what exactly is commiting this data. Are commits part of those BAPIs or is it some kind of JCo "feature"?

former_member751964
Participant
0 Kudos

Thank you for asking a question in the SAP Community!

Your question is very important to us. It would be helpful for you to take the tutorial: https://community.sap.com/resources/questions-and-answers which provides tips for preparing questions that draw the best responses from our members. Plus, by organizing your Community profile using this tutorial: https://developers.sap.com/tutorials/community-profile.html you will encourage more readers to respond to your questions!

Thank you!

jmodaal
Active Contributor
0 Kudos

Hello,

in general a called BAPI should not execute a COMMIT WORK resp. ROLLBACK WORK. I would suggest that you do a trace (with SAT or ST12) for the process. In case a database commit is done, you should be able to find it in the hit list / statement list.

Accepted Solutions (0)

Answers (1)

Answers (1)

noothanshowri
Discoverer
0 Kudos

Hello Dzmitry,
In earlier versions of SAP there used to concepts of Functions & save. Where You first do an action and the save that action into database.

For Example :

  • CALL FUNCTION 'BILLING_SCHEDULE_SAVE' then you commit the save action with
  • CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'

But with Bapis, you do not have to do multiple calls. Save and commit are done in one step.