ABAP 期初库存批量导入 demo1

&---------------------------------------------------------------------
*& Report ZMMCP005
&---------------------------------------------------------------------

  • 作者: Liv
  • 完成日期:
  • 描述: 期初库存导入
  • 需求简要说明:
    &---------------------------------------------------------------------
  • 版本号 日期 作者 修改描述 功能更改说明书
    &---------------------------------------------------------------------
  • 1.0 2021/11/19 Liv 程序创建
    *&
    &---------------------------------------------------------------------
    REPORT zmmcp005 MESSAGE-ID 00.

TABLES:sscrfields.
TYPE-POOLS: slis.
INCLUDE .

DEFINE append_str.
CONCATENATE &1 &2 INTO &1 SEPARATED BY ‘,’.
END-OF-DEFINITION.

DATA: ok_code TYPE sy-ucomm,
save_ok TYPE sy-ucomm.

*&For DOC ALV
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv,
it_event TYPE slis_t_event,
it_layout TYPE slis_layout_alv,
w_callback_ucomm TYPE slis_formname,
i_list_comments TYPE slis_t_listheader,
w_list_comments LIKE LINE OF i_list_comments,
i_events TYPE slis_t_event,
w_events LIKE LINE OF i_events.

*定义隐藏标准按钮的变量
DATA: wa_excluding TYPE slis_extab,
it_excluding TYPE slis_t_extab.

DEFINE initial_field.

wa_fieldcat-ddictxt = ‘L’.
wa_fieldcat-fieldname = &1 .
wa_fieldcat-seltext_l = &2 .
wa_fieldcat-seltext_m = &2 .
wa_fieldcat-seltext_s = &2 .
wa_fieldcat-reptext_ddic = &2.
wa_fieldcat-no_zero = &3.
wa_fieldcat-key = &4.
wa_fieldcat-just = &5.
wa_fieldcat-ref_fieldname = &6.
wa_fieldcat-ref_tabname = &7.

  • IF WA_FIELDCAT-FIELDNAME = ‘Z_KPI’.
  • WA_FIELDCAT-INTLEN = 18.
    
  • ENDIF.

APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
END-OF-DEFINITION.

*DATA gt_input LIKE TABLE OF zcpfit_0600 WITH HEADER LINE. "久其报表KPI数据源配置表

DATA:BEGIN OF gt_input OCCURS 0,
zlsh TYPE i,
zhxm TYPE i,
zks , " 开始
zjs , " 结束
zmess_h(255) , " 抬头系统消息
zmess_i(255) , " 行项目系统消息
bldat LIKE gohead-bldat , " 凭证日期
budat LIKE gohead-budat , " 过账日期
bwart LIKE godefault_tv-bwart , " 移动类型
bktxt LIKE gohead-bktxt , " 抬头文本
werks LIKE goitem-werks, " 工厂
name1 LIKE t001w-name1 , " 工厂名称
lgobe LIKE goitem-lgobe , " 库存地点
zxh(20) , " 序号
matnr LIKE goitem-matnr , " 物料
maktx LIKE goitem-maktx , " 物料描述
xchar LIKE marc-xchar , " 批次启用标识
charg LIKE goitem-charg , " 批次
erfmg LIKE goitem-erfmg , " 数量
meins LIKE mara-meins , " 计量单位
lifnr LIKE goitem-lifnr , " 供应商
kunnr LIKE goitem-kunnr , " 客户
dmbtr LIKE goitem-dmbtr , " 总金额
sobkz LIKE goitem-sobkz , " 特殊库存标识
kdauf LIKE goitem-kdauf , " 销售订单
kdpos LIKE goitem-kdpos , " 行项目
bklas LIKE mbew-bklas , " 系统评估类
vprsv LIKE mbew-vprsv , " 系统价格控制
stprs LIKE mbew-stprs , " 系统标准单价
zprice LIKE goitem-dmbtr , " 系统计算总价
class LIKE klah-class , " 系统分类代码

  •   zflbm(20) ,                     "  分类代码
    
  •   mwert01      LIKE rctms-mwert , "  特性1
    
  •   mwert02      LIKE rctms-mwert , "  特性2
    
  •   mwert03      LIKE rctms-mwert , "  特性3
    
  •   mwert04      LIKE rctms-mwert , "  特性4
    
  •   mwert05      LIKE rctms-mwert , "  特性5
    
  •   mwert06      LIKE rctms-mwert , "  特性6
    
  •   mwert07      LIKE rctms-mwert , "  特性7
    
  •   mwert08      LIKE rctms-mwert , "  特性8
    
  •   mwert09      LIKE rctms-mwert , "  特性9
    
  •   mwert10      LIKE rctms-mwert , "  特性10
    
  •   mwert11      LIKE rctms-mwert , "  特性11
    
  •   mwert12      LIKE rctms-mwert , "  特性12
    
  •   mwert13      LIKE rctms-mwert , "  特性13icon         TYPE icon_d, "图标
    
    END OF gt_input.

DATA gt_input_hd LIKE TABLE OF gt_input WITH HEADER LINE.
DATA gt_input_it LIKE TABLE OF gt_input WITH HEADER LINE.

DATA BEGIN OF iexcel OCCURS 0. " excel上载内表
INCLUDE STRUCTURE alsmex_tabline.
DATA END OF iexcel.

DATA: error TYPE REF TO cx_root,
lv_message TYPE string.

DATA: gv_message_h TYPE string,
gv_message_i TYPE string,
gv_msg_h TYPE string,
gv_msg_i TYPE string.
DATA: gv_subrc LIKE sy-subrc.

SELECTION-SCREEN FUNCTION KEY 1.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.

PARAMETERS: p_file LIKE rlgrap-filename DEFAULT ‘’ . "文件目录.
SELECTION-SCREEN SKIP.
*
*PARAMETERS: R1 RADIOBUTTON GROUP RG1,

  •        R2 RADIOBUTTON GROUP RG1.
    

SELECTION-SCREEN: END OF BLOCK b1.

INITIALIZATION.
sscrfields-functxt_01 = ‘模板下载’.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

PERFORM get_filename.

** 权限检查

  • PERFORM AUTHORITY_CHECK.

AT SELECTION-SCREEN.

CASE sscrfields-ucomm .
WHEN ‘FC01’.
DATA rec_objdata LIKE wwwdatatab.
rec_objdata-relid = ‘MI’.
rec_objdata-objid = ‘ZMMCP005’.
** 下载模版
CALL FUNCTION ‘DOWNLOAD_WEB_OBJECT’
EXPORTING
key = rec_objdata
destination = p_file.
WHEN OTHERS.
ENDCASE.

