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?

Similar Messages

  • 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

  • Read current DTP filter value in Transformation via ABAP

    Hi guys!
    Here's the case.
    In DTP filter there is an OLAP variable, which value depends a lot on where the DTP was started from and what starting parameters are.
    We need to read the value of this variable in order to write some ABAP routines in Transformation.
    How can we read the current value of our OLAP variable?
    Thanks a lot for you help!

    Hi Vadim,
    I think this is what you are looking for...
    [/people/shlomi.weiss2/blog/2010/11/10/how-to-get-selection-criteria-in-transformations-routines|/people/shlomi.weiss2/blog/2010/11/10/how-to-get-selection-criteria-in-transformations-routines]
    Hope it helps...
    Regards, Federico

  • Dynamic "Filter" value in APD

    Hi People,
    I have a question about APD. Is there any way to inform dynamic filter value to APD? Like OLAP variable in infopackage selection?
    For example, I have an transactional ODS receiving data from an APD and it has a "Filter" due to restrict the volume of data. In that "Filter" there are many selections with fixed values for each one (e.g. 0CALMONTH). I'd like to know if is possible to replace "fixes" value for dynamic values (e.g. ABAP routine). Or even, another way to pass values to the "filter" parameters when running it by program RSAN_PROCESS_EXECUTE .
    I appreciate any kind of help.
    Thanks in advise,
    Fernando Faian

    Well, variables are not possible in analysis processes. I know that some customers are using ABAP routines for a dynamic filtering. Some prepare the filter criteria in another program, and the results are then processed in an ABAP routine within the analysis process. Of course, those results need to be stored in between.
    Variables like "previous period" are sometimes evaluated directly in the analysis process, but this also means to code it in an ABAP routine.
    Hence, I do not know a simple solution. RSAN_PROCESS_EXECUTE does not have any further control parameters which could be used for this.

  • 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

  • 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 in DTP

    hi,
    I need some help withe ABAP routine in the DTP selection
    I have requirement to load the data for specific company codes on a specific days.
    If the current date is monday then it should pick Taiwan  or
    if the current date is Tuesday the it should pick Australia and Korea or
    if the current date is sunday then it should pick CHINA and Vietnam.
    I want to use only one DTP for this requirement. Please help me with the code for Info Object 0COMP_Code.
    Regards,
    Raghu

    hi,
    I have tried the code and it is not populating any value in the selection.
    Please check
    data: l_idx like sy-tabix.
    data: day like SCAL-INDICATOR.
    *Finding out the day
      clear day.
      CALL FUNCTION 'DATE_COMPUTE_DAY'
        EXPORTING
          DATE = sy-datum
        IMPORTING
          DAY  = day.
      read table l_t_range with key
           fieldname = 'COMP_CODE'.
      l_idx = sy-tabix.
    case day.
        when 1.                                 "Monday
          l_t_range-low = '0711'.
          l_t_range-high = ' '.
          l_t_range-option = 'EQ'.
          l_t_range-sign   = 'I'.
          modify l_t_range index l_idx.
        when 2.                                 "Tuesday
          l_t_range-low = '0355'.
          l_t_range-high = ' '.
          l_t_range-option = 'EQ'.
          l_t_range-sign   = 'I'.
          modify l_t_range index l_idx.
        when 3.                                 "Wednesday
         l_t_range-low = '0211'.
          l_t_range-high = ' '.
          l_t_range-option = 'EQ'.
          l_t_range-sign   = 'I'.
          modify l_t_range index l_idx.
       when 4.
       when 5.
       when 6.
       when 7.
         l_t_range-low = 'China'.
         l_t_range-high = ' '.
         l_t_range-option = 'EQ'.
         l_t_range-sign   = 'I'.
         modify l_t_range index l_idx.
    endcase.
    p_subrc = 0.

  • Determine/read the value of parameter rdisp/max_wprun_time within ABAP

    Hi,
    I need to avoid program breaks caused by exceeding run time longer than defined in parameter rdisp/max_wprun_time.
    I will check the time since start of report in the critcal loop to bring the current data changes to a controlled end before getting a program break. I won't put a constant to the report, I will have a dynamical routine to avoid changes of report if the value of parameter rdisp/max_wprun_time will be changed.
    But how can I get the value of this parameter within my ABAP report? Is there a table where this value has been stored? Is there an existing function module or a method to read the value?
    Thank's a lot in advance!
    Georg

    The runtime   parameter (GET RUN TIME ) can be used to dynamically get the program run time
    DATA T TYPE I.
    GET RUN TIME FIELD T.
    WRITE: / 'Runtime', T.
    or
    U probably can store the start date and time in TVARV with some variable ( line concatenate program name + START Date + Time)
    and then use
    SD_DATETIME_DIFFERENCE
    or
    SD_CALC_DURATION_FROM_DATETIME
    Regards,
    Mithun Shetty

  • Excluding Value Range - ABAP Routine at Infopakage Selection

    Hi,
    In Production the volume of data is very high, I m splitting the data based on Material No.
    000000000000 - 4ZZZZZZZZZ,
    500000000000 - 8ZZZZZZZZZ,
    900000000000 - FFFFFFFFFFFFF,
    and the remaining Material No.s.
    I created seperate InfoPaks for the material Ranges for the above three.
    I need to load the remaining Material No. data. For the I need to write the ABAP routine at the Infopakage Selections.
    Can you help me doing so.
    Thanks in Advance.
    Surya.

    Hi,
       analyse the data. total data u can split with the help of Organisational values. take the case in souce system i have 40 million records of sales orders. then i will do like how many sales area's we have in our organization. assume. 4 sales areas then i willl create a infopackage for each. so tat u won't miss any data.
    don't go for Material number, select organisational values.
    all the best.
    Nagesh.

  • Abap routine to NOT to allow only one value

    Hello Everyone,
    I am trying to filter out one PO Number from WBS costs load.  I wrote an abap routine as the data selection.  The data source does not allow the 'NE'.  Any suggestions?
    Below is the code.
    read table l_t_range with key
                   fieldname = 'REFBN'.
              l_idx = sy-tabix.
             l_t_range-SIGN = 'I'.
             l_t_range-OPTION = 'NE'.
             l_t_range-low = '786587543'.
             modify l_t_range index l_idx.
              p_subrc = 0.

    Hi Shilpa,
    We had a similar problem..
    The way we solved it was by loading by PO number..
    Say if you want to skip PO number 5000,
    Load first load using selection 1-4999 and second load from 5001-999999.
    Hope this helps
    Ashish

  • Table to Find the DTP Filter Values

    Hi All,
    Can anyone help me by providing  the details about where we can find DTP Filter values?
    We checked RSBKDTP and it dint help.
    Regards
    Ramesh

    Hi,
    RSSELDTP is a transparent table ....when i checked in devleopment it is present
    and in production when i checked it is not present......
    I dont why it happened it may be similar case with u too ....
    But this table in development gives selection conditions...
    Regards
    Vamsi

  • Call function in abap routine of infopackage

    Experts,
    Good day. I have a problem concerning the data to be imported in my ods.I can't find a similar thread corcerning my problem. My ‘File date’ field should contain only 2 years and 3months data of recent data. I'm using a call function fima_date_create to filter values of zfile_date.
    CALL FUNCTION 'FIMA_DATE_CREATE'
      EXPORTING
        I_DATE                             = sy-datum
        I_FLG_END_OF_MONTH   = ' '
        I_YEARS                          = 2-
        I_MONTHS                        = 3-
        I_DAYS                             = 0
        I_CALENDAR_DAYS          = 0
        I_SET_LAST_DAY_OF_MONTH       = ' '
      IMPORTING
        E_DATE                             =
        E_FLG_END_OF_MONTH   =
        E_DAYS_OF_I_DATE         =   
    The sy-datum becomes the “High” value and the date generated by this FM will be the “low” value. I already tested this function module and it is what i want. How Should I write the ABAP code for this in the abap routine for my infopackage? Or what steps do I need to take.

    Hi,
    When you choose the option to write a routine for one of the characteristics in the infopackage selections, you get a window to write your code with some prewritten code as below. Modify it as shown below, for your requirement.
    data: l_idx like sy-tabix.
    read table l_t_range with key
         fieldname = 'CALDAY'.
    l_idx = sy-tabix.
    START of YOUR CODE
    <----
    Required logic -
    >
    L_T_RANGE-LOW  = <lower limit of range>.
    L_T_RANGE-HIGH = <upper limit of range>.
         L_T_RANGE-SIGN = 'I'.
         L_T_RANGE-OPTION = 'BT'.
    END of YOUR CODE
    modify l_t_range index l_idx.
    p_subrc = 0.
    Hope this helps.

  • ABAP routine in infopackage that runs function in ECC

    Hi All
    I need to have dynamic filter in the info package
    I have program in ECC that brings me the value that I need to filter in my info packege
    I want to use  ABAP routine in infopackage that runs function in ECC and brings the value that was received from the ECC function
    Is that possible?
    Thanks

    Hi All
    my CTO found the following option
    function module that is "remote-enabled module "
    then you call CALL FUNCTION 'Y_FM_IDOC_CATSDB' DESTINATION 'SAP4.7E'
    you need to define it in SM59
    code example
    data: BEGIN OF IT_SOBSL OCCURS 0,
          SOBSL(2),
          END OF IT_SOBSL.
    DATA: ls_range type STANDARD TABLE OF rssdlrange WITH HEADER LINE.
    SELECT /BIC/ZSPEPROCI FROM /BIC/SZSPEPROCI INTO TABLE IT_SOBSL
                          WHERE /BIC/ZSPEPROCI NOT BETWEEN 'AA' AND 'ZZ'
                          AND /bic/zspeproci ne '' .
    BREAK-POINT.
    LOOP AT IT_SOBSL.
    ls_range-IOBJNM = 'SOBSL'.
    ls_range-LOW = IT_SOBSL-SOBSL.
    ls_range-SIGN = 'I'.
    ls_range-OPTION = 'EQ'.
    APPEND ls_range .
    ENDLOOP.
    loop at ls_range.
      append ls_range to l_t_range.
    endloop.

  • Write ABAP routine in transformation rule

    Dear all,
    I am very new to ABAP. Currently I would like to transfer some data from cube A to cube B. The problem is
    Cube A and B have different Unit of Mesure. The product standard cost is based on each Item's UOM. For example:
    Cube A data:
    ItemNo }      UOM   }     Standard cost
    ABC     }      P5      }            30
    Cube B data:
    ItemNo }      UOM        }     Standard cost
    ABC     }      EACH      }            5  (30/5)
    In transformation rule, I plan to use ABAP routine to calculate each record to new Stand cost if Cube A has different UOM than Cube B.
    Can I call a program in this ABAP routine?
    In ABAP routine, how can I delare other source table and fields?
    Thanks for you help!

    The preferable method, if you're on BI 7 or later, is to create a filter in the DTP so that the records where 0CLR_DOC_NO is blank aren't even passed into the Transformation.
    If not, then you can add the following code into the Start Routine of your Transformation.
    DELETE
      source_package
    WHERE
      clr_doc_no EQ ' '.

  • 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

Maybe you are looking for

  • Dual ISP on ASA VPN question.

    Hi all. My question is very simple is there any way or feature that could allow us to have a backup VPN tunnel on at the secondary ISP at the asa 5520? Lets assume if the primary isp goes down is there any way for  the VPN tunnel come online at the b

  • Cannot view featured apps in store

    I upgraded to IOS 5 on day one and it has been working fine. Today I was browsing the app store and was on the featured app page. I clicked on Real Racing 2 by mistake.. I already have this game. Now I'm stuck with Real Racing 2 under the Featured ta

  • Mobile Design in Business Catalyst

    Is there any tutorials and/or videos that teaches us how to make a mobile version of a business catalyst site??

  • Free run timecode - batch capturing

    Hi, In FCP I'm trying to capture a whole tape shot with free run timecode and several breaks. I've set On timecode break to 'make a new clip' in preferences/general. When I click 'capture now' it captures the first clip then goes into an eternal loop

  • Export .dv files in 16x9? can't seem to do it

    I'm using iMovie HD still (I hated the new version that came with my new imac). When exporting a .dv file for upload to youtube (so as not to have any loss) it keeps coming out squashed into a 4:3 aspect ratio. If I export (share) in the lesser forma