生产订单修改记录报表

news/2024/11/15 9:13:30/文章来源:https://www.cnblogs.com/BinGeneral/p/18492970

1、写在前面

生产订单修改记录报表对于项目上并不陌生。通常会在增强中编写逻辑来判断生产订单主要信息是否有变更,有则保存到日志表,并通过查询报表展示,帮助用户查看生产订单发生的修改。

本文档的代码,只是对现有逻辑的一些优化,通过配置表的方式,设置监控字段,灵活监控生产订单这些字段的变更,也方便迁移到其他项目使用。

利弊不谈,只是换个思路解决问题,感兴趣的读者可以试一下,也一起测试一下是否有隐藏的BUG。

如果仅仅实施一次,也不需要像本文档这么复杂,直接在增强中写死需要监控的字段就可以了。

2、实施过程

2.1、实施保存增强

CMOD实施订单保存增强

保存时调用日志记录函数

2.2、自建表

创建监控字段配置表,配置需要监控的生产订单字段

其中“表名”和“删除标识”是自定义的域

维护上对应结构的字段,可以根据“表名”字段的搜索帮助找到对应字段。例如找到抬头对应的结构为CAUFVDB,可从CAUFVDB结构中找到要监控的抬头字段,工艺、组件同理。

创建更改日志表,用于存放更改的记录

增强中的函数ZPP_CO02_LOG则根据配置表维护的数据,监控对应的数据改变,并保存到日志表中。

创建查询报表将日志表中的数据进行展示,效果如下

3、参考代码

3.1、增强函数