*-----------------------------------------------------------------------

  • START-OF-SELECTION
    *-----------------------------------------------------------------------

START-OF-SELECTION.

PERFORM read_data .
PERFORM check_data .

PERFORM initialize_fieldcat .
PERFORM build_layout .
PERFORM display_alv TABLES gt_input[].

&---------------------------------------------------------------------
*& Form READ_DATA
&---------------------------------------------------------------------

  •   text
    

----------------------------------------------------------------------

  • –> p1 text
  • <-- p2 text
    ----------------------------------------------------------------------
    FORM read_data .

FIELD-SYMBOLS <fs_excel> LIKE LINE OF iexcel.
CLEAR: iexcel[],
iexcel.

*上载excel文件
CALL FUNCTION ‘ALSM_EXCEL_TO_INTERNAL_TABLE’
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 3
i_end_col = 50
i_end_row = 5000
TABLES
intern = iexcel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE: / 'EXCEL 上载失败 ', p_file, sy-subrc.
STOP.
ELSE.
SORT iexcel BY row col.
ENDIF.

*excel内表中的数据放到内表中
LOOP AT iexcel ASSIGNING <fs_excel> .

  • CONDENSE <fs_excel>-value NO-GAPS.
    CASE <fs_excel>-col.
    WHEN 1. "开始
    gt_input-zks = <fs_excel>-value.
    WHEN 2. "结束
    gt_input-zjs = <fs_excel>-value.
    WHEN 4. "凭证日期
    gt_input-bldat = <fs_excel>-value.
    WHEN 5. "过账日期
    gt_input-budat = <fs_excel>-value.
    WHEN 6. "移动类型
    gt_input-bwart = <fs_excel>-value.
    WHEN 7. "抬头文本
    gt_input-bktxt = <fs_excel>-value.
    WHEN 8. "工厂
    gt_input-werks = <fs_excel>-value.
    WHEN 9. "库存地点
    gt_input-lgobe = <fs_excel>-value.
    WHEN 10. "序号
    gt_input-zxh = <fs_excel>-value.
    WHEN 11. "物料
    gt_input-matnr = <fs_excel>-value.
    WHEN 12. "物料描述
    gt_input-maktx = <fs_excel>-value.
    WHEN 13. "批次
    gt_input-charg = <fs_excel>-value.
    WHEN 14. "数量
    gt_input-erfmg = <fs_excel>-value.
    WHEN 15. "计量单位
    gt_input-meins = <fs_excel>-value.
    WHEN 16. "总金额
    gt_input-dmbtr = <fs_excel>-value.
    WHEN 17. "特殊库存标识
    gt_input-sobkz = <fs_excel>-value.
    WHEN 18. "销售订单
    gt_input-kdauf = <fs_excel>-value.
    WHEN 19. "行项目
    gt_input-kdpos = <fs_excel>-value.
    ENDCASE.
AT END OF row.APPEND gt_input. CLEAR gt_input.
ENDAT.

ENDLOOP.

ENDFORM. "READ_DATA

FORM check_data .

DATA:l_tabix LIKE sy-tabix.
DATA:l_start_flag,l_end_flag.
DATA:l_lsh TYPE i,l_hxm TYPE i.

LOOP AT gt_input.
IF gt_input-zks = ‘S’.
l_lsh = l_lsh + 1.
l_hxm = 1.
ELSE.
l_hxm = l_hxm + 1.
ENDIF.

gt_input-zlsh = l_lsh.
gt_input-zhxm = l_hxm.
  •  zhxm
    

    MODIFY gt_input INDEX sy-tabix.
    ENDLOOP.

    LOOP AT gt_input WHERE zks = ‘S’ .
    gt_input_hd = gt_input.
    APPEND gt_input_hd.
    ENDLOOP.

    LOOP AT gt_input.

    l_tabix = sy-tabix.

    READ TABLE gt_input_hd WITH KEY zlsh = gt_input-zlsh.

    CLEAR: gt_input-zmess_h,gt_input-zmess_i,gt_input-icon,gv_msg_h,gv_message_h,gv_msg_i,gv_message_i.

    IF gt_input-zks = ‘S’ OR gt_input-zks IS INITIAL.
    ELSE.
    gt_input-icon = icon_led_red.
    gv_msg_h = ‘凭证开始标识不为S’.
    append_str gv_message_h gv_msg_h.
    ENDIF.

    IF gt_input-zjs = ‘E’ OR gt_input-zjs IS INITIAL.
    ELSE.
    gt_input-icon = icon_led_red.
    gv_msg_h = ‘凭证结束标识不为E’.
    append_str gv_message_h gv_msg_h.
    ENDIF.

    IF gt_input-zks = ‘S’ AND l_end_flag <> ‘E’ AND l_tabix <> 1.
    gt_input-icon = icon_led_red.
    gv_msg_h = ‘上笔记录缺少凭证结束标识E’.
    append_str gv_message_h gv_msg_h.
    ENDIF.

    IF l_end_flag = ‘E’ AND gt_input-zks <> ‘S’ .
    gt_input-icon = icon_led_red.
    gv_msg_h = ‘凭证开始标识不为S’.
    append_str gv_message_h gv_msg_h.
    ENDIF.

    CLEAR l_end_flag.

    IF gt_input-zks = ‘S’ AND gt_input-bldat IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_h = ‘凭证日期不能为空’.
    append_str gv_message_h gv_msg_h.
    ENDIF.

    IF gt_input-bldat IS NOT INITIAL AND gt_input-zks <> ‘S’ .
    gt_input-icon = icon_led_red.
    gv_msg_h = ‘凭证开始标识不为S’.
    append_str gv_message_h gv_msg_h.
    ENDIF.

    IF gt_input-zks = ‘S’ AND gt_input-budat IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_h = ‘过账日期不能为空’.
    append_str gv_message_h gv_msg_h.
    ENDIF.

    IF gt_input-zks = ‘S’ AND gt_input-bwart IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_h = ‘移动类型不能为空’.
    append_str gv_message_h gv_msg_h.
    ENDIF.

    IF gt_input-werks IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_i = ‘工厂不能为空’.
    append_str gv_message_i gv_msg_i.
    ENDIF.

    IF gt_input-lgobe IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_i = ‘库存地点不能为空’.
    append_str gv_message_i gv_msg_i.
    ENDIF.

    IF gt_input-zxh IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_i = ‘序号不能为空’.
    append_str gv_message_i gv_msg_i.
    ENDIF.

    IF gt_input-matnr IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_i = ‘物料不能为空’.
    append_str gv_message_i gv_msg_i.
    ENDIF.

    IF gt_input-maktx IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_i = ‘物料描述不能为空’.
    append_str gv_message_i gv_msg_i.
    ENDIF.

    IF gt_input-erfmg IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_i = ‘数量不能为空’.
    append_str gv_message_i gv_msg_i.
    ENDIF.

    IF gt_input_hd-sobkz = ‘K’ AND gt_input-lifnr IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_i = ‘供应商不能为空’.
    append_str gv_message_i gv_msg_i.
    ENDIF.

    IF gt_input_hd-sobkz = ‘W’ AND gt_input-kunnr IS INITIAL.
    gt_input-icon = icon_led_red.
    gv_msg_i = ‘客户不能为空’.
    append_str gv_message_i gv_msg_i.
    ENDIF.

  • IF gt_input-dmbtr IS INITIAL.

  •  gt_input-icon = icon_led_red.
    
  •  gv_msg_i = '总金额不能为空'.
    
  •  append_str gv_message_i gv_msg_i.
    
  • ENDIF.

