Filter Routine in DTP

Hi,
I created a filter routine in DTP based on Calendar Month but the data selection didn't get filtered when I execute the DTP. Basically I just need to see current month's data. I am not familiar in writting the filter routine.
Can someone share with me a sample of filter routine? Any document or manual will be very helpful.
Thanks in advance.

Hi,
  find the sample fileter i have used in my DTP. ( in this i have written code to see only Emloyee whoes names area'RAJ'.)
Code:
    data: l_idx like sy-tabix.
          read table l_t_range with key
               fieldname = '/BIC/ZEMPNAME'.
          l_idx = sy-tabix.
          l_t_range-iobjnm = 'ZEMPNAME'.
          l_t_range-FIELDNAME = '/BIC/ZEMPNAME'.
          l_t_range-sign   = 'I'.
          L_T_RANGE-OPTION = 'EQ'.
          l_t_range-LOW = 'RAJ'.
          l_t_range-HIGH = 'RAJ'.
          if l_idx <> 0.
            modify l_t_range index l_idx.
          else.
            append l_t_range.
          endif.
For your requirement you can do like this,
    data: l_idx like sy-tabix.
          read table l_t_range with key
               fieldname = '/BI0/CALMONTH'.
          l_idx = sy-tabix.
      DATA DAT(2) TYPE C.
        DAT = sy-datum+4(2).        ** To find the current month.
          l_t_range-iobjnm = '/BI0/CALMONTH'.
          l_t_range-FIELDNAME = '/BI0/CALMONTH'.
          l_t_range-sign   = 'I'.
          L_T_RANGE-OPTION = 'EQ'.
          l_t_range-LOW = DAT .
Hope this will be helpful
rgrds,
v.sen.
Message was edited by:
        Senthilkumar Viswanathan