FUNCTION zpp_co02_log.
*"----------------------------------------------------------------------
*"*"本地接口:
*"  TABLES
*"      HEADER_TABLE STRUCTURE  CAUFVDB
*"      HEADER_TABLE_OLD STRUCTURE  CAUFVDB
*"      POSITION_TABLE STRUCTURE  AFPOB
*"      POSITION_TABLE_OLD STRUCTURE  AAFPO
*"      SEQUENCE_TABLE STRUCTURE  AFFLB
*"      SEQUENCE_TABLE_OLD STRUCTURE  AAFFL
*"      OPERATION_TABLE STRUCTURE  AFVGB
*"      OPERATION_TABLE_OLD_AFVC STRUCTURE  AAFVC
*"      OPERATION_TABLE_OLD_AFVV STRUCTURE  AAFVV
*"      COMPONENT_TABLE STRUCTURE  RESBB
*"      COMPONENT_TABLE_OLD STRUCTURE  ARESB
*"      RELATION_TABLE STRUCTURE  AFABB OPTIONAL
*"      RELATION_TABLE_OLD STRUCTURE  AAFAB OPTIONAL
*"      PSTEXT_TABLE STRUCTURE  NPTXB OPTIONAL
*"      PSTEXT_TABLE_OLD STRUCTURE  ANPTX OPTIONAL
*"      MILESTONE_TABLE STRUCTURE  MLSTB OPTIONAL
*"      MILESTONE_TABLE_OLD STRUCTURE  AMLST OPTIONAL
*"      PLANNED_ORDER_TABLE STRUCTURE  PLAF
*"      STATUS_TABLE STRUCTURE  JEST
*"      STATUS_TABLE_OLD STRUCTURE  JEST
*"      OPERATION_RELATIONS STRUCTURE  PRE_DEC
*"      OPERATION_RELATIONS_OLD STRUCTURE  PRE_DEC
*"      OPERATION_TABLE_OLD_AFVU STRUCTURE  AAFVU
*"      DOCLINK_TABLE STRUCTURE  AFDLD
*"      DOCLINK_TABLE_OLD STRUCTURE  AFDLD
*"----------------------------------------------------------------------CHECK sy-tcode = 'CO02'.CONSTANTS:c_h TYPE string VALUE '抬头'.CONSTANTS:c_r TYPE string VALUE '工艺'.CONSTANTS:c_c TYPE string VALUE '组件'.CONSTANTS:c_s TYPE string VALUE '订单状态'.DATA:lt_log      TYPE TABLE OF zppt_gdbg_log,ls_log      TYPE zppt_gdbg_log,ls_log_temp TYPE zppt_gdbg_log.DATA:lv_tname     TYPE zppt_gdbg_zd-tabname,lv_tname_old TYPE zppt_gdbg_zd-tabname."IP和HOSTDATA: lv_iporg TYPE msxxlist-hostadr,lv_ipdec TYPE char16,lv_host  TYPE char18.DATA:lv_arbpl     TYPE arbpl,lv_arbpl_old TYPE arbpl.DATA:lv_delete TYPE c,lv_seq    TYPE zppt_gdbg_log-seqno.FIELD-SYMBOLS:<fs_field>     TYPE any,<fs_field_old> TYPE any.SELECT SINGLEMAX( seqno )FROM zppt_gdbg_logINTO lv_seqWHERE aufnr = header_table-aufnr."生产订单变更日期监控字段SELECTtabname,"表名fieldname,"字段ddtext"名称FROM zppt_gdbg_zdINTO TABLE @DATA(lt_field).**  Get user IP,hostnameCALL FUNCTION 'TH_USER_INFO'    " Get user IP,hostnameEXPORTINGclient   = sy-mandtuser     = sy-unameIMPORTINGhostaddr = lv_iporgterminal = lv_hostEXCEPTIONSOTHERS   = 1.**"Conv.IP addr to format 'xxx.xxx.xxx.xxx'CALL FUNCTION 'GWY_IPADR2STRING'  "Conv.IP addrEXPORTINGipadr  = lv_iporgIMPORTINGstring = lv_ipdec.READ TABLE header_table INDEX 1.READ TABLE header_table_old INDEX 1.READ TABLE position_table INDEX 1.READ TABLE position_table_old INDEX 1.ls_log_temp-mandt = sy-mandt.ls_log_temp-aenam = sy-uname.ls_log_temp-laeda = sy-datum.ls_log_temp-times = sy-uzeit.ls_log_temp-tcode = sy-tcode.ls_log_temp-host = lv_host.ls_log_temp-ip = lv_ipdec.ls_log_temp-aufnr = header_table-aufnr.*1)生产订单抬头更改记录字段LOOP AT lt_field INTO DATA(ls_field) WHERE tabname = 'HEAD'.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE header_table TO <fs_field>.IF sy-subrc EQ 0.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE header_table_old TO <fs_field_old>.IF sy-subrc EQ 0 AND <fs_field> <> <fs_field_old>.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_h.ls_log-chnid = 'U'.ls_log-field = ls_field-ddtext.ls_log-value_old = <fs_field_old>.ls_log-value_new = <fs_field>.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ENDIF.CLEAR:ls_field.ENDLOOP.LOOP AT lt_field INTO ls_field WHERE tabname = 'POSI'.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE position_table TO <fs_field>.IF sy-subrc EQ 0.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE position_table_old TO <fs_field_old>.IF sy-subrc EQ 0 AND <fs_field> <> <fs_field_old>.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_h.ls_log-chnid = 'U'.ls_log-field = ls_field-ddtext.ls_log-value_old = <fs_field_old>.ls_log-value_new = <fs_field>.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ENDIF.CLEAR:ls_field.ENDLOOP.*-组件
*2)生产订单组件更改记录字段
*    删除组件时也需要记录以上内容LOOP AT component_table WHERE vbkz EQ 'U'OR vbkz EQ 'I'OR vbkz EQ 'D'.CASE component_table-vbkz.WHEN 'I'.LOOP AT lt_field INTO ls_field WHERE tabname = 'COMP'.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE component_table TO <fs_field>.IF sy-subrc EQ 0 AND <fs_field> IS NOT INITIAL.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_c.ls_log-chnid = 'I'.ls_log-field = ls_field-ddtext.ls_log-matnr = component_table-matnr.ls_log-value_new = <fs_field>.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.CLEAR:ls_field.ENDLOOP.WHEN 'D'.CLEAR component_table_old.READ TABLE component_table_old WITH KEY rsnum = component_table-rsnumrspos = component_table-rspos.LOOP AT lt_field INTO ls_field WHERE tabname = 'COMP'.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE component_table_old TO <fs_field_old>.IF sy-subrc EQ 0 AND <fs_field_old> IS NOT INITIAL.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_c.ls_log-chnid = 'D'.ls_log-field = ls_field-ddtext.ls_log-matnr = component_table_old-matnr.ls_log-value_old = <fs_field_old>.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.CLEAR:ls_field.ENDLOOP.WHEN 'U'.CLEAR component_table_old.READ TABLE component_table_old WITH KEY rsnum = component_table-rsnumrspos = component_table-rspos.LOOP AT lt_field INTO ls_field WHERE tabname = 'COMP'.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE component_table TO <fs_field>.IF sy-subrc EQ 0.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE component_table_old TO <fs_field_old>.IF sy-subrc EQ 0 AND <fs_field> <> <fs_field_old>.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_c.ls_log-chnid = 'U'.ls_log-field = ls_field-ddtext.ls_log-matnr = component_table-matnr.ls_log-value_old = <fs_field_old>.ls_log-value_new = <fs_field>.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ENDIF.CLEAR:ls_field.ENDLOOP.ENDCASE.ENDLOOP.*-工艺路线
*3)生产订单工艺更改记录字段LOOP AT operation_table WHERE vbkz EQ 'U'OR vbkz EQ 'I'OR vbkz EQ 'D'.CASE operation_table-vbkz.WHEN 'I'.LOOP AT lt_field INTO ls_field WHERE tabname = 'OPER'.IF ls_field-fieldname = 'ARBPL'."工作中心CLEAR:lv_arbpl.SELECT SINGLEarbplFROM crhdINTO lv_arbplWHERE objid = operation_table-arbid.IF lv_arbpl IS NOT INITIAL.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_r.ls_log-chnid = 'I'.ls_log-field = '工作中心'.ls_log-vornr = operation_table-vornr.ls_log-value_new = lv_arbpl.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ELSE.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE operation_table TO <fs_field>.IF sy-subrc EQ 0 AND <fs_field> IS NOT INITIAL.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_r.ls_log-chnid = 'I'.ls_log-field = ls_field-ddtext.ls_log-vornr = operation_table-vornr.ls_log-value_new = <fs_field>.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ENDIF.CLEAR:ls_field.ENDLOOP.WHEN 'D'."删除工艺并不会设置为D,要用状态来判断WHEN 'U'."用状态判断工艺是否删除CLEAR lv_delete.READ TABLE status_tableWITH KEY objnr = operation_table-objnrstat = 'I0013'inact = ''.IF sy-subrc = 0.lv_delete = 'X'.ENDIF.CLEAR operation_table_old_afvc.READ TABLE operation_table_old_afvc WITH KEY aufpl = operation_table-aufplaplzl = operation_table-aplzl.CLEAR operation_table_old_afvv.READ TABLE operation_table_old_afvv WITH KEY aufpl = operation_table-aufplaplzl = operation_table-aplzl.CLEAR lv_arbpl.SELECT SINGLEarbplFROM crhdINTO lv_arbplWHERE objid = operation_table-arbid.CLEAR lv_arbpl_old.SELECT SINGLEarbplFROM crhdINTO lv_arbpl_oldWHERE objid = operation_table_old_afvc-arbid.IF lv_delete = 'X'."删除LOOP AT lt_field INTO ls_field WHERE tabname = 'OPER'.IF ls_field-fieldname = 'ARBPL'."工作中心IF lv_arbpl_old IS NOT INITIAL.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_r.ls_log-chnid = 'D'.ls_log-field = '工作中心'.ls_log-vornr = operation_table-vornr.ls_log-value_old = lv_arbpl_old.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ELSE.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE operation_table_old_afvc TO <fs_field_old>.IF sy-subrc NE 0.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE operation_table_old_afvv TO <fs_field_old>.ENDIF.IF sy-subrc EQ 0 AND <fs_field_old> IS NOT INITIAL.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_r.ls_log-chnid = 'D'.ls_log-field = ls_field-ddtext.ls_log-vornr = operation_table-vornr.ls_log-value_old = <fs_field_old>.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ENDIF.CLEAR:ls_field.ENDLOOP.ELSE."修改LOOP AT lt_field INTO ls_field WHERE tabname = 'OPER'.IF ls_field-fieldname = 'ARBPL'."工作中心IF lv_arbpl <> lv_arbpl_old.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_r.ls_log-chnid = 'U'.ls_log-field = '工作中心'.ls_log-vornr = operation_table-vornr.ls_log-value_old = lv_arbpl_old.ls_log-value_new = lv_arbpl.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ELSE.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE operation_table TO <fs_field>.IF sy-subrc EQ 0.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE operation_table_old_afvc TO <fs_field_old>.IF sy-subrc NE 0.ASSIGN COMPONENT ls_field-fieldname OF STRUCTURE operation_table_old_afvv TO <fs_field_old>.ENDIF.IF sy-subrc EQ 0 AND <fs_field> <> <fs_field_old>.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_r.ls_log-chnid = 'U'.ls_log-field = ls_field-ddtext.ls_log-vornr = operation_table-vornr.ls_log-value_old = <fs_field_old>.ls_log-value_new = <fs_field>.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ENDIF.ENDIF.ENDLOOP.ENDIF.WHEN OTHERS.ENDCASE.ENDLOOP.*-生产订单状态
*4)生产订单状态记录LOOP AT status_table WHERE objnr = header_table-objnr.READ TABLE status_table_old WITH KEY objnr = status_table-objnrstat = status_table-stat.IF sy-subrc = 0.IF status_table_old-inact <> status_table-inact.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_s.ls_log-chnid = 'U'.ls_log-field = status_table-stat.IF status_table_old-inact = 'X'.ls_log-value_old = '状态未激活'.ls_log-value_new = '状态激活'.ELSE.ls_log-value_old = '状态激活'.ls_log-value_new = '状态未激活'.ENDIF.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ELSE.ls_log = ls_log_temp.lv_seq = lv_seq + 1.ls_log-seqno = lv_seq.ls_log-object = c_s.ls_log-chnid = 'U'.ls_log-field = status_table-stat.ls_log-value_old = ''.ls_log-value_new = '状态激活'.APPEND ls_log TO lt_log.CLEAR ls_log.ENDIF.ENDLOOP.IF lt_log IS NOT INITIAL.INSERT zppt_gdbg_log FROM TABLE lt_log.REFRESH:lt_log.ENDIF.
ENDFUNCTION.

