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
671

There are two kind of bapi transaction model, I read somewhere on sdn.

One is with commit and one is without commit.

If given a BAPI, how do I know if it is with cmmit or without a commit ?

Is its a good SAP practice to use Commit inside BAPI ? If no then we are using one BAPI for some plausibility check, do we need to use BAPI_TRANSACTION_COMMIT after that to commit the work.

Thanks.

Regards,

Tushar.

4 REPLIES 4
Read only

Former Member
0 Likes
592

yes u have to use BAPI_TRANSACTION_COMMIT after a standard bapi is called.

Thanks,

Vamsi.

Read only

Former Member
0 Likes
592

Hi

U should read the BAPI documentation or some SAP notes, there isn't a rule only your experience. Generally you understand a BAPI needs a commit when the data aren't stored in database really.

Anyway if it's not dangerous to use the BAPI for commit after calling a BAPI doesn't need the commit.

Max

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
592

Hi, by design, BAPIs will not issue a commit work. The reason is that, BAPIs are sometimes called consecutivly right after one another in one logical unit of work, so the commit will happend after the last BAPI call to insure data consistancy. You should use the BAPI_TRANSACTION_COMMIT when working with BAPIs.

Regards,

Rich Heilman

Read only

0 Likes
592

Rich,

I ahve one query : Do i need to check message returned by BAPI_TRANSACTION_COMMIT that whether message type is E or other ?

For example :

Call BAPI_ADDRESSORG_SAVEREPLICA (which returns an error table)

If message type <> 'E' .

BAPI_TRANSACTION_COMMIT (which returns an error table)

if Message type <> 'E'.

Write/Generate Log.

endif.

Write/Generate Log.

endif.

What should bethe approach of calling BAPI.

Regards

Sonal.