10-12-2010 1:00 PM
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
10-12-2010 1:53 PM
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.
10-12-2010 1:53 PM
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.
10-12-2010 2:22 PM
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
10-12-2010 2:39 PM
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.