on 10-01-2009 2:11 AM
Hi all gurues:
I have to derive a characteristic B, with the content of a source characteristic A.
So I need an ABAP rutine to derive, fullfiling B with the content of A. . Ej: CL_RSPLS_CR_EXIT_BASE
BUT: both characteristics have the same name !!! because both represents a COST-CENTER and are based on the same reference and shares MD.
SO:
In the ABAP class using CL_RSPLS_CR_EXIT_BASE, I must use the same code for both, and it doesnt work.
???????
__________________________________________________________________________// CODE
METHOD IF_RSPLS_CR_METHODS~DERIVE.
*----
FIELD-SYMBOLS:
<f_SMCECO> TYPE ANY,
<f_SMCECOAUT> TYPE ANY.
ASSIGN COMPONENT '/BIC/SMCECO' OF STRUCTURE c_s_chas TO <f_SMCECO>.
ASSIGN COMPONENT '/BIC/SMCECO' OF STRUCTURE c_s_chas TO <f_SMCECOAUT>.
<f_SMCECO> = <f_SMCECOAUT>.
__________________________________________________________________________// END of CODE
What should I do to fix the problem ?
I know that an ABAP programer would solve this in a couple of minutes, but I dont have any available by this days.
Thanks a lot.
My regards.
Guillermo.
Hi Guillermo,
copy the class cl_rspls_cr_exit_base to your own class and change the constructor as follows:
...
l_s_cob_pro contains the meta data for the actual infoobject:
ATTENTION: l_s_cob_pro-fieldnm contains the fieldname of BW
generated data structures, e.g. for reference characteristics
the names used in master data tables may be different !
l_s_chas-fieldnm = l_s_cob_pro-iobjnm. "<== changed
Then the exit class uses the InfoObject name in fields of the record c_s_chas (and not the fieldname of the BW generated
DB structures).
In SE24 the class cl_rspls_cr_exit_base is documented, e.g check the documentation for the attribute N_TS_CHAS. The
template implementation uses the fieldnames of the generated DB structures to make DB access more convenient.
Regards,
Gregor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My code is also very simple and similar to the above mentioned:
* implement your derivation algorithm here:
field-SYMBOLS: <l_chavl> type any.
FIELD-SYMBOLS: <l_planitem> TYPE ANY.
FIELD-SYMBOLS: <l_account> TYPE ANY.
ASSIGN COMPONENT '/BIC/WPLANITEM' OF STRUCTURE c_s_chas TO <l_planitem>.
ASSIGN COMPONENT 'ACCOUNT' OF STRUCTURE c_s_chas TO <l_chavl>.
<l_chavl> = <l_planitem> .
i) I've put this code in IF_RSPLS_CR_METHODS~DERIVE after i copied the Class CL_RSPLS_CR_EXIT_BASE into my own class.
ii) I've read many posts that custom info object should be assigned as '/BIC/<info Object>' . but it's still not helping me.
Issues :
1) The code doesn't work
2) i am not able to debug the code ( Break-point won't work) . Even if i make code work , I really would like to know how to debug. Please let know how to debug.
3) The 0ACCOUNT ( Target char) also has 0CHRT_ACCTS has compounding object ( this is also checked automatically in the target Char) . Does this affect the code?. How to handle this scenario?
Regards,
Satish M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
What exactly doesn't work ?
Did you try to debug the code in class ?
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.