Skip to Content
0
Former Member
Aug 29, 2011 at 11:02 AM

DTP - Filter Routine Result not appearing in Monitor under Selections

484 Views

Hi Folks,

I got a routine on a cal week field in a DTP with bellow code.

However, the CALWEEK filter is not appearing in the DTP monitor under selections along with the "fix" filters of the DTP. Also the test case showed that the filter is not used.

What I am doing wrong? Can I debug the DTP routine somehow? Must the filter be listed in the selection section of the DTP monitor header?

I have the same code on an infopackage filter -> only difference is that it does a modify l_t_range right away. There it is working as expected.

Thanks for all replies in advance.

Best regards,

Axel

-


* -------------------------------------------------------------------
*     Fieldname       = CALWEEK
*     data type       = NUMC
*     length          = 000006
* -------------------------------------------------------------------
form compute_CALWEEK
  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,
      i_offset type int2,
      l_from_calweek type /BI0/OICALWEEK,
      l_to_calweek type /BI0/OICALWEEK.

read table l_t_range with key
               fieldname = 'CALWEEK'.
          l_idx = sy-tabix.

tables: ztvarv.
* Read the horizon from the parameter table
SELECT SINGLE *
            FROM ztvarv
          WHERE name = 'OFFSET'.

i_offset = ztvarv.
CALL FUNCTION 'Z_ADD_SUBTRACT_TO_CALWEEK'
  EXPORTING
    I_DATE_FOR            = sy-datum
    REPUBLISH             = 00
    ZOFFSET               = i_offset
 IMPORTING
   I_FROM_WEEK           = l_from_calweek
   I_TO_WEEK             = l_to_calweek
 EXCEPTIONS
   DATE_INVALID          = 1
   WEEK_INVALID          = 2
   VERSION_INVALID       = 3
   OTHERS                = 4
          .
IF SY-SUBRC <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

l_t_range-sign   = 'I'.
l_t_range-option = 'BT'.
* Need to be this way as the to week is the calculated one
l_t_range-low    = l_to_calweek.
l_t_range-high   = l_from_calweek.


          if l_idx <> 0.
            modify l_t_range index l_idx.
          else.
            append l_t_range.
          endif.
          p_subrc = 0.

-