IF  gt_input-xchar = 'X' AND gt_input-charg IS INITIAL.gt_input-icon = icon_led_red.gv_msg_i = '批次不能为空'.append_str gv_message_i gv_msg_i.
ENDIF.
  • IF GT_INPUT-XCHAR = ‘X’ AND GT_INPUT-ZFLBM IS INITIAL .
  •  GT_INPUT-ICON = ICON_LED_RED.
    
  •  GV_MSG_I = '分类代码不能为空'.
    
  •  APPEND_STR GV_MESSAGE_I GV_MSG_I.
    
  • ENDIF.

*********系统取值

CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT' "物料前导零EXPORTINGinput        = gt_input-matnrIMPORTINGoutput       = gt_input-matnrEXCEPTIONSlength_error = 1OTHERS       = 2.

*批次启用标识
SELECT SINGLE xchar
INTO gt_input-xchar
FROM marc
WHERE matnr = gt_input-matnr
AND werks = gt_input-werks.

*工厂名称
SELECT SINGLE name1
INTO gt_input-name1
FROM t001w
WHERE werks = gt_input-werks.

*计量单位
SELECT SINGLE meins
INTO gt_input-meins
FROM mara
WHERE matnr = gt_input-matnr.

*系统标准单价
SELECT SINGLE stprs bklas vprsv
INTO ( gt_input-stprs,gt_input-bklas,gt_input-vprsv )
FROM mbewh
WHERE matnr = gt_input-matnr
AND bwkey = gt_input-werks
AND lfgja = ‘2018’
AND lfmon = ‘12’.

  •  AND vprsv = 'S'.
    

*系统计算总价
gt_input-zprice = gt_input-erfmg * gt_input-stprs.

*系统分类代码
IF gt_input-xchar = ‘X’.
SELECT SINGLE klah~class
INTO gt_input-class
FROM inob
INNER JOIN kssk
ON inob~cuobj = kssk~objek
INNER JOIN klah
ON kssk~clint = klah~clint
WHERE inob~obtab = ‘MARA’
AND inob~objek = gt_input-matnr.
ENDIF.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'EXPORTINGinput  = gt_input-kdaufIMPORTINGoutput = gt_input-kdauf.

IF  gt_input-xchar IS NOT INITIAL AND gt_input-charg IS INITIAL.gt_input-icon = icon_led_red.gv_msg_i = '批次不能为空'.append_str gv_message_i gv_msg_i.
ENDIF.
  • IF GT_INPUT-XCHAR IS NOT INITIAL AND GT_INPUT-ZFLBM IS INITIAL AND R2 IS NOT INITIAL.

  •  GT_INPUT-ICON = ICON_LED_RED.
    
  •  GV_MSG_I = '分类代码不能为空'.
    
  •  APPEND_STR GV_MESSAGE_I GV_MSG_I.
    
  • ENDIF.

  • IF GT_INPUT-CLASS <> GT_INPUT-ZFLBM AND R2 IS NOT INITIAL.

  •  GT_INPUT-ICON = ICON_LED_RED.
    
  •  GV_MSG_I = '分类代码与系统分类代码不一致'.
    
  •  APPEND_STR GV_MESSAGE_I GV_MSG_I.
    
  • ENDIF.


IF gv_message_h IS NOT INITIAL.gt_input-zmess_h = gv_message_h.
ENDIF.IF gv_message_i IS NOT INITIAL.gt_input-zmess_i = gv_message_i.
ENDIF.IF  gt_input-zjs = 'E'.l_end_flag = 'E'.
ENDIF.MODIFY gt_input INDEX l_tabix.

ENDLOOP.

ENDFORM.

FORM get_filename .
CALL FUNCTION ‘WS_FILENAME_GET’
EXPORTING
def_path = ‘C’
mask = ‘,Excel,.XLSX;.XLS.’
title = ‘选择文件’
IMPORTING
filename = p_file
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.

IF sy-subrc <> 0 AND sy-subrc = 3.
MESSAGE ‘选择文件出错’ TYPE ‘I’ DISPLAY LIKE ‘E’.
STOP.
ENDIF.
ENDFORM. "GET_FILENAME

FORM build_layout .
it_layout-zebra = ‘X’.
it_layout-detail_popup = ‘X’.
it_layout-colwidth_optimize = ‘X’.
ENDFORM.

FORM initialize_fieldcat .

  • initial_field ‘ZLSH’ ‘流水号’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • initial_field ‘ZHXM’ ‘行项目’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘ICON’ ‘状态’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘ZMESS_H’ ‘抬头消息’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘ZMESS_I’ ‘行项目消息’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘ZKS’ ‘开始’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘ZJS’ ‘结束’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘BLDAT’ ‘凭证日期’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘BUDAT’ ‘过账日期’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘BWART’ ‘移动类型’ ‘’ ‘’ ‘’ ‘’ ‘’.

initial_field ‘BKTXT’ ‘抬头文本’ ‘’ ‘’ ‘’ ‘’ ‘’.

initial_field ‘ZEMNUM’ ‘工号’ ‘’ ‘’ ‘’ ‘’ ‘’.
initial_field ‘ZPRJVD’ ‘施工单位’ ‘’ ‘’ ‘’ ‘’ ‘’.

