cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Bapi_transaction_commit

Former Member
0 Kudos

Hi

I have created a WebDynpro project to create sales orders using the bapi "Bapi_Salesorder_createfromdat2".

But when I try to use the COMMIT, with the BAPI_TRANSACTION_COMMIT, it doesn't work.

My code is something like this :

try

{

wdContext.currentBapi_Salesorder_createfromdat2Element ().modelObject().execute();

wdContext.currentBapi_Transaction_Commit_InputElement().modelObject().execute();

}

catch(Exception e)

{

//print error

}

Am i doing something wrong here.

regards

ceci

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Please check if you have bound a Bapi_Transaction_Commit_InputElement to the corresponding context node.

There should be a statement in your code like:

wdContext.nodeBapi_Transaction_Commit().bind(new Bapi_Transaction_Commit())

In the BAPI_TRANSACTION_COMMIT import parameters you have an optional WAIT parameter, which should be set to 'X', otherwise you won't get any error results from the R/3 backend.

Let me know if you require more information.

regards

ravi

Answers (3)

Answers (3)

Former Member
0 Kudos

check if you have a lock in the row that you have modified.

Former Member
0 Kudos

Hi Ceci,

Can you check if your Create BAPI and your Commit BAPI are in in the same model. If they are in diferent models then each call is using a different JCO connection. When this occurs then commit has no effect on BAPI create.

Keith

Former Member
0 Kudos

Hi Cecilia,

There could be a problem in executing your BAPI itself. so best thing i would suggest is try to print the error message that comes after executing the BAPI - BAPI_SALESORDER_CREATEFROMDAT2 .

you might face the problem when you try to add number of line items.

Do let us know the result.

Cheers,

Kumar

Former Member
0 Kudos

Hi,

I don't see any mistake in your code.

Please let me know what the error is.

Regards

Noufal