Skip to Content
0
Former Member
Aug 11, 2009 at 11:15 AM

Virtual Characteristic based on 0FISCPER

64 Views

I have the following situation.

A) I had created a virtual characteristic - Z0FISCPER - based on 0FISCPER and a query ZCO_O04 (the InfoProvider has the same name ZCO_O04).

This query contains a key figure which express an amount.

I chose as conversion type for this amount, the type ZAVG3A which has Variable Time Reference - Special InfoObject, namely Z0FISCPER.

Suppose 0FISCPER = 001.2009 - 003.2009. This virtual characteristic, Z0FISCPER, should be filled at run time as following:

1. if exchange Rate Type for Conversion type is 1002, then Z0FISCPER = 0FISCPER.

Consequently, Z0FISCPER = 001.2009 - 003.2009

2. if exchange Rate Type for Conversion type is 1003, then Z0FISCPER = higher month of interval 0FISCPER.

Consequently, Z0FISCPER = 003.2009 - 003.2009.

B) I created BADI implementation ZCURRCONV based on Business Add-In RSR_OLAP_BADI.

I set filter on InfoProvider as ZCO_O04.

C) The name of implemented class is ZCL_IM_CURRCONV which has:

1. Attributes

P_CHA_Z0FISCPER, level Instance Attribute, visibility Public, type I

Z0FISCPER, level Static Attribute, visibility Public, type /BI0/OIFISCPER (Open Fiscal Year Period)

2. Methods:

METHOD IF_EX_RSR_OLAP_BADI~DEFINE.

DATA: l_s_chanm TYPE rrke_s_chanm,

l_s_chanm_used TYPE rschanm.

FIELD-SYMBOLS:

<l_s_chanm> TYPE rrke_s_chanm.

CASE i_s_rkb1d-infocube.

WHEN 'ZCO_O04'.

loop at i_th_chanm_used into l_s_chanm_used.

case l_s_chanm_used.

when 'Z0FISCPER'.

l_s_chanm-chanm = 'Z0FISCPER'.

l_s_chanm-mode = rrke_c_mode-no_selection.

APPEND l_s_chanm TO c_t_chanm.

when others.

endcase.

endloop.

ENDCASE.

ENDMETHOD.

METHOD if_ex_rsr_olap_badi~compute .

FIELD-SYMBOLS: <l_z0fiscper> TYPE /BI0/OIFISCPER.

IF p_cha_z0fiscper > 0.

break developer2.

ASSIGN COMPONENT p_cha_z0fiscper OF STRUCTURE c_s_data TO <l_z0fiscper>.

<l_z0fiscper> = z0fiscper.

ENDIF.

ENDMETHOD.

D) In CMOD, function module EXIT_SAPLRRS0_001, include ZXRSRU01, I coded

IF i_s_rkb1d-infocube EQ 'ZCO_O04'.

IF i_step = 3.

DATA l_0rtype TYPE kurst.

CLEAR l_0rtype.

LOOP AT i_t_var_range INTO l_s_var_range WHERE iobjnm EQ '0RTYPE'.

IF sy-subrc EQ 0.

l_0rtype = l_s_var_range-low.

ENDIF.

ENDLOOP.

CLEAR l_s_var_range.

IF NOT l_0rtype IS INITIAL.

LOOP AT i_t_var_range INTO l_s_var_range WHERE vnam EQ 'ZP_FPER_INTER12_R'.

CASE l_0rtype.

WHEN '1002'.

zcl_im_currconv=>z0fiscper = l_s_var_range-low.

WHEN '1003'.

zcl_im_currconv=>z0fiscper = l_s_var_range-high.

WHEN OTHERS.

ENDCASE.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

= = = = =

I mention that ZP_FPER_INTER12_R its the variable type 0FISCPER which is manually entered.

= = = = =

All these being done, my query doesn't get any data, even I have data in tables.

Which is my question - is there something wrong with my code?

Does anyone have successful experience with the same scenario with a virtual characteristic based on 0FISCPER? If yes, could you provide me some guidelines?

Thank you in advance! I appreciate any suggestion.