initial_field ‘WERKS’ ‘工厂’ ‘’ ‘’ ‘’ ‘’ ‘’.

  • INITIAL_FIELD ‘NAME1’ ‘工厂名称’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘LGOBE’ ‘库存地点’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘ZXH’ ‘序号’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘MATNR’ ‘物料’ ‘X’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘MAKTX’ ‘物料描述’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘XCHAR’ ‘批次启用标识’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘CHARG’ ‘批次’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘ERFMG’ ‘数量’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘MEINS’ ‘计量单位’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘LIFNR’ ‘供应商’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘KUNNR’ ‘客户’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘DMBTR’ ‘总金额’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘SOBKZ’ ‘特殊库存标识’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘KDAUF’ ‘销售订单’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘KDPOS’ ‘行项目’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘BKLAS’ ‘评估类’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘VPRSV’ ‘价格控制’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘STPRS’ ‘标准单价’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘ZPRICE’ ‘系统计算总价’ ‘’ ‘’ ‘’ ‘’ ‘’.
    initial_field ‘CLASS’ ‘系统分类代码’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘ZFLBM’ ‘分类代码’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT01’ ‘特性1’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT02’ ‘特性2’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT03’ ‘特性3’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT04’ ‘特性4’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT05’ ‘特性5’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT06’ ‘特性6’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT07’ ‘特性7’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT08’ ‘特性8’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT09’ ‘特性9’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT10’ ‘特性10’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT11’ ‘特性11’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT12’ ‘特性12’ ‘’ ‘’ ‘’ ‘’ ‘’.
  • INITIAL_FIELD ‘MWERT13’ ‘特性13’ ‘’ ‘’ ‘’ ‘’ ‘’.
    ENDFORM. " INITIALIZE_FIELDCAT

&---------------------------------------------------------------------
*& Form WRITE_BAPILOG_ALV
&---------------------------------------------------------------------

  •   text
    

----------------------------------------------------------------------

  •  -->P_IT_DOC_RETURN  text
    

----------------------------------------------------------------------
FORM display_alv TABLES p_table STRUCTURE gt_input.

CLEAR:wa_excluding,it_excluding.

*设置要隐藏的FCODE

  • wa_excluding-fcode = ‘SAV_DATA’.
  • APPEND wa_excluding TO it_excluding.

CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’
EXPORTING
i_callback_program = sy-repid
is_layout = it_layout
it_fieldcat = it_fieldcat

  • IT_EVENTS                = I_EVENTS
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command  = 'USER_COMMAND'
    i_default                = 'X'
    i_save                   = 'A'
    
    TABLES
    t_outtab = p_table
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ‘显示错误.’ TYPE ‘W’.
    STOP.
    ENDIF.
    ENDFORM. " WRITE_BAPILOG_ALV

FORM set_pf_status USING rt_extab TYPE slis_t_extab.
rt_extab = it_excluding.

  • IF R1 = ‘X’.
    SET PF-STATUS ‘STANDARD’. "EXCLUDING rt_extab.
  • ELSE.
  • SET PF-STATUS ‘ST200’. "EXCLUDING rt_extab.
  • SET TITLEBAR ‘TIT100’ WITH ‘批次库存特性信息补导入’.
  • ENDIF.
    ENDFORM. "SET_PF_STATUS

FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.

DATA: lt_params LIKE rsparams OCCURS 0 WITH HEADER LINE.
DATA:l_index TYPE i.
DATA: l_varid TYPE varid.

DATA: lr_grid TYPE REF TO cl_gui_alv_grid,
is_stable TYPE lvc_s_stbl.

CALL FUNCTION ‘GET_GLOBALS_FROM_SLVC_FULLSCR’
IMPORTING
e_grid = lr_grid.
CALL METHOD lr_grid->check_changed_data.

CASE r_ucomm.
WHEN ‘TEST’.

  PERFORM frm_imp_data_test.CALL METHOD lr_grid->refresh_table_displayEXPORTINGis_stable = is_stable.WHEN 'IMPORT'.PERFORM frm_imp_data.
  •  CLEAR: gt_input,gt_input[].CALL METHOD lr_grid->refresh_table_displayEXPORTINGis_stable = is_stable.
    

    WHEN ‘IMPORT1’.

    PERFORM frm_imp_data_1.CALL METHOD lr_grid->refresh_table_displayEXPORTINGis_stable = is_stable.
    
  • WHEN ‘EXIT’.

  •  LEAVE PROGRAM.
    
  • WHEN ‘BACK’.

  •  LEAVE TO SCREEN 0.
    
  • WHEN ‘CANC’.

  •  LEAVE PROGRAM.
    

    WHEN OTHERS.

    ENDCASE.
    ENDFORM. "user_command

DATA:g_header LIKE bapi2017_gm_head_01.
DATA:g_mat LIKE bapi2017_gm_head_ret-mat_doc.
DATA:gt_item LIKE TABLE OF bapi2017_gm_item_create WITH HEADER LINE.
DATA:gt_ret LIKE TABLE OF bapiret2 WITH HEADER LINE.

DATA gs_bapi_te_xmkpf TYPE bapi_te_xmkpf.
DATA: gt_ext LIKE TABLE OF bapiparex WITH HEADER LINE.

DATA:txt(255) TYPE c.
DATA:code TYPE bapi2017_gm_code.

FORM frm_imp_data_test.

DATA:l_answer TYPE c.
DATA:l_subrc TYPE sy-subrc.

CLEAR: g_header,g_mat,gt_item,gt_item[],gt_ret,gt_ret[],txt,code.

IF gt_input[] IS INITIAL.
MESSAGE e001(00) WITH ‘无批导数据’.
ENDIF.

READ TABLE gt_input WITH KEY icon = icon_led_red.
IF sy-subrc = 0.
MESSAGE e001(00) WITH ‘导入数据存在错误’.
ENDIF.

READ TABLE gt_input INDEX 1.
IF gt_input-zmess_i IS NOT INITIAL.
MESSAGE e001(00) WITH ‘已生成物料凭证’.
ENDIF.

  • CALL FUNCTION ‘POPUP_TO_CONFIRM’

  • EXPORTING

  •  titlebar              = '提示'
    
  •  text_question         = '是否确认导入期初库存'
    
  •  text_button_1         = '确认'
    
  •  text_button_2         = '取消'
    
  •  default_button        = '2'
    
  •  display_cancel_button = ' '
    
  •  popup_type            = 'ICON_MESSAGE_WARNING'
    
  • IMPORTING

  •  answer                = l_answer
    
  • EXCEPTIONS

  •  text_not_found        = 1
    
  •  OTHERS                = 2.
    
  • CHECK l_answer = ‘1’.
    REFRESH gt_ext.
    LOOP AT gt_input_hd.

    CLEAR:gt_input_it,gt_input_it[].
    LOOP AT gt_input WHERE zlsh = gt_input_hd-zlsh.
    gt_input_it = gt_input.
    APPEND gt_input_it.
    ENDLOOP.
    SORT gt_input_it BY zlsh zhxm.