3.2、报表代码

*&---------------------------------------------------------------------*
*& Report: ZPP_GDBG_LOG                                                    *
*&                                                                     *
*&---------------------------------------------------------------------*
* Creation Date :                                           *
* Author        :                                             *
* Description   : 生产订单变更记录报表                                 *
* Tcode         : ZPP_GDBG_LOG                                              *
* Doc : 生产订单变更记录报表
* Notion:
* 依赖增强
*  # 二代增强
*    PPCO0001  : EXIT_SAPLCOBT_001 开发应用程序: PP订单
*  # 增强内部调用函数
*    ZPP_CO02_LOG
*----------------------------------------------------------------------*
REPORT ZPP_GDBG_LOG.*----------------------------------------------------------------------*
*表声明
*----------------------------------------------------------------------*
TABLES:afko,zppt_gdbg_log,aufk.*----------------------------------------------------------------------*
*类型池声明
*----------------------------------------------------------------------*
TYPE-POOLS:slis.*----------------------------------------------------------------------*
* 类型定义
*----------------------------------------------------------------------*
TYPES: BEGIN OF ty_alv.include structure zppt_gdbg_log.
TYPES: color(4) TYPE c.
TYPES: END OF ty_alv.*----------------------------------------------------------------------*
* 声明内表和工作区
*----------------------------------------------------------------------*
DATA:gt_alv TYPE TABLE OF ty_alv,gs_alv TYPE ty_alv.*----------------------------------------------------------------------*
*ALV参数声明
*----------------------------------------------------------------------*DATA:gt_fieldcat TYPE lvc_t_fcat, "字段目录内表gs_fieldcat TYPE lvc_s_fcat, "字段目录工作区gs_layout   TYPE lvc_s_layo. "用于定义ALV表单的相关格式、属性*----------------------------------------------------------------------*
*选 择 屏 幕 定 义 块
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE TEXT-001 .SELECT-OPTIONS:s_werks FOR aufk-werks  NO INTERVALS OBLIGATORY,s_aufnr FOR zppt_gdbg_log-aufnr, "生产订单s_aenam FOR zppt_gdbg_log-aenam, "更改者s_laeda FOR zppt_gdbg_log-laeda. "修改日期
SELECTION-SCREEN END OF BLOCK block1 .*&---------------------------------------------------------------------*
*&  INITIALIZATION:程序初始化时所执行的代码
*&---------------------------------------------------------------------*
INITIALIZATION.*&---------------------------------------------------------------------*
*&  AT SELECTION-SCREEN:在选择屏幕上执行的代码
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN.*&---------------------------------------------------------------------*
*&  START-OF-SELECTION:程序运行所处理的代码
*&---------------------------------------------------------------------*
START-OF-SELECTION."权限检查PERFORM frm_check_srceen."获取取数PERFORM frm_get_data."设置字段属性PERFORM frm_set_fieldcat."设置输出格式PERFORM frm_set_layout."显示ALVPERFORM frm_display_alv.*&---------------------------------------------------------------------*
*&      Form  FRM_CHECK_SRCEEN
*----------------------------------------------------------------------*
FORM frm_check_srceen.ENDFORM. "frm_check_srceen*&---------------------------------------------------------------------*
*&      Form  FRM_GET_DATA
*----------------------------------------------------------------------*
FORM frm_get_data.SELECTco~aufnr,"
    co~aenam,"
    co~laeda,"
    co~times,"
    co~seqno,"
    co~tcode,"
    co~chnid,"
    co~field,"
    co~object,"
    co~matnr,"
    co~vornr,"
    co~host,"
    co~value_old,"
    co~value_new,"
    co~ipFROM zppt_gdbg_log AS coINNER JOIN aufk AS fv ON fv~aufnr = co~aufnrINTO TABLE @DATA(lt_log)WHERE co~aufnr IN @s_aufnrAND co~aenam IN @s_aenamAND co~laeda IN @s_laedaAND fv~werks IN @s_werks.LOOP AT lt_log INTO DATA(ls_log).CLEAR:gs_alv.MOVE-CORRESPONDING ls_log TO gs_alv.CASE gs_alv-chnid.WHEN 'U'.gs_alv-color = 'C510'.WHEN 'I'.gs_alv-color = 'C710'.WHEN 'D'.gs_alv-color = 'C610'.ENDCASE.APPEND gs_alv TO gt_alv.CLEAR:ls_log.ENDLOOP.SORT gt_alv BY aufnr seqno.
