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: 

Use BAPIs inside BADIs

Former Member
0 Kudos

Hi,

After EHP6 implementation Im having problems using BAPI FMFG_MM_REQ_CHANGE inside a BADI (IF_EX_MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE) Its because the COMMIT WORK.

Is there any alternative in order to use a BAPI inside a BADI?

Thanks,

Luis G.

9 REPLIES 9

FredericGirod
Active Contributor
0 Kudos

Hi Luis,

you can use it, just remove the commit work, it should works without it

regards

Fred

0 Kudos

If I removed the commit work the PR would not be updated

former_member186413
Participant
0 Kudos

Hi, Luis.

There is a rule of thumb for BADI, that you can't have any commit work (or any thing equivlant to that) statment in the BADI implmentation class method. and BAPI have to call by funcation model BAPI_TRANSACTION_COMMIT_WORK to end up its LUW. And, what happen is that your main program will call it for you at its end of LUW.

Regards

venkateswaran_k
Active Contributor
0 Kudos

Hi Luis

As this function FMFG_MM_REQ_CHANGE  does not have option to delay your commit and in synch with your BADI,  You cannot use this BAPI inside the BADI.

You may have to find a place where both commit can go togather.

Regards,

Venkat

raymond_giuseppi
Active Contributor
0 Kudos

FMFG_MM_REQ_CHANGE (which is not a true BAPI, just an unreleased but wide-used FM) is RFC enabled; so you could call it IN BACKGROUND TASK so it will execute in another luw (after commit of the main transaction and update tasls) without bothering main transaction.

Regards,

Raymond

0 Kudos

I have called it using IN BACKGROUND TASK but it works if I do it by debugging if I directly execute it does not work.

0 Kudos

In old debugger you generated many db commit during execution, that changes the bahavior of programes.

Former Member
0 Kudos

We've created a Z FM as Remote-Enable Module. It calls FMFG_MM_REQ_CHANGE FM.

0 Kudos

Hi,

You can try an option of making Z FM

processing type - Update Module

 

and call z function module as

CALL FUNCTION 'Z_ABCD' IN UPDATE TASK