BAPI*************
CLEAR: g_header,gt_item,gt_item[].

g_header-pstng_date = gt_input_hd-budat. " 凭证日期
g_header-doc_date   = gt_input_hd-bldat. " 过账日期
g_header-header_txt   = gt_input_hd-bktxt. " 抬头文本
  • "* header增强字段
  • gs_bapi_te_xmkpf-zemnum = gt_input_hd-zemnum.
  • gs_bapi_te_xmkpf-zprjvd = gt_input_hd-zprjvd.
  • gt_ext-structure = ‘BAPI_TE_XMKPF’.
  • gt_ext-valuepart1 = gs_bapi_te_xmkpf.
  • APPEND gt_ext.
  • CLEAR gt_ext.
  • CLEAR gs_bapi_te_xmkpf.
" 移动类型
IF gt_input_hd-bwart = '201' OR gt_input_hd-bwart = '202' OR gt_input_hd-bwart = '551'OR gt_input_hd-bwart = '552' OR gt_input_hd-bwart = '261' OR gt_input_hd-bwart = '262'.code = '03'.
ELSEIF gt_input_hd-bwart = '701' OR gt_input_hd-bwart = '702' OR gt_input_hd-bwart = '561' OR gt_input_hd-bwart = '562'  .code = '05'.
ELSE.code = '04'.
ENDIF.LOOP AT gt_input_it .gt_item-batch = gt_input_it-charg .     " 批次gt_item-material = gt_input_it-matnr.   " 物料gt_item-plant = gt_input_it-werks.      " 工厂gt_item-stge_loc = gt_input_it-lgobe.   " 库存地点gt_item-move_type = gt_input_hd-bwart.  " 移动类型gt_item-entry_qnt = gt_input_it-erfmg.  " 数量gt_item-entry_uom = gt_input_it-meins.  " 计量单位gt_item-spec_stock = gt_input_it-sobkz. "特殊库存标识gt_item-val_sales_ord = gt_input_it-kdauf. "销售订单gt_item-val_s_ord_item = gt_input_it-kdpos. "销售订单行项目
  •  gt_item-vendor = gt_input_hd-lifnr.     "供应商
    
  •  gt_item-customer = gt_input_hd-kunnr.   "客户
    
  •  gt_item-amount_lc = gt_input_hd-zprice. " 总金额 zprice
    gt_item-amount_lc = gt_input_it-dmbtr. " 金额CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'           "供应商EXPORTINGinput  = gt_input_it-lifnrIMPORTINGoutput = gt_item-vendor.CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'           "客户EXPORTINGinput  = gt_input_it-kunnrIMPORTINGoutput = gt_item-customer.
    
  •  IF gt_input_hd-sobkz = 'W'.
    
  •    gt_item-customer = gt_input_hd-lifnr.
    
  •  ELSE.
    
  •    gt_item-vendor = gt_input_hd-lifnr.
    
  •  ENDIF.APPEND gt_item.
    CLEAR gt_item.
    
  •  stprs        LIKE mbew-stprs  , " 系统标准单价
    
  •  zprice       LIKE goitem-dmbtr ,  " 系统计算总价
    

    ENDLOOP.

    IF gt_item[] IS NOT INITIAL.
    PERFORM exec_bapi USING ‘X’
    CHANGING gt_input_hd-zmess_h
    l_subrc.
    ENDIF.

    gt_input-zmess_h = gt_input_hd-zmess_h.

    IF l_subrc = 0.
    gt_input-icon = icon_led_green.
    ELSE.
    gt_input-icon = icon_led_red.
    ENDIF.

    MODIFY gt_input TRANSPORTING zmess_h icon WHERE zlsh = gt_input_hd-zlsh
    AND zhxm = 1.

    ENDLOOP.

ENDFORM.

FORM frm_imp_data.

DATA:l_answer TYPE c.
DATA:l_subrc TYPE sy-subrc.

CLEAR: g_header,g_mat,gt_item,gt_item[],gt_ret,gt_ret[],txt,code.

IF gt_input[] IS INITIAL.
MESSAGE e001(00) WITH ‘无批导数据’.
ENDIF.

READ TABLE gt_input WITH KEY icon = icon_led_red.
IF sy-subrc = 0.
MESSAGE e001(00) WITH ‘导入数据存在错误’.
ENDIF.

READ TABLE gt_input WITH KEY icon = icon_led_green.
IF sy-subrc <> 0.
MESSAGE e001(00) WITH ‘未运行导入检查’.
ENDIF.

READ TABLE gt_input INDEX 1.
IF gt_input-zmess_i IS NOT INITIAL.
MESSAGE e001(00) WITH ‘已生成物料凭证’.
ENDIF.

CALL FUNCTION ‘POPUP_TO_CONFIRM’
EXPORTING
titlebar = ‘提示’
text_question = ‘是否确认导入期初库存’
text_button_1 = ‘确认’
text_button_2 = ‘取消’
default_button = ‘2’
display_cancel_button = ’ ’
popup_type = ‘ICON_MESSAGE_WARNING’
IMPORTING
answer = l_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2.

CHECK l_answer = ‘1’.

REFRESH gt_ext.

LOOP AT gt_input_hd.

CLEAR:gt_input_it,gt_input_it[].
LOOP AT  gt_input WHERE zlsh = gt_input_hd-zlsh.gt_input_it = gt_input.APPEND gt_input_it.
ENDLOOP.
SORT gt_input_it BY zlsh zhxm.

BAPI*************
CLEAR: g_header,gt_item,gt_item[].

