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: 

BAPIs not committing data

Former Member
0 Kudos

Hello,

I am calling BAPI_SALESORDER_CREATEFROMDAT2 using web services through SOAP. It returns SALESDOCUMENT number, but with VA03 transaction I can't find this sales doc. A bit of research revealed that I must do a BAPI_TRANSACTION_COMMIT.

That doesn't work for me. I call the BAPI and then immediately issues a commit BAPI call. Both report success. But even then the sales doc isn't committed.

Apparently two SOAP calls are being treated as independent. Is there a way to define some kind of logical unit of work. Something like

Begin_transaction

BAPI1

BAPI2

Commit

End_transaction

I know something like this can be done by creating a custom BAPI. But I want to know if that can be done using Web Services over SOAP.

Thank you.

Rahul

1 ACCEPTED SOLUTION

Former Member
0 Kudos

I think you call those two bapi's BAPI_SALESORDER_CREATEFROMDAT2, BAPI_TRANSACTION_COMMIT from the WEB. If you call like that then it will become two different LUW's. So, you need to write a RFC in the SAP and call those two bapi's in that and you need to call that RFC in the web.

Cheers,

Satya

4 REPLIES 4

Former Member
0 Kudos

I think you call those two bapi's BAPI_SALESORDER_CREATEFROMDAT2, BAPI_TRANSACTION_COMMIT from the WEB. If you call like that then it will become two different LUW's. So, you need to write a RFC in the SAP and call those two bapi's in that and you need to call that RFC in the web.

Cheers,

Satya

0 Kudos

Satya,

Yes, I do call them from the web and hence they are not in the same LUW. Somewhere I saw a solution that you create your own 'Z' BAPI which calls both the BAPIS. Calling that 'Z' BAPI solves the problem.

But I am looking for a solution that doesn't require writing RFC or any BAPI.

Essentially I am confused what use would a BAPI be if it doesn't commit the data?

Rahul

Former Member
0 Kudos

Rahul

Check the return table & find if there is any error..

Hope this helps..

Bipin

0 Kudos

Bipin,

Return from the CREATEFROMDAT2 BAPI shows all successful messages.

1. SALES_HEADER_IN has been processed successfully

2. SALES_ITEM_IN has been processed successfully

3. Standard Order 170774 has been saved

The return parameter SALESDOCUMENT returns a sales document number.

Return from COMMIT has these fields (other fields are blank)

1. Number = 000

2. Log Msg No = 000000

3. Row = 0

Thanks.

Rahul