cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_TRANSACTION_COMMIT using JCO

Former Member
0 Kudos

Hi,

We are trying to connect to an SAP system and execute the BAPI. The BAPI_SALESORDER_CREATEFROMDAT2 does not return any error and is executed successfully. Immediately we are executing the COMMIT BAPI. Somehow it does not get committed to the database.

Here is the part of the code....

**************

JCO.Client system;

....

....

JCO.Function function = new JCO.Function(resp.getFunctionTemplate("BAPI_SALESORDER_CREATEFROMDAT2"));

....

system.execute(function);

JCO.Function BAPI_TRANSACTION_COMMIT = new JCO.Function(resp.getFunctionTemplate("BAPI_TRANSACTION_COMMIT"));//

system.execute(BAPI_TRANSACTION_COMMIT);

***************

Appreciate any help.

Regards

Pal

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

After the BAPI_SALESORDER_CREATEFROMDATA2 part is over, make sure that your client hasnt been disconnected and then connected again to execute BAPI_TRANSACTION_COMMIT.

If the client is disconnected and then connected again, the session is built anew, which is of course a problem because you need to call commit in the same session where you commit your sales order.

T00th

Former Member
0 Kudos

Sameer,

Thank you for a quick response. Yes, if you see the code above, we thought we are doing exactly the way you have mentioned. We are not disconnecting the session. Still we are not able to commit to the database. Any idea?

Regards

Pal

Former Member
0 Kudos

hmm...do you get any exceptions? Did you check the logs in ST22?

Did you set the update flag in the header structure to "I" in SALESORDER_CREATE? Just a few ideas

T00th