g_header-pstng_date = gt_input_hd-budat. " 凭证日期
g_header-doc_date   = gt_input_hd-bldat. " 过账日期
g_header-header_txt   = gt_input_hd-bktxt. " 抬头文本
  • "* header增强字段

  • gs_bapi_te_xmkpf-zemnum = gt_input_hd-zemnum.

  • gs_bapi_te_xmkpf-zprjvd = gt_input_hd-zprjvd.

  • gt_ext-structure = ‘BAPI_TE_XMKPF’.

  • gt_ext-valuepart1 = gs_bapi_te_xmkpf.

  • APPEND gt_ext.

  • CLEAR gt_ext.

  • CLEAR gs_bapi_te_xmkpf.

  • G_HEADER-ZEMNUM = GT_INPUT_HD-ZEMNUM. " 工号

  •  G_HEADER-ZPRJVD   = GT_INPUT_HD-ZPRJVD. " 施工单位
    

    " 移动类型
    IF gt_input_hd-bwart = ‘201’ OR gt_input_hd-bwart = ‘202’ OR gt_input_hd-bwart = ‘551’
    OR gt_input_hd-bwart = ‘552’ OR gt_input_hd-bwart = ‘261’ OR gt_input_hd-bwart = ‘262’.
    code = ‘03’.
    ELSEIF gt_input_hd-bwart = ‘701’ OR gt_input_hd-bwart = ‘702’ OR gt_input_hd-bwart = ‘561’ OR gt_input_hd-bwart = ‘562’ .
    code = ‘05’.
    ELSE.
    code = ‘04’.
    ENDIF.

    LOOP AT gt_input_it .

    gt_item-batch = gt_input_it-charg .     " 批次
    gt_item-material = gt_input_it-matnr.   " 物料
    gt_item-plant = gt_input_it-werks.      " 工厂
    gt_item-stge_loc = gt_input_it-lgobe.   " 库存地点
    gt_item-move_type = gt_input_hd-bwart.  " 移动类型
    gt_item-entry_qnt = gt_input_it-erfmg.  " 数量
    gt_item-entry_uom = gt_input_it-meins.  " 计量单位
    gt_item-spec_stock = gt_input_it-sobkz. "特殊库存标识
    gt_item-val_sales_ord = gt_input_it-kdauf. "销售订单
    gt_item-val_s_ord_item = gt_input_it-kdpos. "销售订单行项目
    
  •  gt_item-vendor = gt_input_hd-lifnr.     "供应商
    
  •  gt_item-customer = gt_input_hd-kunnr.   "客户
    
  •  gt_item-amount_lc = gt_input_hd-zprice. " 总金额 zprice
    gt_item-amount_lc = gt_input_it-dmbtr. " 金额CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'           "供应商EXPORTINGinput  = gt_input_it-lifnrIMPORTINGoutput = gt_item-vendor.CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'           "客户EXPORTINGinput  = gt_input_it-kunnrIMPORTINGoutput = gt_item-customer.
    
  •  IF gt_input_hd-sobkz = 'W'.
    
  •    gt_item-customer = gt_item-vendor.
    
  •  ELSE.
    
  •    gt_item-vendor = gt_item-customer.
    
  •  ENDIF.APPEND gt_item.
    CLEAR gt_item.
    
  •  stprs        LIKE mbew-stprs  , " 系统标准单价
    
  •  zprice       LIKE goitem-dmbtr ,  " 系统计算总价
    

    ENDLOOP.

    IF gt_item[] IS NOT INITIAL.
    PERFORM exec_bapi USING ‘’
    CHANGING gt_input_hd-zmess_i
    l_subrc.
    ENDIF.

    gt_input-zmess_h = ‘生成物料凭证’.
    gt_input-zmess_i = gt_input_hd-zmess_i.

    IF l_subrc = 0.
    gt_input-icon = icon_led_green.
    ELSE.
    gt_input-icon = icon_led_red.
    ENDIF.

    MODIFY gt_input TRANSPORTING zmess_h zmess_i icon WHERE zlsh = gt_input_hd-zlsh
    AND zhxm = 1.

    ENDLOOP.

ENDFORM.

更改物料特性BAPI变量******BEGIN

DATA: g_objek TYPE cuobn.
DATA: g_obtab TYPE tabelle.
DATA: g_klart TYPE klassenart.
DATA: g_class TYPE klasse_d.



DATA:g_objectkey LIKE bapi1003_key-object.
DATA:g_objecttable LIKE bapi1003_key-objecttable.
DATA:g_classnum LIKE bapi1003_key-classnum.
DATA:g_classtype LIKE bapi1003_key-classtype.
DATA:g_objectkey_long LIKE bapi1003_key-object_long.

DATA:gt_allocvaluesnumnew LIKE TABLE OF bapi1003_alloc_values_num WITH HEADER LINE.
DATA:gt_allocvaluescharnew LIKE TABLE OF bapi1003_alloc_values_char WITH HEADER LINE.
DATA:gt_allocvaluescurrnew LIKE TABLE OF bapi1003_alloc_values_curr WITH HEADER LINE.
DATA:gt_return LIKE TABLE OF bapiret2 WITH HEADER LINE.

更改物料特性BAPI变量******END

DATA:g_no(2) TYPE n . "当前字段
DATA g_field(50).
FIELD-SYMBOLS <fs_m>.
DATA: g_index TYPE i.

DATA g_msg TYPE string.

*特性值内表
DATA g_clint LIKE klah-clint.
DATA gt_ksml LIKE TABLE OF ksml WITH HEADER LINE.
DATA gs_cabn LIKE cabn.


FORM frm_imp_data_1 .

DATA:l_answer TYPE c.
DATA:l_subrc TYPE sy-subrc.

CLEAR: g_header,g_mat,gt_item,gt_item[],gt_ret,gt_ret[],txt,code.

IF gt_input[] IS INITIAL.
MESSAGE e001(00) WITH ‘无批导数据’.
ENDIF.

READ TABLE gt_input WITH KEY icon = icon_led_red.
IF sy-subrc = 0.
MESSAGE e001(00) WITH ‘导入数据存在错误’.
ENDIF.

CLEAR:gt_input_it,gt_input_it[].
LOOP AT gt_input WHERE class IS NOT INITIAL.
gt_input_it = gt_input.
APPEND gt_input_it.
ENDLOOP.

SORT gt_input_it BY zlsh zhxm.

*******更改物料特性BAPIBEGIN

LOOP AT gt_input_it.

CALL FUNCTION 'VB_BATCH_2_CLASS_OBJECT'EXPORTINGi_matnr = gt_input_it-matnr "物料编号i_charg = gt_input_it-charg "批次i_werks = gt_input_it-werks "工厂IMPORTINGe_objek = g_objek "对象名 (物料 + 批次) '000000101110001013                      Y121710003'e_obtab = g_obtab "'MCH1'e_klart = g_klart "类别种类 '023'e_class = g_class. "类别 'Z_101306_001'.

*特性类别

