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: 

Function Modules TRANSACTION_BEGIN and TRANSACTION_END

Former Member
0 Kudos

Hello!

What does funcion module (FM) transaction_begin do?

What does funcion module (FM) transaction_end do?

How can I use these FM?

With these once can I create a LUW, with bapi commit or rollback also?

Thank for your attention.

4 REPLIES 4

naimesh_patel
Active Contributor
0 Kudos

Hello Maria,

You can get the transaction number of your LUW.

Sequence of use is like

TRANSACTION_BEGIN

do processing of BAPI...

if something wrong

TRANSACTION_abrot

else.

TRANSACTION_END

Regards,

Naimesh.

0 Kudos

Hello!

if I execute these step:

TRANSACTION_BEGIN

do processing of BAPI(1)...

do processing commit bapi(1)

do processing of BAPI(2) connected to BAPI(1)

if something wrong

TRANSACTION_abrot

else.

TRANSACTION_END

does the transaction_abort execute the rollack of bapi(1) and bapi(2)?

P.S. the commit between bapi(1) and bapi(2) is mandatory.

thanks

0 Kudos

Hi Maria,

In the example that you have detailed, it is my understanding that TRANSACTION_ABORT will only rollback to the latest commit within the LUW. If no commit then the whole transaction is rolled back.

I am pretty sure that TRANSACTION_ABOUT would only rollback bapi(2) and the processing of bapi(1) would remain.

Thanks

Gary

Former Member
0 Kudos

Hello Maria,

This is another way of doing a commit. for e.g..

CALL FUNCTION 'TRANSACTION_BEGIN'

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

CALL FUNCTION 'BAPI_OBJCL_DELETE'

CALL FUNCTION 'BAPI_OBJCL_CREATE'

if sucess

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

else

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'

endif

CALL FUNCTION 'TRANSACTION_END'