Similar Messages

  • Customer Exit variable and Filter routine in DTP does not works?

    Hello Experts,
    Does anyone know what might be the possible reason - A customer exit variable working fine on the OLAP side does not work in a DTP??
    I have also tried to use the Filter routine, which does not give me the right results..I am trying to fetch a Fiscalyear period maintained in an infoObject as follows in my Filter routine..
    ata: sel_period like /BIC/PZPARAM-/BIC/ZPARAMVAL.
    DATA: zperiod type /BI0/OIFISCPER.
              SELECT SINGLE /BIC/ZPARAMVAL INTO sel_period
              FROM /BIC/PZPARAM
              WHERE /BIC/ZPARAM = 'ZPCA'
              AND objvers = 'A'.
              zperiod = sel_period.
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = 'FISCPER'.
              l_idx = sy-tabix.
              l_t_range-iobjnm = '0FISCPER'.
              l_t_range-fieldname = 'FISCPER'.
              l_t_range-sign = 'I'.
              l_t_range-option = 'EQ'.
              l_t_range-low = zperiod.
              if l_idx <> 0.
                modify l_t_range index l_idx.
              else.
                append l_t_range.
              endif.
              p_subrc = 0.
    Please let me know if I am making any mistakes above..
    Kind Regards,
    Kadriks

    Hi
    1.  CLEAR l_t_range-high. is missing in your code befor assigning values to l_t_range.
    2. use simple append l_t_range after the l_t_range asisgnments. remove below code :
    if l_idx 0.
    modify l_t_range index l_idx.
    else.
    append l_t_range.
    endif.
    p_subrc = 0.
    3. I dont think you need to assign infoobject.
    4. Clear sel_period and zperiod is also missing
    Hence your code should be  :
    data: l_idx like sy-tabix.
    read table l_t_range with key
    fieldname = 'FISCPER'.
    CLEAR l_t_range-high.
    l_idx = sy-tabix.
    l_t_range-fieldname = 'FISCPER'.
    l_t_range-sign = 'I'.
    l_t_range-option = 'EQ'.
    l_t_range-low = zperiod.
    append l_t_range .

  • Reading filter values from dtp in routine of transformation

    Hello,
    I try to read a date from the filter of a dtp and propagate this value during the transformation in a routine. this is my code
    DATA:
    *Date parameter from DTP
           i_calday    type /BI0/OICALDAY,
           i_date(16) type n.
        data: t_filter_values type RSBK_TH_RANGE,
              l_filter_values like line of t_filter_values.
        t_filter_values = p_r_request->GET_TH_RANGE( ).
    * get DTP
        LOOP AT t_filter_values into l_filter_values.
          move l_filter_values-high to i_date.
          EXIT.
        ENDLOOP.
        I_calday = i_date+8(8).
        RESULT = I_CALDAY.
    but when dubbing my code t_filter_values is always empty and I do not see the selections from the dtp. please do you have an idea what is wrong?
    thanks

    Hello
    I found the error thanks to Ghuru Balaji S,
    now the code is working:
    DATA:
          t_filter_values  type RSBK_TH_RANGE,
          i_filter_values like line of t_filter_values ,
          i_calday    type /BI0/OICALDAY,
            i_date(16) type n.
    t_filter_values = P_R_REQUEST->get_TH_RANGE( ).
    READ TABLE t_filter_values with KEY
      FIELDNM = 'DATEFROM' into i_filter_values.
    move i_filter_values-high to i_date.
    I_calday = i_date+8(8).
    RESULT = I_CALDAY.
    problem was that I had other selection in the dtp
    Edited by: Margit Schütz on Dec 27, 2010 4:08 PM

  • Abap Routine in DTP Filter with selection in a table

    Hi guys,
    I need help please.
    I'm trying include a abap routine in a DTP filter, for this case I need to make a select in a dso table and return a list of criterias.
    Example: for this characteristic 0GL_ACCOUNT i need in a fiter 20 or more 0GL_ACCOUNT of table  "/BIC/DSO_XXX".
    How can I select more than one 0GL_ACCOUNT in a tranparency table  "/BIC/DSO_XXX"... and put in a DTP Fiter.
    DTP FILTER ROUTINE.
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = 'GL ACCOUNT'.
              l_idx = sy-tabix.
              if l_idx <> 0.
                modify l_t_range index l_idx.
              else.
                append l_t_range.
              endif.
              p_subrc = 0.

    Try this:
    DATA: lv_rows TYPE n LENGTH 10,
            it_zbw_pl_proj LIKE STANDARD TABLE OF /BIC/DSO_XXX 
            lw_zbw_pl_proj LIKE LINE OF it_zbw_pl_proj .
      SELECT COUNT(*) INTO lv_rows FROM  /BIC/DSO_XXX Where <your condition> .
    SELECT * INTO TABLE it_zbw_pl_proj FROM zbw_pl_proj where <your condition>
      IF lv_rows <> 0.
        LOOP AT it_zbw_pl_proj INTO lw_zbw_pl_proj  .
          l_t_range-iobjnm = '/BI0/GL_ACCOUNT'.
          l_t_range-fieldname = 'GL_ACCOUNT'.
          l_t_range-sign = 'I'.
          l_t_range-option = 'BT'.
          l_t_range-low = lw_zbw_pl_proj-GL_ACCOUNT.
          l_t_range-high = lw_zbw_pl_proj-GL_ACCOUNT.
          APPEND l_t_range.
        ENDLOOP.
      ELSE.
        " No data found for Current Forecast Version.
        p_subrc = 4.
      ENDIF.
    I just copied this data from a DTP routine where i am fetching Versions from a DB table zbw_pl_proj. You may need to change the naming convention and performance tune the code ( like defining internal table only to hold GL_account and then only selecting GL_Account from ODS).
    Hope this helps!
    Regards
    Amandeep Sharma
    Edited by: AmanSharma123 on Jul 14, 2011 2:42 PM

  • ABAP routine for DTP fiscal year/period filter

    Hi All,
    Delta loads are which not possible for when the transformation source is an InfoSet.  To limit the data in these loads, currently a filter is set in the DTPs on fiscal year/period so only load the current month and 2 prior months are loaded.  This filter has to be updated each month for each of the DTPs manually.  To eliminate this monthly task a dynamic filter (routine) needs should be used rather than a static filter. Can anybody help me in providing the logic
    Regards
    Siri

    data: l_idx like sy-tabix.
    read table l_t_range with key
         fieldname = give field name .
         Data : Year(4) type n,
                   period1(2) type n.
                   period2(2)type n.
    Currper = sy-datum+4(2) .
    period1 = currper-1 .
    period2 = currper-2.
    year = sy-datum+0(4).
    concatenate  year currper to P1.
    concatenate  year period1 to P2. // define P1 , P2 , P3 as 0fiscper .
    concatenate  year period2 to P3.
    l_t_range-sign = 'I'.
    l_t_range-option = 'BT'.
    l_t_range-low =  P3.
    l_t_range-high=  P1.

  • DTP  filter routine is not working

    Dear gurus
    I am working with BI 7  and I have created following filter'routine in the DTP.
    But the routine is not filtering.
    The statement :  read table l_t_range with key
                               fieldname = 'CLEAR_DATE'.
    is not working. sy-tabix = 0
    Fieldname is really CLEAR_DATE
    Please can you tell me what is wrong in the routine
    data: l_idx       like sy-tabix,
            w_date      like sy-datum,
            w_date_low  like sy-datum,
            w_date_high like sy-datum.
      read table l_t_range with key
           fieldname = 'CLEAR_DATE'.
      l_idx = sy-tabix.
    w_date = '20090705'.*
      w_date = sy-datum.
        w_date+6(2) = '01'.
        w_date_high = w_date - 1.
        w_date_low  = w_date_high.
        w_date_low+6(2) = '01'.
        l_t_range-low  = w_date_low.
        l_t_range-high = w_date_high.
        l_t_range-sign = 'I'.
        l_t_range-option = 'BT'.
        modify l_t_range index l_idx.
      p_subrc = 0.
    Edited by: Firmin Kouassi on Nov 3, 2009 12:04 PM
    Edited by: Firmin Kouassi on Nov 3, 2009 12:05 PM

    Try adding the following:
    l_t_range-fieldname = 'CLEAR_DATE'.
    to your code:
    l_t_range-low = w_date_low.
    l_t_range-high = w_date_high.
    l_t_range-sign = 'I'.
    l_t_range-option = 'BT'.
    And at the end append/modify like this:
    if l_idx NE 0.
        modify l_t_range index l_idx.
      else.
        append l_t_range.
      endif.
      p_subrc = 0.

  • Want create filter data  in using routine by DTP

    hi
    I  want create filter data  in using routine by DTP
    I want dowload data in my DSO, if the material exist in my infoobject 0material.
    But my code donu2019t worked:
    ===============================================================
    *&  Include           RSBC_SEL_ROUTINE_TPL
    program conversion_routine.
    Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rssdlrange.
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line  -
    TABLES: ...
    DATA:   ...
    tables :   /BIC/MATERIAL.
    DATA:
      l_s_ztable   TYPE /BIC/MATERIAL,
      l_s_range  type rssdlrange.
    $$ end of global - insert your declaration only before this line   -
        Fieldname       = ZCOSTCTR
        data type       = CHAR
        length          = 000010
    form compute_ZCOSTCTR
      tables l_t_range structure rssdlrange
      using i_r_request type ref to IF_RSBK_REQUEST_ADMINTAB_VIEW
            i_fieldnm type RSFIELDNM
      changing p_subrc like sy-subrc.
          Insert source code to current selection field
    $$ begin of routine - insert your code only below this line        -
      data: l_idx like sy-tabix.
      read table l_t_range with key
           fieldname = '/BIC/MATERIAL'.
      l_idx = sy-tabix.
      clear l_s_range.
      SELECT DISTINCT /BIC/ZCOSTCTR FROM /BIC/MATERIAL INTO l_s_ztable.
        l_s_range-iobjnm = '/BIC/MATERIAL'.
        l_s_range-fieldname = '/BIC/MATERIAL'.
        l_s_range-sign = 'I'.
        l_s_range-option = 'EQ'.
        l_s_range-low = l_s_ztable-/BIC/ZCOSTCTR.
       l_t_range-HIGH = l_s_ztable-/BIC/ZCOSTCTR.
        if l_idx <> 0.
          modify l_t_range index l_idx.
        else.
          append l_t_range.
        endif.
        p_subrc = 0.
      ENDSELECT.
    ==================================
    best regard
    francoise

    my code
    ===============================================================
    *& Include RSBC_SEL_ROUTINE_TPL
    program conversion_routine.
    Type pools used by conversion program
    type-pools: rsarc, rsarr, rssm.
    tables: rssdlrange.
    Global code used by conversion rules
    $$ begin of global - insert your declaration only below this line -
    TABLES: ...
    DATA: ...
    tables : /BIC/SMATERIAL.
    DATA:
    l_s_ztable TYPE /BIC/SMATERIAL,
    l_s_range type rssdlrange.
    $$ end of global - insert your declaration only before this line -
    Fieldname = MATERIAL
    data type = CHAR
    length = 000010
    form compute_MATERIAL
    tables l_t_range structure rssdlrange
    using i_r_request type ref to IF_RSBK_REQUEST_ADMINTAB_VIEW
    i_fieldnm type RSFIELDNM
    changing p_subrc like sy-subrc.
    Insert source code to current selection field
    $$ begin of routine - insert your code only below this line -
    data: l_idx like sy-tabix.
    read table l_t_range with key
    fieldname = '/BIC/MATERIAL'.
    l_idx = sy-tabix.
    clear l_s_range.
    SELECT DISTINCT MATERIAL FROM /BIC/SMATERIAL INTO l_s_ztable.
    l_s_range-iobjnm = '/BIC/SMATERIAL'.
    l_s_range-fieldname = '/BIC/SMATERIAL'.
    l_s_range-sign = 'I'.
    l_s_range-option = 'EQ'.
    l_s_range-low = l_s_ztable-/BIC/SMATERIAL.
    l_t_range-HIGH = l_s_ztable-/BIC/SMATERIAL.
    if l_idx 0.
    modify l_t_range index l_idx.
    else.
    append l_t_range.
    endif.
    p_subrc = 0.
    ENDSELECT.

  • Implementing routine in DTP to restrict value

    Hi ,
    I want to implement a routine in DTP to restrict value 'F' or 'f' which can appear anywhere in the number of a field.
    ex : "00000F389877" .
    As 'F' appears at the six position in the number, there can be a possibility of 'F'/'f' appearing at any position in the number.
    I went to the filter section of the DTP under extraction and tried to implement the logic but I need some help as to what exactly I should put there.
    I have included the table name as '/BIC/A....' and the high and low variables for the range .
    Any qucik help in this regard would be highly appreciated.
    Kindly also let me know if there is any alternate method to tackle this kind of problem.
    Regards,
    Amit

    Hello,
    Find below a sample code used in DTP filter to restrict date field:
    form compute_/BIC/ZDATE
      tables l_t_range structure rssdlrange
      changing p_subrc like sy-subrc.
          Insert source code to current selection field
    $$ begin of routine - insert your code only below this line        -
    data: l_idx like sy-tabix.
              read table l_t_range with key
                   fieldname = '/BIC/ZDATE'.
              l_idx = sy-tabix.
    data: g_date(6) type n.
    data: g_date1 type d.
    CALL FUNCTION 'ZMONTH_CALC'
    Exporting
         MONTHS = -17
         OLDDATE = sy-datum
    Importing
         NEWDATE = g_date1.
    g_date = g_date1+0(6).
    clear g_date1.
    concatenate g_date '01' into g_date1.
    l_t_range-iobjnm = 'ZDATE'.
    l_t_range-FIELDNAME = '/BIC/ZDATE'.
    l_t_range-sign = 'I'.
    L_T_RANGE-OPTION = 'GE'.
    l_t_range-LOW = g_date1.
              if l_idx <> 0.
                modify l_t_range index l_idx.
              else.
                append l_t_range.
              endif.
              p_subrc = 0.
    But i feel what you want to achieve will be much more easier to achieve in start routine of the transformation.
    Here you just need to loop at result package, check for the record with the number containing F/f and delete the record.
    REgds,
    Shashank
    Edited by: Shashank Dighe on Feb 27, 2008 10:22 AM

  • Is there any documentation for filter routine in Data Transfer Process?

    I am trying to create a filter routine in the Data Transfer Process to select different billing types depending on what date the Data Transfer Process is running....
    I have searched through SDN and found some examples, but some formal documentation would help.
    Is there any documention on filtering in a Data Transfer Process using a routine?
    I am in 7.0

    data: l_dow TYPE I,
          L_S_RANGE TYPE rssdlrange.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'F2'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'G2'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'L2'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZCDD'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZCDI'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZCR1'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZCR2'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZDR1'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZEDI'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZMD'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZRE'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZRE1'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZRED'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZSMP'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZUSD'.
    APPEND L_S_RANGE TO l_t_range.
    l_s_range-iobjnm = '0BILL_TYPE'.
    l_S_range-fieldname = 'BILL_TYPE'.
    l_S_range-sign = 'I'.
    l_S_range-option = 'EQ'.
    l_S_range-low = 'ZUSI'.
    APPEND L_S_RANGE TO l_t_range.
    CALL FUNCTION 'DATE_COMPUTE_DAY'
      EXPORTING
        date = sy-datum
      IMPORTING
        day = L_DOW.
    IF l_Dow EQ 5.
      l_s_range-iobjnm = '0BILL_TYPE'.
      l_S_range-fieldname = 'BILL_TYPE'.
      l_S_range-sign = 'I'.
      l_S_range-option = 'EQ'.
      l_S_range-low = 'S1'.
      APPEND L_S_RANGE TO l_t_range.
      l_s_range-iobjnm = '0BILL_TYPE'.
      l_S_range-fieldname = 'BILL_TYPE'.
      l_S_range-sign = 'I'.
      l_S_range-option = 'EQ'.
      l_S_range-low = 'S2'.
      APPEND L_S_RANGE TO l_t_range.
    ENDIF.

  • Routine in DTP to load data from previous fiscal period - current

    Hi Friends,
    I want to load data for previous & current fiscal period and I want to write a routine in DTP to automate this process, can any one help me with this routine!
    Thanks & Regards,
    vidiyala

    Hi Bilal,
    We cant create ABAP routine in DTP, instaed we can create in Info package.
    $$ begin of routine - insert your code only below this line -
    data : v_date like sy-datum.
    data : v_new_date like sy-datum.
    data: l_idx like sy-tabix.
    read table l_t_range with key
    fieldname = ' '.
    l_idx = sy-tabix.
    v_date = sy-datum.
    l_t_range-low = v_date+0(6).
    CALL FUNCTION 'DATE_CREATE'
    EXPORTING
    *anzahl_jahre =
    anzahl_monate = 8
    *anzahl_tage =
    datum_ein = v_date
    IMPORTING
    datum_aus = v_new_date.
    l_s_range-sign = 'BT.
    l_s_range-opt = 'I'.
    if l_idx 0.
    modify l_t_range index l_idx.
    else.
    append l_t_range.
    endif.
    p_subrc = 0.
    $$ end of routine - insert your code only before this line

  • Read filter values of DTP by ABAP routine

    I am trying to read the filter values of a DTP by ABAP routine in transformation.
    I could do it in the past by using the code
    DATA: t_filter_values TYPE rsbk_th_range.
        t_filter_values = p_r_request->get_th_range( ).
    After patching (SAPKW70019), the code does not seem to work.
    Are there any other ways to retrieve the DTP filter values in ABAP?

    Thank you Simon.
    Table RSSELDTP contains the filter values comma separated.
    But it would be really dirty to read the values from there.
    I would have to split the comma separated values. Furthermore, low and high value are just concatenated by a minus sign. I would have to split these values as well.
    Is there a better solution to the problem?

  • Routine in DTP Filter

    HI Gurus,
    We have two Cubes, Cube A and Cube B. Take 'X' as current Month (Ex: X = October 2010). Once in every month, the Cube A will load data from X-13 (if X is October 2010 then X-13 = September 2009) to X-2 (if X is October 2010 then X-2 = August 2010).
    Before the above step i need to do this.  In the DTP, i want to write a routine in filters Field: 0CALMONTH that X-14 (if X is October 2010 then X-14 = August 2009) data should be moved from Cube A to Cube B.
    Please provide me the code for routine to be added in DTP for above logic.
    Thanks & REgards,
    Balaji.S

    You can use the following logic. Suppose X as 201010 oct 2010
    Period = sy-datum+4(2) // This comes as 10
    year = sy-datum+0(4) // this comes as 2010.
    Now 14 months back would mean year = last year and month = current month -2 //  that is aug 2009
    so year1 = year-1 .
    period1 = period -2
    concatenate year1 period1 into l_t_range-low .
    You need to write for special cases Jan and feb . in that case month cant be obtained by subtracting 2 , you can give fix value for these .
    if period = 01 .
    period1 = 11 // nov
    if period = 02
    period1 = 12 // dec
    hope this helps.

  • Filter in the DTP routine

    Hi
    I have made a Routine that is going to pick out current month, and month = "250012". The "problem" is that it works fine in 3.5 infopackage, but not through the DTP. Can someone tell me what is
    wrong. It cust give me a short dump everytime...
    Ther routine is defined as below:
    data: l_idx like sy-tabix.
    read table l_t_range with key
         fieldname = '/BIC/SC_CL_MTH'.
    l_idx = sy-tabix.
    DATA: rep_month LIKE sy-datum,
            rep_month2 LIKE sy-datum.
      l_t_range-sign = 'I'.
      l_t_range-option = 'EQ'.
      rep_month2 = '250012'.
      rep_month = sy-datum(6).
      l_t_range-sign    = 'I'.
      l_t_range-option  = 'EQ'.
      l_t_range-low = rep_month.
      append l_t_range.
      l_t_range-sign    = 'I'.
      l_t_range-option  = 'EQ'.
      l_t_range-low = rep_month2.
      modify l_t_range index l_idx.
      p_subrc = 0.

    Hi Helge,
    Data type mis match. For month you should take reference to calmonth not date.
    Try this: gives range from current month to 250012.
    data: l_idx like sy-tabix.
    read table l_t_range with key
    fieldname = '/BIC/SC_CL_MTH'.
    l_idx = sy-tabix.
    DATA: rep_month LIKE /BIC/SC_CL_MTH'. "Reference to infoobject
               rep_month2 LIKE /BIC/SC_CL_MTH'.
    rep_month2 = '250012'.
    rep_month = sy-datum(6).
    l_t_range-sign = 'I'.
    l_t_range-option = 'EQ'.
    l_t_range-low = rep_month. " From Value -> Current Month
    l_t_range-high = rep_month2. " To Value -> 250012
    append l_t_range.
    p_subrc = 0.
    Hope it Helps
    Srini
    [Dont forget to close the call by assigning poings.... - Food for Points: Make a Difference through Community Contribution!|https://www.sdn.sap.com/irj/sdn/index?rid=/webcontent/uuid/007928c5-c4ef-2a10-d9a3-8109ae621a82]

  • OLAP Variable for Filter Selections in DTP

    Hi
      In BI 7.0 DTP i am using a ZZ OLAP Variable for a Filter on Location.
      How/Where i can check the values defined for that OLAP Variable and if i want to update that selection with few new values
    Thanks

    Hi,
    Please check the threads below:
    Re: Infopackage - ABAP routine or OLAP variable
    Re: How to create OLAP Variable in DEV
    Re: Infopackage - ABAP routine or OLAP variable
    Re: creation of OLAP  Variable
    -Vikram

  • How to filter data in DTP

    Hi guys,
    I'd need your help to guide me with this requirement:
    I have an infocube A with CO data. I must copy some of the data from this infocube A to other infocube B. But I don't want to copy all the data, just want to select only those lines that the costcenter exist in a Z table and skip the others lines.
    I guess I should use and ABAP routine into the DTP filters that reads the costcenter for each line of Infocube A, checks if that costcenter is into the Z table and in case it is not, skip the line. Since I'm not an ABAPer I don't have a clue on how to skip the lines and unfortunately I don't have a developer by my side... So your help will be highy appreciated. If you also know of a better approach to get the same result please let me know!
    Thanks in advance.
    Ruben.

    You have to write code in transformation start routine. I dont think you can write in DTP filter.
    Code will be something like this. Consider -
    Info-object - 0COSTCENTER
    Table - ZCOST & field - ZCCENTER
    Code in global start routine -
    DATA ITAB1 LIKE STANDARD TABLE OF ZCOST.
    SELECT * FROM ZCOST INTO TABLE ITAB1.
    SORT ITAB1 BY ZCCENTER.
    Code in method Start_Routine
    LOOP AT SOURCE_PACKAGE.
    READ TABLE ITAB1 WITH KEY ZCCENTER = SOURCE_PACKAGE-COSTCENTER BINARY  SEARCH.
            IF SY-SUBRC NE 0.     
                DELETE SOURCE_PACAKGE.
            ENDIF.
    ENDLOOP.
    Abhijit
    Edited by: ABHIJIT TEMBHEKAR on Nov 20, 2008 1:32 PM

Maybe you are looking for

  • Downloading and Installing a Full Solution Driver in Windows 8 Using a Wireless Connection

    Learn how to download a full solution driver for your printer from HP's website and install it using a wireless connection. The full solution driver provides you with all the tools and software needed to use all of the printer's intended functions. T

  • Audigy SE, Vista, LIne In and

    I see in the release notes a known issue is that direct monitoring is not supported in this driver release. Any clues as to when it might be, if ever, and will I be better off just to buy a card with drivers that support all of?the cards?functions, a

  • BATT??

    hi! i just got a new 60gb ipod video for the holidays and i noticed that the battery doesn't last for one day when it said in the box it should last for 20 hours.....is my ipod defective? pj

  • Cannot play my custom genres like I used to, wonder what has changed?

    Bought this new ipod Touch 5 and synced with my itunes.  The songs have synced properly, but when I used the Genres option, I'm able to find the custom genres I created, but there are no songs under them?  I can access the same songs when I go throug

  • Why does my Macbook Pro keep randomly shutting off with or without the adapter?

    I had this problem before that my 13-inch Macbook Pro would stop working without the plug, and then it started resetting its clock to 2000 every time i rebooted it until it eventually died altogether. I found out that my data cable was bad and got it