Filter DTP rutine

Hi,
I am trying the automate the loads of a infocube, we load each day data of (day - 1) but  is very common the reprocess of data (delete one o more days and load again) to do that I am thinking delete at the process chain the request preload. To do that I have to create a routine in the dtp (calday sys-date -1) to mark the request and the delete works fine. But when I have to reprocess other day I have to change the routine, I donu2019t want that.
Can I in the routine recognize data outside (filters in DTP) and do not put sys-date - 1 inside the routine.
When I am debugging donu2019t see anything in the table L_T_RANGE.
I excepted find my filter outside the routine in this code:
  read table l_t_range with key
       fieldname = 'CALDAY'.
Bu the table is empty.
I would appreciate your help.

Leon,
I hope your issue is solved if not try this Code:
data: w_date1 type d.
w_date1 = sy-datum.
w_date1 = w_date1 - 1.
l_t_range-iobjnm = 'ZI_SCANDT'.
l_t_range-FIELDNAME = <field name>.
l_t_range-sign = 'I'.
L_T_RANGE-OPTION = 'EQ'.
l_t_range-LOW = w_date1.
if l_idx 0.
modify l_t_range index l_idx.
else.
append l_t_range.
endif.
p_subrc = 0.
Let us know if this works for your scenario.
~AK

