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

Problems implementing BADI_ACC_DOCUMENT

Former Member
0 Likes
4,479

Hi gurus,

I need to enhance badi_acc_document to change some document fields when posting via bapi but im facing some troubles here...

When i try to implement a Zbadi BADI_ACC_DOCUMENT enhancement my zbadi it´s not getting called...

Other problem that i see it's taht im able to create a Z class , CL_EXM_IM_ACC_DOCUMENT implementation, but im unable to implement a Z interface , IF_EX_ACC_DOCUMENT.

Does anyone allready had this kind of problems or know a soluiton to this problem.

Thanks in advance

Best regards

João Martins

1 ACCEPTED SOLUTION
Read only

mrio_espinheira
Participant
0 Likes
2,488

Hello,

You can create your Z Class for BADI implementation by copying class CL_EXM_IM_ACC_DOCUMENT to a Z class. This will copy the Standard interface, you don't need to implement a Z interface.

After having the class implemented, it will only be used when executing FM BAPI_ACC_DOCUMENT_POST with the table parameter EXTENSION2 filled. If you execute FM BAPI_ACC_DOCUMENT_POST with EXTENSION2 initial, then the BADI will not be executed.

Abraço.

3 REPLIES 3
Read only

mrio_espinheira
Participant
0 Likes
2,489

Hello,

You can create your Z Class for BADI implementation by copying class CL_EXM_IM_ACC_DOCUMENT to a Z class. This will copy the Standard interface, you don't need to implement a Z interface.

After having the class implemented, it will only be used when executing FM BAPI_ACC_DOCUMENT_POST with the table parameter EXTENSION2 filled. If you execute FM BAPI_ACC_DOCUMENT_POST with EXTENSION2 initial, then the BADI will not be executed.

Abraço.

Read only

Former Member
0 Likes
2,488

Solved Guys!

Just needed to extend class CL_EXM_IM_ACC_DOCUMENT to a Z class and then define it in the Z badi implementation, and then enhance the Z class in order to implement both methods.

Thanks for the tip Mario.

Points will be given

Abraço

BTW there no need to fill extension2 table, cause the Bapi doesnt check if table is empty or not, for fill_accit method. If the badi implementation is active the it always passes thru this implementation

Edited by: joao martins on Oct 12, 2010 3:22 PM

Read only

0 Likes
2,488

Hello,

You are right on the topic of filling the EXTENSION2 parameter, what I said only applies to BTE RWBAPI01 (FI-FI) and to table parameter EXTENSION1, which can also be used to change document data before posting.

Best regards.