当前位置:   article > 正文

COOIS 生产订单显示系统增强

COOIS 生产订单显示系统增强

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

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

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

实现位置:IF_EX_WORKORDER_INFOSYSTEM~AT_OUTPUT_SCREEN_LAY

  1. METHOD if_ex_workorder_infosystem~at_output_screen_lay.
  2. DATA lv_space TYPE char10.
  3. DATA lt_ioheader TYPE STANDARD TABLE OF ioheader WITH DEFAULT KEY.
  4. DATA lt_iooper TYPE STANDARD TABLE OF iooper WITH DEFAULT KEY.
  5. DATA lt_prd_data TYPE STANDARD TABLE OF ioheader WITH DEFAULT KEY.
  6. DATA lt_coois_prdlist TYPE STANDARD TABLE OF zspp_coois_prdlist WITH DEFAULT KEY.
  7. DATA lo_logger TYPE REF TO if_salv_logger.
  8. DATA lv_worktime(16) TYPE p DECIMALS 1.
  9. DATA(lo_salv) = NEW cl_salv_gui_grid_facade( o_grid = io_alv_grid o_logger = lo_logger ).
  10. FIELD-SYMBOLS:<ft_data> TYPE table.
  11. IF cv_ucomm EQ 'BPRINT' AND iv_after_ucomm EQ 'X'.
  12. " IMPORT lt_ioheader = lt_ioheader FROM MEMORY ID 'COOIS_ALV_OUTPUT'.
  13. "IMPORT ioheader_tab = lt_ioheader FROM MEMORY ID 'IOA05'.
  14. DATA(lt_data) = lo_salv->if_salv_gui_grid_data_source~get_r_appl_data( ).
  15. ASSIGN lt_data->* TO <ft_data>.
  16. MOVE-CORRESPONDING <ft_data> TO lt_ioheader.
  17. io_alv_grid->get_selected_rows( IMPORTING et_index_rows = DATA(lt_index_rows) et_row_no = DATA(lt_row_no) ).
  18. DESCRIBE TABLE lt_index_rows LINES DATA(lv_lines).
  19. IF lv_lines EQ 0.
  20. MESSAGE '请至少选择一条需要打印的订单'(001) TYPE 'S' DISPLAY LIKE 'E'.
  21. ELSE.
  22. LOOP AT lt_index_rows INTO DATA(ls_row)..
  23. READ TABLE lt_ioheader INTO DATA(ls_ioheader) INDEX ls_row-index.
  24. IF sy-subrc EQ 0.
  25. APPEND ls_ioheader TO lt_prd_data.
  26. ENDIF.
  27. CLEAR ls_ioheader.
  28. ENDLOOP.
  29. SELECT DISTINCT afko~aufnr,afvc~steus, afpo~matnr,afko~gamng, afko~gmein,
  30. afvc~vornr, afvc~ltxa1,crhd~arbpl,afvv~vgw01,afvv~vge01,
  31. aufk~zzfitter,
  32. CASE afvc~steus
  33. WHEN 'ZN04' THEN afvc~ltxa1
  34. ELSE makt~maktx
  35. END AS maktx
  36. FROM afko AS afko
  37. INNER JOIN afpo AS afpo ON afko~aufnr = afpo~aufnr
  38. INNER JOIN @lt_prd_data AS prd ON afko~aufnr = prd~aufnr
  39. LEFT JOIN aufk AS aufk ON afko~aufnr = aufk~aufnr
  40. LEFT JOIN makt AS makt ON afpo~matnr = makt~matnr AND spras = @sy-langu
  41. LEFT JOIN afvc AS afvc ON afko~aufpl = afvc~aufpl
  42. LEFT JOIN afvv AS afvv ON afvc~aufpl = afvv~aufpl AND afvc~aplzl = afvv~aplzl
  43. LEFT JOIN crhd AS crhd ON afvc~arbid = crhd~objid AND crhd~objty = 'A'
  44. INTO CORRESPONDING FIELDS OF TABLE @lt_coois_prdlist.
  45. LOOP AT lt_coois_prdlist ASSIGNING FIELD-SYMBOL(<fs_prd>).
  46. lv_worktime = <fs_prd>-vgw01.
  47. <fs_prd>-matnr = COND #( WHEN <fs_prd>-steus EQ 'ZN04' THEN '' ELSE <fs_prd>-matnr ).
  48. <fs_prd>-printdate = |{ sy-datum DATE = ISO }|.
  49. <fs_prd>-quantity = |{ <fs_prd>-gamng } { <fs_prd>-gmein }|.
  50. <fs_prd>-worktime = |{ lv_worktime } { <fs_prd>-vge01 }|.
  51. <fs_prd>-vornr_int = <fs_prd>-vornr.
  52. <fs_prd>-vornr = <fs_prd>-vornr_int.
  53. CLEAR lv_worktime.
  54. ENDLOOP.
  55. SORT lt_coois_prdlist BY aufnr vornr_int.
  56. CALL FUNCTION 'ZPP_COOIS_BATCHPRINT'
  57. EXPORTING
  58. it_prdinf = lt_coois_prdlist.
  59. ENDIF.
  60. " ENDIF.
  61. ENDIF.

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/522610
推荐阅读
相关标签
  

闽ICP备14008679号