Similar Messages

  • Boundary of request IDs

    Hello!
    At the moment I have a special scenario in which we have to load data from one cube to another cube via DTP and a special selection option. In order to have only some small loading windows it is the need that we using a special date to split the data into different time slices. The problem ist that we need only data until a special request number. It is not possible to have request ID in the DTP. So my question is, if it is possible to exclude request IDs via ABAP routine in the DTP? I guess that ist should be possible to access the request ID, but at the moment I don't know how it works.
    Example for scenario: Load all data with posting date 15.04.2014 but consider only request IDs until 20.04.2014. If there is any request who has a data record with posting date 15.04.2014 after 20.04.2014 then this recoord should exlcude from the loading procedure.
    Is there anybody who has some expiriences with such a special scenario?
    Thanx
    Jens

    Hello Jens
    I could not understood your problem completely. What is this special request number? Is it the request ID of the source cube?
    Are you looking for the option in the DTP to choose the Request ID ( Managescreen of the cube - 1st column)?  In this case, it is possible to use this in the DTP Filter - DTP Request (SID).
    Thanks and Regards,
    Ningaraju

  • RSB ERROR LOG DELETION

    DEAR EXPERTS ,
            I HAVE A SCENARIO ON DELETION OF RSB ERROR LOG TABLE TO USE  MY DB SPACE  EFFECTIVELY . COULD U PLZ  SUGGEST THE PROCEDURE .

    Note: SAP recommends to delete error logs for DTPs that has more than 300,000 data recs
    Step 1: Execute program u201CRSB_ANALYZE_ERRORLOGu201D from SE38. Result will show you list of DTPs with no. Data Recs.
                   From this u should note down the DTP (say DTP_XXXXXX) that has highest no. of data recs
    Step 2: From SE16...Table u201CRSBKREQUESTu201D, (filter DTP: DTP_XXXXXX). This will show entries for that particular DTP. If u 
                   scroll to right u can see datasource (column: SRC) name.
    Step 3: From SE38 execute Program u201CRSBM_ERRORLOG_DELETEu201D,
                    enter Date ranges ,
                    DTP : DTP_XXXXXX
                   Select check box for 'Delete Log' and Execute.

  • Incorrect initial value for char 0FISCYEAR in i_t_range in DTP filter prog

    Gurus
    I need your help , I have searched all the threads but could not find anything which can help me resolve this issue.
    I have a filter in DTP as a routine to get the year from system date.
    The program is correct for syntex but when I trigger the DTP I am getting the following message , not sure what needs to be added to my programe.
    Incorrect initial value for characteristic 0FISCYEAR in i_t_range
    Message no. DBMAN889
    appreciate any help I can get to reoslve this ASAP.
    Thanks in advance

    Hi
    Pleae check if you have initialised with a NULL value . "blank/null" is indeed not a valid characteristic value for fiscal period. Fisc.per is of type NUMC which means all characters have to be numerical. The initial value should be "0000000" .
    Thanks,
    Rajesh.
    Please provide points to answers if you find them helpful

  • Filter in DTP load from DSO to cube by Forecast version not working ?

    Hi All
    Can any help on the below code I did to filter data update from DSO to Cube in DTP - to filter by  next period forecast version. This code is not working it is loading data pf present forecast version also  Can any one help please
    data: l_idx like sy-tabix.
    data: L_date type sy-datum,
          t_gjahr  type t009b-bdatj,
          t_buper  type t009b-poper,
          1_period(6) type c.
              read table l_t_range with key
                   fieldname = 'ZFCSTVERS'.
              l_idx = sy-tabix.
       clear: t_buper, t_gjahr.
        L_date = sy-datum.
        call function 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date  = L_date
            i_periv = 'Z1'
          IMPORTING
            e_buper = t_buper
            e_gjahr = t_gjahr.
    *---> Check if the period is 012, then increase the year by 1 and set
    *period to 001.
        if t_buper = '012'.
          t_gjahr = t_gjahr + 1.
          t_buper = '001'.
        else.
    *---> Increase just the period by 1.
          t_buper = t_buper + 1.
        endif.
        concatenate t_gjahr t_buper+1(2)  into 1_period.
        l_t_range-fieldname = 'ZFCSTVERS'.
        l_t_range-low = 1_period.
        l_t_range-sign = 'I'.
        l_t_range-option = 'EQ'.
           append l_t_range.
              p_subrc = 0.
    sk
    Edited by: SK Varma Penmatsa on Jan 23, 2012 2:30 PM

    Hi Praveen/Raj,
    Basically PCS_PER_PACK is a KF i have in the DSO, which i use to calculate the total number of pieces which i store in a KF in the cube. The transformation rule to calculate TOTAL_PCS is a routine.
    within this routine i multiply PACKS * PCS_PER_PACK to calculate the figure. I do not store PCS_PER_PACK in the cube.
    is it this rule that you want me to check whether aggregation is set to SUM or overwrite? Also this rule should add up the total pcs. if I say overwrite then it might not give me the desired result?
    Thing which i cannot figure out is since the transformation rules go record by record why would it add up the PCS_PER_PACK figure before calculating?
    I cannot access the system at the moment. as soon as i can i will check on it and get back to you.
    thanks once again for you're quick response to my need.
    regards
    dilanke

  • 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

  • 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 .

  • 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

  • How to exculde a material in DTP Filter

    Hi experts,
    How to exculde a material in DTP filter. Exclude from selection is not working in DTP. please help me in solving the issue.
    Regards,
    Pradeep

    Hi,
    chk the following thread,it has the same issue as yours...
    DTP filter: Exclusion
    Sriram

  • 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.

  • 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

  • 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?

  • Help requeried in populating DTP filter through ABAP routine.

    Hi experts,
    I have written the following routine in my DTP filter.
    While debugging , the values are getting populated fine , but selections are not getting pupulated in the DTP. Thus, filter is not working.
              DATA: l_idx like sy-tabix ,
              w_dt(2) type n ,
          *Previous month
              w_pvmon(2) type n,
    Current month
              w_mon(2) type n,
    Year
              w_yr(4) type n,
    Start date of previous month and Start date of current month
              w_sdt1 LIKE sy-datum ,
              w_sdt2 LIKE sy-datum.
      Read table l_t_range with key
           fieldname = '/BIC/ZUPDDATE'.
      l_idx = sy-tabix.
      w_dt = sy-datum+6(2).
      w_mon = sy-datum+4(2) .
      w_yr = sy-datum+0(4).
    ****If first week of the month then start date = first day of previous
    *month
      If w_dt <= 07.
        IF w_mon = 01 .
          w_pvmon = 12.
          w_yr = w_yr - 1.
        else.
          w_pvmon = w_mon - 1.
        ENDIF.
        CONCATENATE w_yr w_pvmon '01' into w_sdt1.
        l_t_range-iobjnm = '/BIC/ZUPDDATE'.
        l_t_range-sign = 'I'.
        l_t_range-option = 'EQ'.
        l_t_range-fieldname = '/BIC/OIZUPDDATE'.
        l_t_range-low = w_sdt1.
        l_t_range-high = sy-datum.
        append l_t_range.
      else .
    After first week of the month ,  start date = first day of current
    *month
        CONCATENATE w_yr w_mon '01' into w_sdt2.
        l_t_range-iobjnm = '/BIC/ZUPDDATE'.
        l_t_range-sign = 'I'.
        l_t_range-option = 'EQ'.
        l_t_range-fieldname = '/BIC/OIZUPDDATE'.
        l_t_range-low = w_sdt2.
        l_t_range-high = sy-datum.
       " modify l_t_range index l_idx.
       append l_t_range.
        p_subrc = 0.
    endif.
    clear:w_dt ,w_pvmon ,w_mon ,w_sdt1,w_sdt2 ,w_yr.
    I have tried different fieldname values as well.
    Please share your inputs.
    Regards,
    Taru
    Edited by: Taru Dhawan on Feb 23, 2012 12:59 PM

    Hi
    What Alexandre said is right
    fieldname must be '/BIC/ZUPDDATE'
    and the iobjnm must be  'ZUPDDATE'.
    This should work.
    If no, just try
    fieldname = 'ZUPDDATE'.
    and iobjnm = '/BIC/ZUPDDATE'
    One of this will definitely work.
    Regards,
    Joe

  • ABAP Routine Variable in DTP filter

    Helllo,
    I am trying to create a routine in the Filter of DTP, so that I can only pass records that are between sy-datum and 12/31/9999 date range. In the filter are of DTP I created ABAP routine with this code:
    form compute_HE_SPCEND
      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 = 'HE_SPCEND'.
              l_idx = sy-tabix.
              data: v_day type dats.
              v_day = sy-datum.
              l_t_range-sign = 'I'.
              l_t_range-option = 'BT'.
              l_t_range-low = v_day.
              l_t_range-high = '99991231'.
                modify l_t_range index l_idx.
              p_subrc = 0.
    $$ end of routine - insert your code only before this line         -
    endform.
    However, when I execute the DTP I get an ABAP dump TABLE_INVALID_INDEX. Do you see anything wrong with the code?
    Thank you
    Edited by: AG on Jul 10, 2009 2:31 PM

    Thanks Mr V.
    I added that part of code. So now my code looks like this:
    form compute_HE_SPCEND
      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 = 'HE_SPCEND'.
              l_idx = sy-tabix.
              data: v_day type datum.
              v_day = sy-datum.
              l_t_range-sign = 'I'.
              l_t_range-option = 'BT'.
              l_t_range-low = v_day.
              l_t_range-high = '99991231'.
             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         -
    endform.
    I do not get the ABAP dump anymore, but I still have the problem. When I run the DTP, It gets errors. In a log it says that it cannot determine the value:
    @5C@     Incorrect initial value for characteristic 0HE_SPCEND in i_t_range     @35@
    @5C@     Error while extracting from source ZHE_O03 (type DataStore)     @35@
    @5C@     Package 1 / 07/10/2009 14:43:41 / Status 'Processed with Errors'     @35@
    Am I missing something? Looks like the values still do not get assigned to the field in the filter through my routine.
    Thanks

  • How to set a filter in DTP?

    Dear Gurus,
    I'm trying to load some selective data based on the Sales Order Number from DSrc to a DSO.  I'm trying to set a filter in the DTP.  Can someone please guide me how to set a filter in DTP?
    Thanks & Regards,
    Ashmeel.

    Hi,
    Double Click the DTP. Open the extraction Tab. On this tab you can see Filter Icon click on that. Put the filter as desired in the sales order number. Save and Activate.
    In case the field on which you want to apply the filter is not visible, open the DTP in edit mode click on the FIlter button, now click on change selection button. Here in you can drag the required fields to LHS for them to be visible in filter option.
    Apply required filter value Save & Activate the DTP
    Revert in case of doubt
    Regards
    Raj

Maybe you are looking for