FPM八:FPM TREE

Posted sapsb

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了FPM八:FPM TREE相关的知识,希望对你有一定的参考价值。

先上效果图:

技术图片

 

 

1,新建类:ZCL_FPM_TREE,并添加接口:IF_FPM_GUIBB,IF_FPM_GUIBB_TREE。激活所有方法

2.定义tree结构,在class的public section里添加:

  types:
    "add by ly 20190919 for data structure
    BEGIN OF ty_tree.
            INCLUDE TYPE fpmgb_s_tree_master_column.
    TYPES:
      land1 TYPE land1,
      landx TYPE landx,
      bland TYPE regio,
      bezei TYPE bezei,
      END OF ty_tree .

  data GT_TREE type TABLE OF TY_TREE .
  data GW_TREE TYPE TY_TREE .

3.定义TREE字段目录:在方法GET_DEFINITION中:

  METHOD if_fpm_guibb_tree~get_definition.
    DATA:ls_field TYPE fpmgb_s_treefield_descr.
    eo_field_catalog ?= cl_abap_tabledescr=>describe_by_data( gt_tree ).

    "tree
    ls_field-name = PARENT_KEY.
    ls_field-column_type = if_fpm_guibb_constants=>gc_guibb_tree_columns-parent_key.
    APPEND ls_field TO et_field_description.

    ls_field-name = ROW_KEY.
    ls_field-column_type = if_fpm_guibb_constants=>gc_guibb_tree_columns-row_key.
    APPEND ls_field TO et_field_description.

    ls_field-name = EXPANDED.
    ls_field-column_type = if_fpm_guibb_constants=>gc_guibb_tree_columns-expanded.
    APPEND ls_field TO et_field_description.

    ls_field-name = IS_LEAF.
    ls_field-column_type = if_fpm_guibb_constants=>gc_guibb_tree_columns-is_leaf.
    APPEND ls_field TO et_field_description.

    ls_field-name = TEXT.
    ls_field-column_type = if_fpm_guibb_constants=>gc_guibb_tree_columns-text.
    APPEND ls_field TO et_field_description.

    ls_field-name = CHILDREN_LOADED.
    ls_field-column_type = if_fpm_guibb_constants=>gc_guibb_tree_columns-child_load.
    APPEND ls_field TO et_field_description.

    ls_field-name = IMAGE_SRC.
    ls_field-column_type = if_fpm_guibb_constants=>gc_guibb_tree_columns-img_src.
    APPEND ls_field TO et_field_description.

  ENDMETHOD.

4.在GET_DATA中添加初始化tree结构的内表代码:

  METHOD if_fpm_guibb_tree~get_data.
    DATA:gt_t005t TYPE TABLE OF t005t,
         gw_t005t LIKE LINE OF gt_t005t,
         gt_t005u TYPE TABLE OF t005u,
         gw_t005u LIKE LINE OF gt_t005u.
    IF io_event->mv_event_id = FPM_START.
      SELECT * INTO TABLE gt_t005t FROM t005t WHERE spras = E.
      SELECT * INTO TABLE gt_t005u FROM t005u WHERE spras = E.

      LOOP AT gt_t005t INTO gw_t005t.
        MOVE-CORRESPONDING gw_t005t TO gw_tree.
        gw_tree-row_key = gw_t005t-land1.
        gw_tree-is_leaf = abap_false.
        gw_tree-expanded = abap_false.
        gw_tree-text = gw_t005t-landx.
        APPEND gw_tree TO gt_tree.

      ENDLOOP.

      LOOP AT gt_t005u INTO gw_t005u.
          CLEAR:gw_tree.
          MOVE-CORRESPONDING gw_t005u TO gw_tree.
          gw_tree-row_key = gw_t005u-bland.
          gw_tree-is_leaf = abap_true.
          gw_tree-parent_key = gw_t005u-land1.
          gw_tree-text = gw_t005u-bezei.
          APPEND gw_tree TO gt_tree.
        ENDLOOP.

      ct_data = gt_tree.
      ev_data_changed = X.
    ENDIF.
  ENDMETHOD.

5.打开FPM工作台,点击新建空的FPM程序:

技术图片

6.输入程序名称,选择VOP类型,选择本地包,保存。

技术图片

7.保存之后会出现两个链接的页面,选择编辑配置:

技术图片

8.输入配置描述,进入配置主界面,在UIBB中选择添加TREE类型UIBB。

技术图片

9.输入一个配置编号,回车,然后选择当前行,点击配置UIBB。

技术图片

10.在新开的配置页面中,输入描述,保存。这时候会进入配置UIBB页面,提示输入FEEDER CLASS,输入上面上面创建的类。

技术图片

技术图片

11.在配置列里添加需要展示的字段。保存,测试即可。

技术图片

以上是关于FPM八:FPM TREE的主要内容,如果未能解决你的问题,请参考以下文章

51.php-fpm的poolphp-fpm慢执行日志open_basedirphp-fpm进程

五十php-fpm的poolphp-fpm慢执行日志open_basedirphp-fpm

fpm-cookery fpm 的包装工具

php-fpm的poolphp-fpm慢执行日志open_basedirphp-fpm进程管理

对FPM 模块进行参数优化!

liunx php-fpm