cancel
Showing results for 
Search instead for 
Did you mean: 

BI IP - Derivation - two characteristics with equal name.

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi.

What exactly doesn't work ?

Did you try to debug the code in class ?

Regards.

Former Member
0 Kudos

GREGOR !!!!!

Great ! It works perfectly.

Thanks a lot.

Guillermo.