2014 Aug 04 11:22 AM
Hi everobody,
Im am now experimenting with the context-object:
* Dieses referenziert das Interface IF_BADI_CONTEXT
DATA: ctx TYPE REF TO IF_BADI_CONTEXT.
* Es wird ein konkretes Context-Objekt ctx über die Factory instanziiert
ctx = cl_badi_report_context=>get_instance( repid = sy-repid ).
break muellm.
TRY .
DATA: badi_definition_zmm_szrs0003 TYPE REF TO zmm_szrs0003.
GET BADI badi_definition_zmm_szrs0003
CONTEXT
ctx.
CATCH cx_badi_not_implemented.
MESSAGE e499(sy) WITH 'Badi nicht implementiert.'.
ENDTRY.
Assuming I have more than one BADI-Implementation, how do I call the appropriate implementation.
Here in my example the context is the repid.
With other words:
Report Z_ABC should call implementation #1
Report Z_XYZ should call implementation #2
How can I achieve this?
Thanks, Regards Mario
2014 Aug 04 11:29 AM
Hi Mario
Using BADI filter. refer this link, http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/f6cd83912541aae10000000a114a6b/content.htm
regards,
Archer
2014 Aug 04 11:29 AM
Hi Mario
Using BADI filter. refer this link, http://help.sap.com/saphelp_nw70ehp1/helpdata/en/44/f6cd83912541aae10000000a114a6b/content.htm
regards,
Archer
2014 Aug 04 11:47 AM
HI Archer,
thx. But this is filters. I have context.
I wonder what the diffenrece is?
Regards Mario
2014 Aug 04 12:21 PM
If a BAdI implementation class implements multiple BAdI interfaces and GET BADI is executed within one internal session for several of these BAdIs, then multiple BAdI objects can point to the same object plug-in. This enables the sharing of data between different BAdIs. For context-free BAdIs, this is only the case for reuse. For context-dependent BAdIs, several BAdI objects from the same context can point to the same object plug-ins.
So in your case, i think you need using Filters.
regards,
Archer