g_objectkey = g_objek.   "对象名 (物料 + 批次)
g_objecttable = g_obtab. "'MCH1'
g_classnum = g_class.    ""类别
g_classtype = g_klart.   "类别种类
g_objectkey_long = g_objek."对象名 (物料 + 批次)SELECT SINGLE clintINTO g_clintFROM klahWHERE klart = g_classtypeAND class = g_classnum.IF sy-subrc = 0.SELECT *INTO TABLE gt_ksmlFROM ksmlWHERE clint = g_clint.
ENDIF.SORT gt_ksml BY clint posnr.LOOP AT gt_ksml WHERE posnr <= 13.SELECT SINGLE *INTO gs_cabnFROM cabnWHERE atinn =  gt_ksml-imerk.g_index = sy-tabix.g_no = g_index.CONCATENATE 'GT_INPUT_IT-MWERT' g_no INTO g_field.ASSIGN (g_field) TO <fs_m>.IF gs_cabn-atfor =  'NUM'.IF <fs_m> IS ASSIGNED.gt_allocvaluesnumnew-charact = gs_cabn-atnam. "'ZDY_YJ_SI'gt_allocvaluesnumnew-value_from = <fs_m>.APPEND gt_allocvaluesnumnew.ENDIF.ELSEIF gs_cabn-atfor = 'CHAR'.gt_allocvaluescharnew-charact = gs_cabn-atnam. "'ZDY_YJ_SI'gt_allocvaluescharnew-value_char = <fs_m>.gt_allocvaluescharnew-value_neutral = <fs_m>.gt_allocvaluescharnew-value_char_long = <fs_m>.gt_allocvaluescharnew-value_neutral_long = <fs_m>.APPEND gt_allocvaluescharnew.ENDIF.ENDLOOP.

CALL FUNCTION 'BAPI_OBJCL_CHANGE'EXPORTINGobjectkey          = g_objectkeyobjecttable        = g_objecttableclassnum           = g_classnumclasstype          = g_classtype
  •   STATUS             = '1'
    
  •   STANDARDCLASS      =
    
  •   CHANGENUMBER       =
    
  •   KEYDATE            = SY-DATUM
    
  •   NO_DEFAULT_VALUES  = ' '
    
  •   KEEP_SAME_DEFAULTS = ' 'objectkey_long     = g_objectkey_long
    
  • IMPORTING

  •   CLASSIF_STATUS     =
    TABLESallocvaluesnumnew  = gt_allocvaluesnumnew[]allocvaluescharnew = gt_allocvaluescharnew[]allocvaluescurrnew = gt_allocvaluescurrnew[]return             = gt_return[].
    

    READ TABLE gt_return WITH KEY type = ‘E’.

    IF sy-subrc = 0.

    CLEAR g_msg.LOOP AT gt_return.CONCATENATE g_msggt_return-idgt_return-message_v1gt_return-message_v2gt_return-message_v3gt_return-message_v4gt_return-messageINTO g_msg SEPARATED BY ','.CONDENSE g_msg NO-GAPS.
    ENDLOOP.gt_input-zmess_h = '错误'.
    gt_input-zmess_i = g_msg.
    gt_input-icon = icon_led_red.
    

    ELSE .

    gt_input-icon = icon_led_green.
    gt_input-zmess_h = '成功'.
    COMMIT WORK AND WAIT.
    

    ENDIF.

    MODIFY gt_input TRANSPORTING zmess_h zmess_i icon WHERE zlsh = gt_input_it-zlsh
    AND zhxm = gt_input_it-zhxm.

*******更改物料特性BAPIEND
ENDLOOP.

ENDFORM.

&---------------------------------------------------------------------
*& Form EXEC_BAPI
&---------------------------------------------------------------------

  •   text
    

----------------------------------------------------------------------
FORM exec_bapi USING p_test
CHANGING p_msg
p_subrc.

CALL FUNCTION ‘BAPI_GOODSMVT_CREATE’
EXPORTING
goodsmvt_header = g_header
goodsmvt_code = code
testrun = p_test

  • GOODSMVT_REF_EWM =
    

    IMPORTING

  • GOODSMVT_HEADRET =
    materialdocument = g_mat
    
  • MATDOCUMENTYEAR  =
    

    TABLES
    goodsmvt_item = gt_item[]

  • GOODSMVT_SERIALNUMBER   =
    return           = gt_ret[]
    
  • GOODSMVT_SERV_PART_DATA =
    extensionin      = gt_ext.
    

    READ TABLE gt_ret WITH KEY type = ‘E’.

    IF sy-subrc = 0.

    LOOP AT gt_ret.
    CONCATENATE p_msg
    gt_ret-id
    gt_ret-message_v1
    gt_ret-message_v2
    gt_ret-message_v3
    gt_ret-message_v4
    gt_ret-message
    INTO p_msg SEPARATED BY ‘,’.
    ENDLOOP.

    p_subrc = 1.

    ELSE .

    IF p_test = ‘X’.
    p_msg = ‘测试成功’.
    ELSE.
    p_msg = g_mat.
    COMMIT WORK AND WAIT.
    ENDIF.
    p_subrc = 0.
    ENDIF.

ENDFORM . "EXEC_BAPI

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

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

相关文章

uni-app 面容、指纹识别插件(uni-face-login)

面容、指纹识别插件(uni-face-login) 介绍 人脸指纹登录授权&#xff0c;可以使用手机自带的人脸、指纹进行生物识别&#xff0c;进而判断是否机主本人&#xff0c;从而进行授权验证&#xff0c;适配安卓、iOS、鸿蒙设备 猛戳这里去插件市场看看 使用 该插件支持鸿蒙、安卓…

UE4/5C++多线程插件制作(二十一、使用)

目录 DemoPawn.h DemoPawn.cpp 会出现的bug 插件 相关的插件制作在上一节已经完成了。 具体的使用方式在第0章已经写了,get之后去绑定即可。 而后笔者做了一个接口,具体的绑定方式也就在这个接口里面。 接下来最重要的是进行使用,对此我做了一个与蓝图相关的接口,里…

TypeScript教程(一)简介与安装

一、简介 TypeScript 是 JavaScript 的一个超集&#xff0c;扩展了JavaScript的语法&#xff0c;因此现有的JavaScript可与TypeScript一起工作无需修改&#xff0c;支持 ECMAScript 6 标准&#xff08;ES6 教程&#xff09;。 语言特性&#xff1a; 1.类型批注和编译时类型检…

怎么学习AJAX相关技术? - 易智编译EaseEditing