ENDFORM. "FRM_GET_DATA*&---------------------------------------------------------------------*
*&      Form  FRM_SET_FIELDCAT
*----------------------------------------------------------------------*
FORM frm_set_fieldcat.REFRESH gt_fieldcat.DEFINE  init_fill_fcat.CLEAR:gs_fieldcat.gs_fieldcat-fieldname    = &1.gs_fieldcat-coltext      = &2.gs_fieldcat-ref_table    = &3.gs_fieldcat-ref_field    = &4.gs_fieldcat-key          = &5.gs_fieldcat-hotspot      = &6.gs_fieldcat-edit         = &7.gs_fieldcat-no_zero      = &8.gs_fieldcat-icon         = &9.APPEND gs_fieldcat TO gt_fieldcat.END-OF-DEFINITION.init_fill_fcat 'AUFNR'     '生产订单' 'ZPPT_GDBG_LOG' 'AUFNR' 'X' '' '' 'X' ''.init_fill_fcat 'SEQNO'     '序号' '' '' 'X' '' '' '' ''.init_fill_fcat 'FIELD'     '描述' '' '' 'X' '' '' '' ''.init_fill_fcat 'VALUE_OLD' '旧值' '' '' '' '' '' '' ''.init_fill_fcat 'VALUE_NEW' '新值' '' '' '' '' '' '' ''.init_fill_fcat 'OBJECT'    '对象名称' 'ZPPT_GDBG_LOG' 'OBJECT' 'X' '' '' '' ''.init_fill_fcat 'MATNR'     '物料' 'ZPPT_GDBG_LOG' 'MATNR' '' '' '' 'X' ''.init_fill_fcat 'VORNR'     '组件工序' 'ZPPT_GDBG_LOG' 'VORNR' '' '' '' '' ''.init_fill_fcat 'AENAM'     '修改人' 'ZPPT_GDBG_LOG' 'AENAM' '' '' '' '' ''.init_fill_fcat 'LAEDA'     '修改日期' 'ZPPT_GDBG_LOG' 'LAEDA' '' '' '' 'X' ''.init_fill_fcat 'TIMES'     '修改时间' 'ZPPT_GDBG_LOG' 'TIMES' '' '' '' 'X' ''.init_fill_fcat 'TCODE'     '事务代码' 'ZPPT_GDBG_LOG' 'TCODE' '' '' '' '' ''.init_fill_fcat 'CHNID'     '修改类型' 'ZPPT_GDBG_LOG' 'CHNID' '' '' '' '' ''.init_fill_fcat 'IP'        'IP地址' 'ZPPT_GDBG_LOG' 'IP' '' '' '' '' ''.init_fill_fcat 'HOST'      '机器名' 'ZPPT_GDBG_LOG' 'HOST' '' '' '' '' ''.ENDFORM. "FRM_SET_FIELDCAT*&---------------------------------------------------------------------*
*&      Form  FRM_SET_LAYOUT
*&---------------------------------------------------------------------*
*       text  界面格式属性
*----------------------------------------------------------------------*
FORM frm_set_layout .CLEAR gs_layout.gs_layout-sel_mode   = 'A'.     "选择行模式gs_layout-cwidth_opt = 'A'.     "优化列宽设置gs_layout-zebra      = 'X'.     "设置斑马线
*  gs_layout-box_fname = 'CHECKBOX'.gs_layout-info_fname = 'COLOR'.
ENDFORM. " FRM_SET_LAYOUT*&---------------------------------------------------------------------*
*&      Form  FRM_DISPLAY_ALV
*&---------------------------------------------------------------------*
*       text  界面显示
*----------------------------------------------------------------------*
FORM frm_display_alv .CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'EXPORTINGi_callback_program      = sy-repidis_layout_lvc           = gs_layout
*     i_callback_pf_status_set = 'FRM_SET_STATUS'i_callback_user_command = 'FRM_USER_COMMAND'it_fieldcat_lvc         = gt_fieldcati_save                  = 'A'TABLESt_outtab                = gt_alvEXCEPTIONSprogram_error           = 1OTHERS                  = 2.IF sy-subrc <> 0.MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgnoWITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.ENDIF.ENDFORM. " FRM_DISPLAY_ALV*&---------------------------------------------------------------------*
*&      Form  SUB_USER_COMMAND、
*----------------------------------------------------------------------*
FORM frm_user_command USING s_ucomm TYPE sy-ucommre_selfield TYPE slis_selfield.CASE s_ucomm.WHEN '&IC1'.CLEAR gs_alv.READ TABLE gt_alv INTO gs_alv INDEX re_selfield-tabindex.IF sy-subrc = 0.SET PARAMETER ID 'ANR' FIELD gs_alv-aufnr.CALL TRANSACTION 'CO03' AND SKIP FIRST SCREEN.ENDIF.ENDCASE.ENDFORM. "SUB_USER_COMMAND*Selection texts
*----------------------------------------------------------
* S_AENAM         更改者
* S_AUFNR         生产订单
* S_LAEDA         更改日期
* S_WERKS         工厂

 

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/833851.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

