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: 

Call BAPI BAPI_FIXEDASSET_CHANGE within a user EXIT

0 Kudos

Hi experts,

I'm trying to call a bapi  BAPI_FIXEDASSET_CHANGE within an EXIT to change "useful life of an asset", but after call bapi i can`t call bapi_transaction commit because i think the main program will finish if i use commit explicit.

Then i leave the implicit commit update the bapi but this is not happening (working). Anyone have any suggested solution?

6 REPLIES 6

sabirshah1
Participant
0 Kudos

Hi,

Have u checked that bapi 'BAPI_FIXEDASSET_CHANGE' is wroking correct or not if it working properly then u can call bapi_transaction_commit . There will not  be any problem .

Best Regards ,

Sabir.

0 Kudos

Hi Sabir Shah,

I think that's not possible call bapi_transaction_commit inside an EXIT because this cause a premature end of main transaction.

Best Regards,

Emerson

Former Member
0 Kudos

Hi Emerson,

Which user exit have you implemented?

Try setting a breakpoint on the COMMIT statement to confirm that the transaction you're using does perform an explicit COMMIT.  If so you should not need to worry about BAPI_TRANSACTION_COMMIT since that's really all that function does.

I certainly agree that you should not call the commit function during a user exit! 

0 Kudos

Hi Jim,

The implementation was in "Enhancement Point", but not in an EXIT. Analyzing the standard code, i saw the following code below. I think is possible use a commit work to solve my problem. What do you think about ?

* leave transaction after processing of list -> clear all global values

   if sy-binpt = on.                    "Sonst Fehler in BTCI-Modus

     commit work.

   endif.

   if sy-calld is initial.

     leave to transaction sy-tcode.

   else.

     set screen 0.

     leave screen.

   endif.



Best regards,

Emerson

0 Kudos

The code bellow exist after my Enhancement point implementation.

* leave transaction after processing of list -> clear all global values

   if sy-binpt = on.                    "Sonst Fehler in BTCI-Modus

     commit work.

   endif.

   if sy-calld is initial.

     leave to transaction sy-tcode.

   else.

     set screen 0.

     leave screen.

   endif.

0 Kudos

Hi Emerson,

Sorry for slow response, I've been out of touch for a few days. If the code that you show does follow immediately after your call to the BAPI, I would agree that it seems safe (in this rare instance) to program a commit work in an exit or enhancement point.

Jim