Question:
Hello,
I have a posting in my transaction cube including characteristic A and B.
Those two characteristics are attributes of characteristic C, which I would like to derive in the cube (using an exit ?).
If somebody could give a sample of code for such a derivation, it would be highly appreciated.
Thanks a lot
paulk
Answer:
Instead of using user exit for this. you can use characteristic relationships of type attribute and also use derivation.
I hope this will work.
Answer:
Hello,
Thanks for your answer ram123 but the characteristic relationship doesn't work for what I want.
Following my example, it would be possible to derive A and B (attributes of C, if it is known) with the characteristic relationship BUT it's not the aim because I already have A and B in the cube and I have to fill C.
To achieve this, according to me, the only solution is to use an exit.
paulk
Answer:
have a look at this standard function API_SEMBPS_CHA_VALUES_UPDATE as a reference that updates characteristic values.
hope it helps.
Answer:
derive the 'C' form 'a' and 'b' in the char relationship exit.make sure that c is not present in the planning levl.
sample..use it in the place FM: Derivation.in the example below I'm populating revenue class dependent on the value of rate class.make sure to use the "search" button to be sure about the combination of level/packages/sequence where your derivation will be used.
Hope it helps.
FUNCTION Z_DERIVE_RATE_CAT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_AREA) TYPE UPC_Y_AREA
*" REFERENCE(ITO_CHA) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_SOURCE) TYPE UPC_YTO_CHA
*" REFERENCE(ITO_TARGET) TYPE UPC_YTO_CHA
*" CHANGING
*" REFERENCE(XS_CHAS) TYPE ANY
*" EXCEPTIONS
*" FAILED
*"----------------------------------------------------------------------
FIELD-SYMBOLS: <REVCLASS>,
<RATECAT>.
ASSIGN COMPONENT 'UI_REVCL2' OF STRUCTURE xs_chas TO <REVCLASS>.
ASSIGN COMPONENT 'UI_RCLASS' OF STRUCTURE xs_chas TO <RATECAT>.
CASE I_AREA.
WHEN 'ZPLAN2'.
READ TABLE ito_cha TRANSPORTING NO FIELDS
WITH KEY chanm = 'UI_RATECAT'.
IF SY-SUBRC = 0.
CASE <RATECAT>.
WHEN 'R'.
MOVE 'R' TO <REVCLASS>.
WHEN 'LPT'.
MOVE 'C' TO <REVCLASS>.
WHEN OTHERS.
RAISE FAILED.
ENDCASE.
ENDIF.
ENDCASE.
ENDFUNCTION.
Answer:
Thank you for everybody,
Finally (after gathering info in different posts), I could build an exit which work very good :
DATA: lth_data type /1SEM/_YS_DATA_100... occurs 0 with header line.
DATA: item3(16) TYPE c.
LOOP AT xth_data into lth_data.
* function to read the master data in BW : item2/dp/act/subac are
* attributes of item3)
CALL FUNCTION 'Z_BW_EGE_GET_ITEM3'
EXPORTING
item2 = lth_data-S_CHAS-EGE_ITEM2
dp = lth_data-S_CHAS-EGE_DP
act = lth_data-S_CHAS-EGE_ACT
subac = lth_data-S_CHAS-EGE_SUBAC
IMPORTING
item3 = item3.
lth_data-S_CHAS-EGE_ITEM3 = item3.
CLEAR : item3.
APPEND lth_data.
ENDLOOP.
clear xth_data.
refresh xth_data.
xth_data[] = lth_data[].
ENDFUNCTION.
paulk
Answer:
Paul,
Thanks for your post.Glad you were able to solve the problem.
Regards,
phillyzonedude