manim边做边学--圆锥

Cone是Manim中专门用于创建和操控锥形几何对象的类。 Cone允许用户定义锥体的底面半径、高度、颜色、不透明度等属性,并提供了一系列方法来操控这个锥体,如移动、缩放、旋转等。 通过这些属性和方法,用户可以灵活地创建出符合自己需求的锥形对象,并将其融入到动画或演示中。…

远光天鹿:重塑数字化时代软件设计新体验

在当今数字化时代,用户体验已成为衡量软件产品成功与否的关键指标。然而,传统的软件设计模式存在流程繁琐、效率低下、资源浪费等弊端,严重制约了产品创新的步伐。为此,远光软件创新推出高效智能的用户体验创新平台——远光天鹿。传统设计模式的挑战 传统软件设计模式涵盖需…

速度与安全并重:交通运输业异地跨地区文件传输的创新方案!

在交通运输业中,总部需要异地跨地区文件传输给分支机构的文件种类繁多,这些文件通常涵盖公司的战略规划、运营指导、规章制度、业务数据等多个方面。以下是一些常见的总部需要异地跨地区文件传输的文件类型: 1.战略规划与考核文件:公司长期发展规划、年度经营计划、绩效考核…

Qt/C++地图高级绘图/指定唯一标识添加删除修改/动态显示和隐藏/支持天地图高德地图百度地图

