Application Development and Automation 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: 
Read only

BAPI_TRANSACTION_COMMIT

Former Member
0 Likes
949

Hi,

I am using BAPI: BAPI_CONTRACT_CREATEFROMDATA.

After which i want to use the bapi : BAPI_TRANSACTION_COMMIT.

Could anyone please tell me how do i go about it.

Thanks,

Riya.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
880

some of the bapi's are not auto committed then u need to use this commit bapi, other wise data is not stored in database.

rewards some points if helpful

madhavi

6 REPLIES 6
Read only

George_Lioumis
Active Participant
0 Likes
880

Hi,

After calling BAPI_CONTRACT_CREATEFROMDATA with the appropriate parameters and if this BAPI has succeeded (contract has been created successfully do the following:

if not SALESDOCUMENT is initial. "contract document created

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = ' '.

else.

" issue error messages as the contract has not been created

endif.

Reward if helpful.

Regards,

George

Read only

0 Likes
880

Hi George,

I would like to know whether should we write anything in the IMPORTING parameter i.e.

IMPORTING

RETURN =

Thanks.

Riya.

Read only

0 Likes
880

Hi,

No Need to pass anything to RETURN parameter.

When u pass the data to the BAPI, every bapi will return some messages which are populated in the Return Parameter.

So system will return the RETURN parameter.

Before using :" BAPI_TRANSACTION _COMMIT". check the Rerturn - TYPE, ( Message type: S Success, E Error, W Warning, I Info, A Abort) .

If Rerturn - TYPE = 'S' " i.e susscess.

Call FM :" BAPI_TRANSACTION _COMMIT".

Endif.

Rvert back if nay issues,

Regards

Naveen

Read only

0 Likes
880

Hi,

I suggest you pass a table to the RETURN parameter in order to be able to get any error or warning messages created and show them to the user so that the user knows exactly what went wrong in case the transaction fails. However, this is not mandatory but personally, I always get the messages returned from SAP and inform the user appropriately.

Regards,

George

Read only

0 Likes
880

Oh k!

But in that case i want to know whether it is the same table i use in BAPI_CONTRACT_CREATEFROMDATA.

Thanks,

Riya.

Read only

Former Member
0 Likes
881

some of the bapi's are not auto committed then u need to use this commit bapi, other wise data is not stored in database.

rewards some points if helpful

madhavi