• sap自定义搜索帮助


      要实现如下一个功能,在选择屏幕中,“订单类型”要来自 likp 的 lfart 字段和 vbak 的 auart 的内容。

    *交货类型搜索帮助
    DATABEGIN OF gwa_sorthelp OCCURS 0,
            sorthelp LIKE likp-lfart,
          END OF gwa_sorthelp.

    DATA: gt_sorthelp LIKE TABLE OF gwa_sorthelp .

    DATA: igt_sorthelp LIKE gwa_sorthelp OCCURS 0,
          iwa_sorthelp LIKE gwa_sorthelp.

    DATABEGIN OF gwa_vbaksorthelp OCCURS 0,
            sorthelp LIKE vbak-auart,
          END OF gwa_vbaksorthelp.

    DATA:gt_vbaksorthelp LIKE TABLE OF gwa_vbaksorthelp .

    DATA: igt_vbaksorthelp LIKE gwa_vbaksorthelp OCCURS 0,
          iwa_vbaksorthelp LIKE gwa_vbaksorthelp.

    *选择屏幕定义

     PARAMETERS: sorthelp LIKE gwa_sorthelp-sorthelp.

    *点击事件

     AT SELECTION-SCREEN ON VALUE-REQUEST FOR sorthelp.
      PERFORM frm_get_sorthelp.

    *实现搜索帮助

     FORM   frm_get_sorthelp.
    *查询数据
      SELECT lfart INTO TABLE  gt_sorthelp FROM likp.


      SELECT auart INTO TABLE gt_vbaksorthelp FROM vbak.
    *格式化数据
      LOOP AT gt_sorthelp INTO gwa_sorthelp.
        CLEAR iwa_sorthelp.
        iwa_sorthelp-sorthelp = gwa_sorthelp-sorthelp.
        COLLECT iwa_sorthelp INTO igt_sorthelp.
      ENDLOOP.

      LOOP AT gt_vbaksorthelp INTO gwa_vbaksorthelp.
        CLEAR iwa_vbaksorthelp.
        iwa_vbaksorthelp-sorthelp = gwa_vbaksorthelp-sorthelp.
        COLLECT iwa_vbaksorthelp INTO igt_vbaksorthelp.
      ENDLOOP.

      LOOP AT igt_vbaksorthelp INTO iwa_vbaksorthelp.

        iwa_sorthelp-sorthelp = iwa_vbaksorthelp-sorthelp.

        APPEND iwa_sorthelp TO igt_sorthelp.

      ENDLOOP.

    *弹出选择框
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          dynpprog        = 'ZGNSDR007'
          retfield        = 'SORTHELP'     "预选值要填入的字段名
          dynpnr          = sy-dynnr
          dynprofield     = 'SORTHELP'  " 此屏幕字段参数
          value_org       = 'S'
        TABLES
          value_tab       = igt_sorthelp[]    " 存放预选值清单的内表
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
    ENDFORM.  

  • 相关阅读:
    凸优化之基追踪
    [转]广义正交匹配追踪(gOMP)
    SAMP论文学习
    sublime学习笔记
    IEEE Trans 2009 Stagewise Weak Gradient Pursuits论文学习
    [转]压缩感知重构算法之分段正交匹配追踪(StOMP)
    IEEE Trans 2008 Gradient Pursuits论文学习
    Git学习笔记
    树状数组【bzoj1103】: [POI2007]大都市meg
    模拟赛 10-25上午考试记
  • 原文地址:https://www.cnblogs.com/szfeng/p/2270047.html
Copyright © 2020-2023  润新知