一、前言说明 已经有了最基础的接口用来添加覆盖物,而且还有通过进入覆盖物模式动态添加覆盖物的功能,为什么还要来个高级绘图?因为又有新的需求,给钱就搞,一点底线都没有。无论哪个地图厂家,提供的接口都是没有唯一标识参数的,也就类似于学号,这就是需要自己主动定一个…

网站换主页在哪里修改

要修改网站的主页,通常需要访问网站的后台管理系统或直接编辑服务器上的文件。具体步骤取决于你的网站是如何构建和托管的。以下是一些常见的方法:使用CMS(内容管理系统):登录到你的CMS后台(如WordPress, Joomla, Drupal等)。 导航到“外观”或“主题”部分,选择当前使…

织梦数据库配置文件数据库损坏:尝试修复数据库

数据库损坏:尝试修复数据库:REPAIR TABLE table_name;如果无法修复,考虑从备份恢复数据库。扫码添加技术【解决问题】专注中小企业网站建设、网站安全12年。熟悉各种CMS,精通PHP+MYSQL、HTML5、CSS3、Javascript等。承接:企业仿站、网站修改、网站改版、BUG修复、问题处理…

一个asp网站的mdb数据库修改,如何在Access数据库中修改ASP网站的数据

Access数据库是一种常用的桌面数据库,常用于小型网站的数据管理。以下是具体步骤:打开Access数据库:打开Microsoft Access应用程序。 导入或打开现有的Access数据库文件(.mdb或.accdb)。导航到数据表:在Access主界面中,选择“表”视图。 找到需要修改的数据表,双击打开…

