码迷,mamicode.com
首页 > 其他好文 > 详细

FPM十:FORM Repeater

时间:2019-09-24 12:10:44      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:txt   line   desc   ping   img   demo   输入   loop   style   

1.创建feeder class:ZCL_FPM_FORM_REP_DEMO

添加接口类:

技术图片

 

 2.新建全局内表:

技术图片

DATA:GT_QPGT TYPE TABLE OF QPGT.

3.实列化get_data方法:

  METHOD if_fpm_guibb_form_repeater~get_data.
    CASE io_event->mv_event_id.
      WHEN FPM_START.
        SELECT * FROM qpgt INTO TABLE gt_qpgt WHERE SPRACHE = E AND KATALOGART BETWEEN Z1 AND Z5.
        ct_data = gt_qpgt.
        ev_data_changed = abap_true.
      WHEN OTHERS.
    ENDCASE.
  ENDMETHOD.

实例化get_definition方法:这里做分组定义

  METHOD if_fpm_guibb_form_repeater~get_definition.
    DATA: lr_struc  TYPE REF TO  cl_abap_structdescr,
          gt_fields TYPE         ddfields,
          gw_fields TYPE         dfies.
    FIELD-SYMBOLS:<fs_field_descr> TYPE fpmgb_s_formrepfield_descr.

    eo_field_catalog ?=  cl_abap_tabledescr=>describe_by_name( ZQPGT ).
    lr_struc    ?=  eo_field_catalog->get_table_line_type( ).
    gt_fields = lr_struc->get_ddic_field_list( p_including_substructres = abap_true ).

    LOOP AT gt_fields INTO gw_fields.
      APPEND INITIAL LINE TO et_field_description ASSIGNING <fs_field_descr>.
      <fs_field_descr>-name = gw_fields-fieldname.
      CASE <fs_field_descr>-name.
        WHEN KATALOGART."这是个二级目录表,这里以第一级目录作为分组节点
          <fs_field_descr>-allow_grouping = abap_true.
          SELECT
            katalogart AS value
            katalogtxt AS text
            FROM tq15t INTO CORRESPONDING FIELDS OF TABLE <fs_field_descr>-fixed_values WHERE sprache = E.
      ENDCASE.
    ENDLOOP.
  ENDMETHOD.

4.FPM_WB新建新的OVP程序:

技术图片

5保存,激活。编辑配置:

技术图片

6.添加UIBB对象:

技术图片

7.添加UIBB配置对象,点击UIBB配置:

技术图片

8。输入FEEDER类,配置UIBB

技术图片

 

9.添加字段:

技术图片

技术图片

 

 

10.运行:

技术图片

 

 

FPM十:FORM Repeater

标签:txt   line   desc   ping   img   demo   输入   loop   style   

原文地址:https://www.cnblogs.com/sapSB/p/11577293.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!