学习AJAX&#xff08;Asynchronous JavaScript and XML&#xff09;相关技术可以让你实现网页的异步数据交互&#xff0c;提升用户体验。以下是一些学习AJAX技术的步骤和资源&#xff1a; HTML、CSS和JavaScript基础&#xff1a; 首先&#xff0c;确保你已经掌握了基本的HTML…

【Redis】Redis三种集群模式-主从、哨兵、集群各自架构的优点和缺点对比

文章目录 前言1. 单机模式2. 主从架构3. 哨兵4. 集群模式总结 前言 如果Redis的读写请求量很大&#xff0c;那么单个实例很有可能承担不了这么大的请求量&#xff0c;如何提高Redis的性能呢&#xff1f;你也许已经想到了&#xff0c;可以部署多个副本节点&#xff0c;业务采用…

Android系统-进程-Binder1-概述

目录 引言&#xff1a; 一次拷贝 Binder一次通信过程 应用启动中的binder交互 C/S模式&#xff1a; Binder COMMAND BWR数据结构&#xff1a; 引言&#xff1a; Android的binder是从openbinder发展过来的。包括了binder驱动&#xff0c;Native层&#xff0c;Java层。用…

光耦继电器:实现电气隔离的卓越选择

光耦继电器是一种常用的电子元件&#xff0c;用于实现电气隔离和信号传输。在工业控制、自动化系统和电力电子等领域&#xff0c;光耦继电器具有独特的特点和优势。本文将从可靠性、隔离性、响应速度和适应性等方面对光耦继电器的特点进行概述。 光耦继电器是一种典型的固态继电…

Mysql内储存JSON字符串,根据条件进行查询(包含多层级复杂JSON查询)

1.模糊查询json类型字段 存储的数据格式&#xff08;字段名 people_json&#xff09;&#xff1a; {“name”: “zhangsan”, “age”: “13”, “gender”: “男”} 代码如下&#xff08;示例&#xff09;&#xff1a; select * from table_name where people_json->$.n…

部署工业物联网可以选择哪些通信方案?

部署工业物联网有诸多意义&#xff0c;诸如提升生产效率&#xff0c;降低管理成本&#xff0c;保障生产品质稳定&#xff0c;应对长期从业劳动力变化趋势等。针对不同行业、场景&#xff0c;工业物联网需要选择不同的通信方案&#xff0c;以达到成本和效益的最佳平衡。本篇就简…

安全头响应头(三)​X-Content-Type-Options

一 X-Content-Type-Options响应头 说明&#xff1a;先写个框架,后续补充 思考&#xff1a;请求类型是 "style" 和 "script" 是什么意思? script标签 style StyleSheet JavaScript MIME type 文件扩展和Content-Type的映射关系 场景&#xff1a; 一个…

Mybatis 源码 ∞ :杂七杂八

文章目录 一、前言二、TypeHandler三、KeyGenerator四、Plugin1 Interceptor2 org.apache.ibatis.plugin.Plugin3. 调用场景 五、Mybatis 嵌套映射 BUG1. 示例2. 原因3. 解决方案 六、discriminator 标签七、其他1. RowBounds2. ResultHandler3. MapKey 一、前言 Mybatis 官网…

mysql主从复制搭建(一主一从)

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言MySQL复制过程分为三部&#xff1a; 一、准备工作二、配置>主库Master三、配置>从库SlaveSlave_IO_Running: YesSlave_SQL_Running: Yes 四、测试至此&am…

8 | 美国航班数据分析

"在现代快节奏的生活中,航空旅行已经成为人们出行的重要方式之一。然而,航班的准时性一直以来都是旅客和航空公司关注的焦点。无论是商务出差还是休闲度假,乘客们都希望能够在既定的时间内安全、准时地到达目的地。而对于航空公司而言,准点运营不仅关乎乘客体验,还涉…

TCP的相关性质

文章目录 流量控制拥塞控制拥塞窗口 延迟应答捎带应答面向字节流粘包问题TCP的异常 流量控制 由于接收端处理数据的速度是有限的&#xff0c;如果发送端发的太快&#xff0c;那么接收端的缓冲区就可能会满。此时如果发送端还发数据&#xff0c;就会出现丢包现象&#xff0c;并…

轻量级自动化测试框架WebZ

一、什么是WebZ WebZ是我用Python写的“关键字驱动”的自动化测试框架&#xff0c;基于WebDriver。 设计该框架的初衷是&#xff1a;用自动化测试让测试人员从一些简单却重复的测试中解放出来。之所以用“关键字驱动”模式是因为我觉得这样能让测试人员&#xff08;测试执行人员…

【Sklearn】基于线性判别法的数据分类预测(Excel可直接替换数据)

【Sklearn】基于线性判别法的数据分类预测(Excel可直接替换数据) 1.模型原理2.模型参数3.文件结构4.Excel数据5.下载地址6.完整代码7.运行结果1.模型原理 线性判别分析(Linear Discriminant Analysis,简称LDA)是一种经典的模式识别和分类方法,它的目标是找到一个投影,将…

Linux系列讲解 —— FTP协议的应用

简单介绍一下FTP文件传输协议在linux系统中的应用。 目录 0. 基本概念1. FTP Server1.1 安装FTP Server1.2 FTP Server开启和关闭1.3 查看FTP Server是否开启1.4 FTP服务器配置 2. FTP Client2.1 lftp2.2 ftp2.3 sftp2.4 文件资源管理器集成的ftp和sftp 3. ftp常用命令 0. 基本…

IDE的下载和使用

IDE 文章目录 IDEJETBRAIN JETBRAIN 官网下载对应的ide 激活方式 dxm的电脑已经把这个脚本下载下来了&#xff0c;脚本是macjihuo 以后就不用买了

Neo4j之SET基础

在 Neo4j 中&#xff0c;SET 语句用于更新节点或关系的属性。它允许你修改节点或关系的属性值&#xff0c;可以单独使用&#xff0c;也可以与其他查询语句&#xff08;如 MATCH、CREATE、MERGE 等&#xff09;一起使用。以下是一些使用 SET 语句的常见例子&#xff0c;以及它们…

深入源码分析kubernetes informer机制(四)DeltaFIFO

[阅读指南] 这是该系列第四篇 基于kubernetes 1.27 stage版本 为了方便阅读&#xff0c;后续所有代码均省略了错误处理及与关注逻辑无关的部分。 文章目录 client-go中的存储结构DeltaFIFOdelta索引 keyqueue push操作delta push 去重 queue pop操作 总结 client-go中的存储结构…