如何修改我的网站页面,如何在网站后台或代码编辑器中修改网站页面内容

修改网站页面内容可以更新信息和提升用户体验。以下是修改网站页面内容的步骤:登录网站后台:打开浏览器,输入网站的后台地址,例如 http://yourdomain.com/admin。 输入管理员账号和密码,点击“登录”。进入内容管理:登录后,点击顶部菜单栏中的“内容”或“文章”。 选择…

修改网站上的页面,如何优化网页设计与功能

修改网站上的页面不仅仅是更改文本或图片,更重要的是优化用户体验和网站性能。以下是一些关键步骤:分析用户需求:通过用户调研或数据分析了解用户偏好,据此调整页面布局和内容。 提高加载速度:优化图片大小,减少HTTP请求,使用CDN加速等方法提升页面加载速度。 响应式设计…

ETL之kettle 医疗行业高级陪伴群 第一课

1、里程碑 很高兴的和可爱的小伙伴们一起宣布,我们的医疗特工队正式成立了。确切的说是ETL医疗高级陪伴群于2024-11-14日12时22分正式成立。 2、此群的前身 回忆过去我刚开始接触kettle时资料甚少,遇到问题啃英文官方文档,遇到不懂的英文靠Ai翻译,慢慢的能够驾驭kettle,能…

案例分享-导致MySQL崩溃的SQL语句

你小子一条SQL竟然让MySQL崩溃,让我来看看怎么个事背景 周一刚上班一个开发小哥火急火燎的过来找我,黑龙江某客户私有化环境的服务过一阵就报数据库连接失败,不知道是什么原因导致的,我以为是客户调整了网络,但是客户说并没有做任何调整,我使用ping测试也看不出什么问题,…

利用腾讯元器,将公众号变身为强大的.NET AI智能体

前言 经常有粉丝朋友在公众号后台私信提问,因为个人平时比较少看公众号后台的私信所以没法及时回复。最近发现腾讯推出了一个可以创建和使用各种智能体的平台(帮助小白也能快速使用AI):腾讯元器,正好自己每天也在公众号更新.NET相关的文章(到目前为止.NET相关的文章应该有…