Skip to Content
avatar image
Former Member

OLAP Variable does not extract any data

Hi,

I copied SAP standard OLAP Variable 0CML12CM into new variable ZCML12CM from which I want to exclude the current month.

At first I'm testing to see if the datapackage extracts any data or not, by using the SAP standard variable ABAP Code (so current month is not excluded yet) in my variable ZCML12CM. The variable extract the last 12 months including current month.

in CMOD the code seems correct, and I'm able to select the variable in my data package, assigning a fiscal year variant to it.

The data package is to extract HR data from datasource Employee (0HR_PA_0).

The problem is; no selection is made on CALMONTH when I execute the package, so all data is extracted, instead of the last 12 months. Any idea why this is hapening? I'm 99,9% the code is correct, but somehow the package does not pick it up!

Please help!

M

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 08, 2010 at 11:15 AM

    Hi,

    yes thyats the code, only I renamed a few elements since they are identical in my DATA statement.

    See here:

    {WHEN 'ZCML12CM'.

    • Determine the last 12 month including the current month

    VYEAR = SY-DATUM+0(4).

    VMONTH = SY-DATUM+4(2).

    L_S_RANGE-HIGH = VYEAR.

    L_S_RANGE-HIGH+4 = VMONTH.

    IF VMONTH < '12'.

    VMONTH = VMONTH + 1.

    VYEAR = VYEAR - 1.

    ELSE.

    VMONTH = '01'.

    ENDIF.

    L_S_RANGE-LOW = VYEAR.

    L_S_RANGE-LOW+4 = VMONTH.

    CLEAR ZE_T_RANGE.

    L_S_RANGE-SIGN = 'I'.

    L_S_RANGE-OPT = 'BT'.

    APPEND L_S_RANGE TO ZE_T_RANGE.}

    I've tried using the standard elements L_YEAR and L_MONTH but that didnt make any difference.

    Thanks

    M

    Add comment
    10|10000 characters needed characters exceeded

    • {WHEN 'ZCML12CM'.

      • Determine the last 12 month including the current month

      VYEAR = SY-DATUM+0(4).

      VMONTH = SY-DATUM+4(2).

      L_S_RANGE-HIGH = VYEAR.

      L_S_RANGE-HIGH+4 = VMONTH.

      IF VMONTH < '.

      VMONTH = VMONTH + 1.

      VYEAR = VYEAR - 1.

      ELSE.

      VMONTH = '01'.

      ENDIF.

      L_S_RANGE-LOW = VYEAR.

      L_S_RANGE-LOW+4 = VMONTH.

      CLEAR ZE_T_RANGE.

      L_S_RANGE-SIGN = 'I'.

      L_S_RANGE-OPT = 'BT'.

      APPEND L_S_RANGE TO ZE_T_RANGE.}

      here is the correction

       
      APPEND L_S_RANGE TO ZE_T_RANGE is wrong
      
      APPEND L_S_RANGE TO E_T_RANGE.
      

  • Apr 08, 2010 at 10:37 AM

    are you excluding the values from infopackage then it wont be possible in IP

    Add comment
    10|10000 characters needed characters exceeded

    • Did you use this code

        DATA: L_YEAR(4)     TYPE N,
              L_MONTH(2)    TYPE N,
              L_S_RANGE     TYPE RSR_S_RANGESID.
      
      * Determine the last 12 month including the current month
        L_YEAR = SY-DATUM+0(4).
        L_MONTH = SY-DATUM+4(2).
      
        L_S_RANGE-HIGH = L_YEAR.
        L_S_RANGE-HIGH+4 = L_MONTH.
      
        IF L_MONTH < '12'.
          L_MONTH = L_MONTH + 1.
          L_YEAR = L_YEAR - 1.
        ELSE.
          L_MONTH = '01'.
        ENDIF.
      
        L_S_RANGE-LOW = L_YEAR.
        L_S_RANGE-LOW+4 = L_MONTH.
      
        CLEAR E_T_RANGE.
        L_S_RANGE-SIGN = 'I'.
        L_S_RANGE-OPT  = 'BT'.
        APPEND L_S_RANGE TO E_T_RANGE.
      

  • avatar image
    Former Member
    Apr 08, 2010 at 01:11 PM

    Thanks!" That worked very well.....

    I now realise E_T_RANGE is used as export paramter, and not ZE_T_RANGE...

    Thanks a lot for your help!

    M

    Add comment
    10|10000 characters needed characters exceeded