COOIS 生产订单显示系统增强

需求说明:订单系统显示页面新增批量打印功能

增强点:CL_COIS_DISP_LIST_NAVIGATION -->TOOLBAR方法中新增隐式增强添加自定义打印按钮

增强点:BADI-->WORKORDER_INFOSYSTEM新增增强实施

实现位置:IF_EX_WORKORDER_INFOSYSTEM~AT_OUTPUT_SCREEN_LAY

java 复制代码
 METHOD if_ex_workorder_infosystem~at_output_screen_lay.
    DATA lv_space TYPE char10.
    DATA lt_ioheader TYPE STANDARD TABLE OF ioheader WITH DEFAULT KEY.
    DATA lt_iooper TYPE STANDARD TABLE OF iooper WITH DEFAULT KEY.
    DATA lt_prd_data TYPE STANDARD TABLE OF ioheader WITH DEFAULT KEY.
    DATA lt_coois_prdlist TYPE STANDARD TABLE OF zspp_coois_prdlist WITH DEFAULT KEY.
    DATA lo_logger TYPE REF TO if_salv_logger.
    DATA lv_worktime(16) TYPE p DECIMALS 1.
    DATA(lo_salv) = NEW cl_salv_gui_grid_facade(  o_grid = io_alv_grid o_logger = lo_logger ).
    FIELD-SYMBOLS:<ft_data>  TYPE table.

    IF  cv_ucomm EQ 'BPRINT' AND iv_after_ucomm EQ 'X'.
      " IMPORT lt_ioheader = lt_ioheader FROM MEMORY  ID 'COOIS_ALV_OUTPUT'.
      "IMPORT ioheader_tab = lt_ioheader FROM MEMORY  ID 'IOA05'.
      DATA(lt_data) = lo_salv->if_salv_gui_grid_data_source~get_r_appl_data( ).
      ASSIGN lt_data->* TO <ft_data>.
      MOVE-CORRESPONDING <ft_data> TO lt_ioheader.

      io_alv_grid->get_selected_rows( IMPORTING et_index_rows = DATA(lt_index_rows) et_row_no = DATA(lt_row_no) ).
      DESCRIBE TABLE lt_index_rows LINES DATA(lv_lines).
      IF lv_lines EQ 0.
        MESSAGE '请至少选择一条需要打印的订单'(001) TYPE 'S' DISPLAY LIKE 'E'.
      ELSE.
        LOOP AT lt_index_rows INTO DATA(ls_row)..
          READ TABLE lt_ioheader INTO DATA(ls_ioheader) INDEX ls_row-index.
          IF sy-subrc EQ 0.
            APPEND ls_ioheader TO lt_prd_data.
          ENDIF.

          CLEAR ls_ioheader.
        ENDLOOP.
        SELECT DISTINCT afko~aufnr,afvc~steus, afpo~matnr,afko~gamng, afko~gmein,
                        afvc~vornr, afvc~ltxa1,crhd~arbpl,afvv~vgw01,afvv~vge01,
                        aufk~zzfitter,
               CASE afvc~steus
                  WHEN 'ZN04' THEN afvc~ltxa1
                  ELSE makt~maktx
               END AS maktx
          FROM afko AS afko
          INNER JOIN afpo AS afpo ON afko~aufnr = afpo~aufnr
          INNER JOIN @lt_prd_data AS prd ON afko~aufnr = prd~aufnr
          LEFT JOIN aufk AS aufk ON afko~aufnr = aufk~aufnr
          LEFT JOIN makt AS makt ON afpo~matnr = makt~matnr AND spras = @sy-langu
          LEFT JOIN afvc AS afvc ON afko~aufpl = afvc~aufpl
          LEFT JOIN afvv AS afvv ON afvc~aufpl = afvv~aufpl AND afvc~aplzl = afvv~aplzl
          LEFT JOIN crhd AS crhd ON afvc~arbid = crhd~objid AND crhd~objty = 'A'
          INTO CORRESPONDING FIELDS OF TABLE @lt_coois_prdlist.

        LOOP AT lt_coois_prdlist ASSIGNING FIELD-SYMBOL(<fs_prd>).
          lv_worktime = <fs_prd>-vgw01.
          <fs_prd>-matnr = COND #( WHEN <fs_prd>-steus EQ 'ZN04' THEN '' ELSE <fs_prd>-matnr ).
          <fs_prd>-printdate = |{ sy-datum DATE = ISO }|.
          <fs_prd>-quantity = |{ <fs_prd>-gamng } { <fs_prd>-gmein }|.
          <fs_prd>-worktime = |{ lv_worktime } { <fs_prd>-vge01 }|.
          <fs_prd>-vornr_int = <fs_prd>-vornr.
          <fs_prd>-vornr =  <fs_prd>-vornr_int.
          CLEAR lv_worktime.
        ENDLOOP.
        SORT lt_coois_prdlist BY aufnr vornr_int.

        CALL FUNCTION 'ZPP_COOIS_BATCHPRINT'
          EXPORTING
            it_prdinf = lt_coois_prdlist.

      ENDIF.
      " ENDIF.

    ENDIF.

报表显示修改在 IF_EX_WORKORDER_INFOSYSTEM~TABLES_MODIFY_LAYTABLES_MODIFY_LAY方法中实现

相关推荐
炸鸡配泡面1 小时前
Qt 12.28 day3
java·开发语言
get_money_2 小时前
代码随想录Day37 动态规划:完全背包理论基础,518.零钱兑换II,本周小结动态规划,377. 组合总和 Ⅳ,70. 爬楼梯(进阶版)。
java·笔记·算法·动态规划
get_money_2 小时前
代码随想录38 322. 零钱兑换,279.完全平方数,本周小结动态规划,139.单词拆分,动态规划:关于多重背包,你该了解这些!背包问题总结篇。
java·开发语言·笔记·算法·动态规划
蜗牛快跑2132 小时前
前端正在被“锈”化
前端·代码规范
憶巷3 小时前
设计模式的分类及作用
java·设计模式
向宇it4 小时前
【从零开始入门unity游戏开发之——C#篇36】C#的out协变和in逆变如何解决泛型委托的类型转换问题
java·开发语言·unity·c#·游戏引擎
天空之外1364 小时前
Spring Boot Actuator、Spring Boot Actuator使用、Spring Boot Actuator 监控、Spring程序监控
java·spring boot·spring
baihb10244 小时前
Docker 默认安装位置迁移
java·docker
Jet_closer_burning4 小时前
微信小程序中遇到过的问题
前端·微信小程序·小程序
B1nnnn丶4 小时前
通用导出任何对象列表数据的excel工具类
java·spring boot·excel