• FPM十一:点击POPUP显示明细


    沿接着前面的Search和List。在LIST中点击一列,弹出窗口显示明细。

    1.list中定义事件:

      METHOD if_fpm_guibb_list~get_definition.
        DATA:gt_table TYPE TABLE OF zcrmjp003.
        DATA:gw_field  TYPE fpmgb_s_listfield_descr,
             gt_value  TYPE wdr_context_attr_value_list,
             gt_dd03l  TYPE TABLE OF dd03l,
             gw_dd03l  LIKE LINE OF gt_dd03l,
             gw_action TYPE fpmgb_s_actiondef.
        eo_field_catalog ?= cl_abap_tabledescr=>describe_by_data( gt_table ).
    
        mo_catalog ?= cl_abap_structdescr=>describe_by_name( 'ZCRMJP002' ).
    
    
        SELECT * INTO TABLE gt_dd03l FROM dd03l WHERE tabname = 'ZCRMJP003' AND inttype = 'C'.
        LOOP AT gt_dd03l INTO gw_dd03l.
          gw_field-name = gw_dd03l-fieldname.
          gw_field-allow_sort = 'X'.
          gw_field-allow_filter = 'X'.
          APPEND gw_field TO et_field_description.
        ENDLOOP.
    
        gw_action-id = 'ZFPM_LINK'.
        gw_action-enabled = 'X'.
        gw_action-visible = 'X'.
        APPEND GW_ACTION TO ET_ACTION_DEFINITION.
    
        gw_action-id = 'ZPOPUP'.
        gw_action-enabled = 'X'.
        gw_action-visible = 'X'.
        APPEND GW_ACTION TO ET_ACTION_DEFINITION.
      ENDMETHOD.

    注*:上面的ZPOPUP是弹窗。

    2.list中设置事件响应,并将数据带出。

    IF io_event->mv_event_id = 'ZPOPUP'.
          "取当前FPM对象实例
          lr_fpm = cl_fpm_factory=>get_instance( ).
          CREATE OBJECT lr_event_data.
          READ TABLE gt_result INTO ls_result INDEX iv_event_index.
          CHECK sy-subrc = 0.
          lr_event_data->if_fpm_parameter~set_value(
              iv_key   = 'DETAIL'
              iv_value = ls_result ).
    
          lr_fpm->open_dialog_box(
              iv_dialog_box_id         = 'PAGE_3'
              io_event_data            = lr_event_data
                 ).
    
    
        ENDIF.

    注*:上面的PAGE_3对于VOP里的POPUP也编号,前面已经使用了两个,这个默认用PAGE_3.

    3.1新建FORM的Feeder class。

    3.2给弹出定义字段目录:

      METHOD if_fpm_guibb_form~get_definition.
        eo_field_catalog ?= cl_abap_structdescr=>describe_by_name( 'ZCRMJP003' ).
      ENDMETHOD.

    3.3给弹出定义全局接收工作区属性

     3.4 给弹出做数据接受

      METHOD if_fpm_guibb_form~get_data.
        io_event->mo_event_data->get_value( EXPORTING iv_key = 'DETAIL'
                                            IMPORTING ev_value = gw_result ).
        cs_data = gw_result.
        ev_data_changed = 'X'.
        ev_field_usage_changed = 'X'.
      ENDMETHOD.

    4.1页面配置,给LIST中字段改成LInk并分配事件

     4.2 返回OVP界面,新建PAGE.

    4.3分配FORM,并配置

     

    测试效果:

  • 相关阅读:
    Java-16 常用包装类
    Java-15 String类
    flask实现web端微信登录
    Flask-excel导出数据
    Java-14 单例模式
    Java-13 接口
    Java-12 抽象类
    结对项目:一个自动生成小学四则运算题目的命令行程序(c++)
    软工作业:第一次个人项目作业
    操作系统笔记一:操作系统引论
  • 原文地址:https://www.cnblogs.com/sapSB/p/12011553.html
Copyright © 2020-2023  润新知