Skip to Content
author's profile photo Former Member
Former Member

Virtual Characteristic based on 0FISCPER

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2009 at 11:23 AM

    Sorry for the manner I edited the previous message - how could I arrage it?

    Thank you for answering.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2009 at 11:50 AM

    hi,

    i dont see any field symbol name in the above code, is it the same in original code or you have removed it here.

    what i see in your code is this: FIELD-SYMBOLS: TYPE /BI0/OIFISCPER.

    Regards,

    Rk.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2009 at 12:13 PM

    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. The first method: 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.

    === To be continued! ===

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member
      ******* Variable Time Reference********
      
      IF i_s_rkb1d-infocube EQ 'ZIC_CC01'.
         IF i_step = '3'.
          LOOP AT i_t_var_range INTO l_s_var_range WHERE vnam EQ 'ZCURDAT'.
            ZCL_IM_CURRCONV=>currdate = l_s_var_range-low.
          clear l_s_var_range-low.
          ENDLOOP.
      
          LOOP AT i_t_var_range INTO l_s_var_range WHERE vnam EQ 'ZCURDAT1'.
            ZCL_IM_CURRCONV=>currdat1 = l_s_var_range-low.
            clear l_s_var_range-low.
          ENDLOOP.
      
          LOOP AT i_t_var_range INTO l_s_var_range WHERE vnam EQ 'ZCURDAT2'.
            ZCL_IM_CURRCONV=>currdat2 = l_s_var_range-low.
            clear l_s_var_range-low.
          ENDLOOP.
        ENDIF.
      ENDIF.
      ******** end of variable time reference ****

      i have used this document in writing this code, hope this helps you

      https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e473ab90-0201-0010-22ac-fdd925cac167

      regards,

      Rk.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.