What is the reason why we shoudnt use call transaction in a Bapi.

asked 03 Apr '12, 08:39

bobby's gravatar image

bobby
1464513
accept rate: 0%

edited 06 Apr '12, 09:38


The concept of the BAPI is that actions inside the BAPI should not trigger commit and the programmer after calling one or many BAPIs should call BAPI_TRANSACTION_COMMIT or BAPI_TRANSACTION_ROLLBACK.

Using call transaction creates a new LUW that will not be under the commit control of the original LUW and that is why it cannot be used in BAPIs. You can read the detailed explanation in this help page.

permanent link

answered 03 Apr '12, 18:02

pedrolima's gravatar image

pedrolima ♦♦
1.1k232840
accept rate: 32%

Thanks for the response. :)

(04 Apr '12, 10:14) bobby

hey could you tell me why we have to create custom structures when creating a bapi and why we pass the values as 'pass by value'.

And why an explicit commit is required in a bapi,what happens when an implicit commit occurs.Thanks.

(08 Apr '12, 06:18) bobby

I don't know about the custom structures (does it give an error when re-using structures from the dictionary?). The pass by value is needed because the BAPI is expected to work when called from different systems, and pass by reference cannot work in remote calls. When a implicit commit happens the problem is that if the program calling the BAPI tries to do a rollback, some parts may be rollbacked but other parts were committed (aka big mess).

(09 Apr '12, 18:48) pedrolima ♦♦
1

WHY DO WE NEED CUSTOM STRUCTURES: Once any Bapi is realeased the structures it is using gets freezed to the bapi, the structure becomes specific to the Bapi, we can not make any changes over there. That is why we need custom structure for creating a custom bapi.

I found this over at: http://scn.sap.com/thread/1225777

(10 Apr '12, 08:21) bobby

Makes sense. Thanks for the update.

(10 Apr '12, 08:31) pedrolima ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×28
×5

question asked: 03 Apr '12, 08:39

question was seen: 29,465 times

last updated: 10 Apr '12, 08:31