DTP Filter

来源:互联网 发布:电脑管理软件 知乎 编辑:程序博客网 时间:2024/05/17 02:03

*&---------------------------------------------------------------------*
*&  Include           RSBC_SEL_ROUTINE_TPL
*&---------------------------------------------------------------------*

program conversion_routine.
* Type pools used by conversion program
type-poolsrsarcrsarrrssm.
tablesrssdlrange.
* Global code used by conversion rules
*$*$ begin of global - insert your declaration only below this line  *-*
* TABLES: ...
* DATA:   ...
typesBEGIN OF s_vendor,
         vendor TYPE /BI0/OIVENDOR,
       END OF s_vendor.

datat_vendor TYPE STANDARD TABLE OF s_vendor,
      wa_vendor TYPE s_vendor.
*$*$ end of global - insert your declaration only before this line   *-*
* -------------------------------------------------------------------
*     Fieldname       = VENDOR
*     data type       = CHAR
*     length          = 000010
* -------------------------------------------------------------------
form c_VENDOR
  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        *-*
datal_idx like sy-tabix.
*         read table l_t_range with key  fieldname = ' '.
*         l_idx = sy-tabix.
*....
select DISTINCT vendor FROM ZREGULARVENDORCH
                      INTO TABLE t_vendor
                      WHERE vendor <> ''.

if t_vendor[] is not initial.
  LOOP AT t_vendor into wa_vendor.
     l_idx sy-tabix.
     if l_idx < 5000.
       read table l_t_range with key fieldname 'vendor'.
       move'I'              to l_t_range-sign,
             'EQ'             to l_t_range-option,
             'VENDOR'         to l_t_range-fieldname,
             wa_vendor-vendor to l_t_range-low.
        append l_t_range.
      endif.
  ENDLOOP.
else.
  wa_vendor-vendor 'no_vendor'.
  move:    'I'              to l_t_range-sign,
           'EQ'             to l_t_range-option,
           'VENDOR'         to l_t_range-fieldname,
           wa_vendor-vendor to l_t_range-low.
  append l_t_range.
endif.


*          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.
原创粉丝点击