‎2006 Jul 13 2:01 PM
We are upgrading to ERP 2005 with IS-CWM activated from 4.0B so my knowledge to OO is almost non-existing.
We have a BAdI : /CWM/DEFAULT_MIGO this BAdI has some default code. The code proposes a quantity and unit in the parallel unit in transaction MIGO. The name of the Class is /CWM/CL_EX_DEFAULT_MIGO and the interface /CWM/IF_EX_DEFAULT_MIGO with a method called DEFAULT_VALUE.
If I implement this BAdI the default code is no longer executed because the BAdI implementation refers to the interface /CWM/IF_EX_DEFAULT_MIGO and the DEFAULT_VALUE method. The code from my own method is executed instead.
My question : In some cases until a valid batch is entered the <b>default</b> code from the method DEFAULT_VALUE should be execute. The quick solution would be to copy-and-paste the code to my own method. But is it possible to call the default method ? (why should I maintain the code if SAP does it for me)
‎2006 Jul 14 7:46 AM
If I try to insert a call to the method by using "Pattern" in the editor I get this
CALL METHOD me->/cwm/if_ex_default_migo~default_value
EXPORTING
is_goitem = is_goitem
is_old_goitem = is_old_goitem
i_touched_erfmg = i_touched_erfmg
i_touched_cwm_erfmg = i_touched_cwm_erfmg
i_touched_erfme = i_touched_erfme
i_touched_cwm_erfme = i_touched_cwm_erfme
IMPORTING
E_/CWM/ERFME = E_/CWM/ERFME
E_ERFMG = E_ERFMG
E_ERFME = E_ERFME
E_/CWM/ERFMG = E_/CWM/ERFMG
.But this call calles my own methode that I just implemented (=endless loop) not the default code of the BAdI
How do I call the default code of a BAdI after I implemented Method ??
‎2006 Jul 14 10:32 AM
I found out how to call the standrdcode:
DATA: instance_def_obj TYPE REF TO /cwm/if_ex_default_migo.
CREATE OBJECT instance_def_obj TYPE /cwm/cl_def_im_default_migo.
CALL METHOD instance_def_obj->default_value
EXPORTING
is_goitem = is_goitem
is_old_goitem = is_old_goitem
i_touched_erfmg = i_touched_erfmg
i_touched_cwm_erfmg = i_touched_cwm_erfmg
i_touched_erfme = i_touched_erfme
i_touched_cwm_erfme = i_touched_cwm_erfme
IMPORTING
e_/cwm/erfme = e_/cwm/erfme
e_erfmg = e_erfmg
e_erfme = e_erfme
e_/cwm/erfmg = e_/cwm/erfmg.This will call the standard code for the BAdI
‎2006 Jul 14 10:07 AM
Hi,
Once you have implemented a BADI, the default code will not get executed.
If you wish to separate your custom code and the default code provided by SAP, you could use the Filter functionality and based on the value of the filter, you could set the implementation to be executed.
Regards,
HR
‎2006 Jul 14 10:26 AM
Hi Kim ,
Can u tell me the Business requirement ? So we can go thru that one.
as per my understanding of this issue.
If user entering valid batch no need to go thru the BADI code ?
so in that case put a logic like this.
<b>select single charg from mch1 into w_lips-charg
where matnr eq w_lips-matnr
and charg eq w_lips-charg.
if sy-subrc ne 0.
put ur code over here ?
else.
endif.</b>Regards
Prabhu
‎2006 Jul 14 10:26 AM
Hi Kim ,
Can u tell me the Business requirement ? So we can go thru that one.
as per my understanding of this issue.
If user entering valid batch no need to go thru the BADI code ?
so in that case put a logic like this.
<b>select single charg from mch1 into w_lips-charg
where matnr eq w_lips-matnr
and charg eq w_lips-charg.
if sy-subrc ne 0.
put ur code over here ?
else.
endif.</b>Regards
Prabhu
‎2006 Jul 14 10:33 AM
See abowe.
Yes the standard code for the BAdI has to be executed until a batch is entered. The my own implementation has to be executed.