cancel
Showing results for 
Search instead for 
Did you mean: 

reading filter values from dtp in routine of transformation

Former Member
0 Kudos
3,761

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Please go through this blog...

/people/shlomi.weiss2/blog/2010/11/10/how-to-get-selection-criteria-in-transformations-routines

It States

The information is not available during simulation!

During simulation the system creates a DTP_SIMULATION that does not hold that information.

rgds, Ghuru

Former Member
0 Kudos

thanks for this useful hint! i tried to simulate it

but even if I really execute dtp it does not work - I cannot see any date in my dso...

do you see some error in my coding?

Former Member
0 Kudos

Use the below code..


    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( ).

read table t_filter_values into l_filter_values with key
FIELDNM = '<INFOOBJECT TECHNICAL NAME>'.

IF SY-SUBRC = 0.

  RESULT = l_filter_values-LOW.

ENDIF.

i tested it from my end and it works perfectly...just change the <INFOOBJECT TECHNICAL NAME> to your corresponding infoobject which you have restricted in DTP....

rgds, Ghuru

Former Member

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

Answers (0)