SAP_ABAP_FUNCTION_ALV案例

SAP ABAP顾问能力模型梳理_企业数字化建设者的博客-CSDN博客SAP Abap顾问能力模型https://blog.csdn.net/java_zhong1990/article/details/132469977

一、Function ALV

1.1 基于退货采购订单创建,解释 FUNCTION_ALV开发的程序结构与代码模板参考

1.2 程序结构 top|sel|frm|pbo|pai


*&---------------------------------------------------------------------*
*& Report ZMMRP008
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*REPORT zmmrp008.*******************************************************
*程序名: zmmrp008
*程序描述:退货采购订单创建
*----------------------------------------------------------------------
*创建日期 ABAP开发顾问 业务顾问
*2019.09.19. 
*===============================================
*修改请求号 修改日期 修改人 修改描述
*xxxxxxxx xxxx.xx.xx xxxxxxxx xxxxxxxx
*******************************************************INCLUDE zrp008_top.INCLUDE zrp008_sel.INCLUDE zrp008_frm.INCLUDE zrp008_pbo.INCLUDE zrp008_pai.*------------------------------------------------------------------------*
* INITIALIZATION *
*------------------------------------------------------------------------*
INITIALIZATION."第一次打开屏幕或者点击执行代码已经执行完成重新显示屏幕的时候会运行
*(1).只能用于报表程序
*(2).在选择屏幕出现之前执行.
*(3).通常的用法是在这里给选择屏幕中的字段赋值。*------------------------------------------------------------------------*
* AT SELECTION-SCREEN *
*------------------------------------------------------------------------*
AT SELECTION-SCREEN."当在选择屏幕上有做操作的时候都会进入到这个事件
* 选择屏幕PAI事件,检查用户数据正确性和全部字段一致性,发生错误所有元素可重新输入
* 在这里我们可以用来检查输入的参数是否有问题"选择屏幕至少需要填写一个字段PERFORM check_inputterm.*------------------------------------------------------------------------*
* START-OF-SELECTION *
*------------------------------------------------------------------------*
START-OF-SELECTION."当触发执行的时候屏幕
* 选择开始事件(默认事件),在选择屏幕的处理结束后触发PERFORM get_data. "可以创建一个子程序用来做数据处理的
* PERFORM set_catalog. "可以创建一个子程序用来设置显示字段的信息PERFORM prm_bulid_field.PERFORM display_alv. "这个子程序可以用来显示ALV*------------------------------------------------------------------------*
* END-OF-SELECTION *
*------------------------------------------------------------------------*
END-OF-SELECTION."在选择屏处理完逻辑数据之后(会重新调用屏幕所以会触发INITIALIZATION)
* 选择结束事件,在所有逻辑数据库处理结束后触发,一般用于输出列表
*&---------------------------------------------------------------------*
*& Form CHECK_INPUTTERM
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------**&---------------------------------------------------------------------*
*& 包含               ZRP008_TOP
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
*                      GLOBLE-DEFINATION             *
*----------------------------------------------------------------------*TABLES ztmm_incom_list."来料单号
TABLES ekpo.
TABLES ekko.
TYPES: BEGIN OF gy_data," 定义最终显示的结构check(2)     TYPE c,bukrs        TYPE ekko-bukrs, "公司代码incom        TYPE ztmm_incom_list-incom, "来料单号item         TYPE ztmm_incom_list-item, "来料单项次bsart        TYPE ekko-bsart, "采购订单类型ebeln        TYPE ekko-ebeln, "采购订单号ebelp        TYPE ekpo-ebelp, "采购订单项次menge        TYPE ekpo-menge, "数量meins        TYPE ekpo-meins, "单位matnr        TYPE ekpo-matnr, "物资编码txz01        TYPE ekpo-txz01, "物料描述mfrpn        TYPE ekpo-mfrpn, "原厂码subcode      TYPE ekpo-subcode, "Subcodewerks        TYPE ekpo-werks, "工厂lgort        TYPE ekpo-lgort, "库存地点ekorg        TYPE ekko-ekorg, "采购组织ekgrp        TYPE ekko-ekgrp, "采购组netpr_co     TYPE ztmm_incom_list-netpr_co, "采购价格-含税netpr        TYPE ekpo-netpr, "采购价格-未税peinh        TYPE ekpo-peinh, "价格基数waers        TYPE ekko-waers, "采购货币mwskz        TYPE ekpo-mwskz, "税码lifnr        TYPE ekko-lifnr, "供应商name1        TYPE lfa1-name1, "采购供应商名称kbetr        TYPE  konp-kbetr, "条件金额(借用辅助计算字段)effwr        TYPE  ekpo-effwr, "税率 (借用辅助计算字段)status(2)    TYPE  c, "退货订单创建状态message(255) TYPE c, "退货订单创建消息END OF gy_data.
DATA gs_data TYPE gy_data.
DATA gt_data TYPE TABLE OF gy_data.
DATA gs_data_copy TYPE gy_data.
DATA gt_data_copy TYPE TABLE OF gy_data.DATA gt_data_success_log TYPE TABLE OF gy_data. "采购退货订单创建成功记录
DATA gs_data_success_log TYPE gy_data.DATA gt_data_temp TYPE TABLE OF gy_data. "临时存放
DATA gs_data_temp TYPE gy_data.DATA: gv_ok_code LIKE sy-ucomm.
DATA: gt_fieldcat_lvc TYPE lvc_t_fcat, "ALV:定义一个先显示字段的表gs_fieldcat_lvc LIKE LINE OF gt_fieldcat_lvc. "ALV:定义一个先显示字段的结构体&---------------------------------------------------------------------*
*& 包含               ZRP008_FRM
*&---------------------------------------------------------------------**&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM get_data.SELECTekko~bukrs "公司代码ztmm_incom_list~incom "来料单ztmm_incom_list~item "项次ztmm_incom_list~ebeln "采购订单号ztmm_incom_list~ebelp  "采购订单项次ztmm_incom_list~matnr "物资编码makt~maktx AS txz01ztmm_incom_list~menge "数量ztmm_incom_list~meins "订单单位ztmm_incom_list~netpr_co "采购含税价ztmm_incom_list~peinh "价格基数ztmm_incom_list~netpr "采购未税价格ztmm_incom_list~mwskz "税码ekko~bsart "取采购凭证类型ekko~lifnr "供应商lfa1~name1 "供应商名称ekko~ekorg "采购组织ekko~ekgrp "采购组ekpo~werks "工厂ekpo~lgort"库存地点ekpo~subcode"SUBCODEekpo~factory_code"厂家码
*      ekpo~factory_codeINTO CORRESPONDING FIELDS OF TABLE gt_dataFROM ztmm_incom_listINNER JOIN ekko ON ztmm_incom_list~ebeln = ekko~ebelnINNER JOIN ekpo ON ztmm_incom_list~ebeln = ekpo~ebeln AND  ztmm_incom_list~ebelp = ekpo~ebelpINNER JOIN lfa1 ON ekko~lifnr = lfa1~lifnrLEFT JOIN makt ON makt~matnr = ztmm_incom_list~matnrWHEREztmm_incom_list~incom IN so_incom ANDztmm_incom_list~item IN so_item ANDztmm_incom_list~ebeln IN so_ebeln ANDztmm_incom_list~ebelp IN so_ebelp ANDztmm_incom_list~matnr IN so_matnr ANDekko~lifnr IN so_lifnr."根据税码取税率IF gt_data IS NOT INITIAL.DATA lt_ftaxp TYPE TABLE OF ftaxp.DATA ls_ftaxp TYPE ftaxp.LOOP AT gt_data INTO gs_data."税码转换成税率CALL FUNCTION 'GET_TAX_PERCENTAGE'EXPORTINGaland   = 'CN'datab   = sy-datummwskz   = gs_data-mwskztxjcd   = 'TAXBRA'
*         EXPORT  = ' 'TABLESt_ftaxp = lt_ftaxp.IF sy-subrc = 0.READ TABLE lt_ftaxp INTO ls_ftaxp INDEX 1.gs_data-effwr = ls_ftaxp-kbetr / 1000.gs_data-kbetr = ls_ftaxp-kbetr.ENDIF."单位转换CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'EXPORTINGinput    = gs_data-meinslanguage = sy-languIMPORTING
*         LONG_TEXT            =output   = gs_data-meins
*         SHORT_TEXT           =
*       EXCEPTIONS
*         UNIT_NOT_FOUND       = 1
*         OTHERS   = 2.IF sy-subrc = 0.ENDIF.MODIFY gt_data FROM gs_data.ENDLOOP.ENDIF.
ENDFORM.FORM check_inputterm .DATA lv_times TYPE num10.lv_times  = 0.IF so_incom IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_item IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_ebeln IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_ebelp IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_matnr IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_lifnr IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF lv_times = 0.MESSAGE '选择屏幕至少需要填写一个字段!' TYPE 'E'.ENDIF.ENDFORM.*DATA: fieldcat  TYPE lvc_t_fcat.
FORM prm_bulid_field .PERFORM create_fieldcat USING:gt_fieldcat_lvc 'BUKRS' '公司代码' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'INCOM' '来料单号' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'ITEM' '来料单项次' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'BSART' '采购订单类型' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'EBELN' '采购订单号' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'EBELP' '采购订单项次' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'MATNR' '物资编码' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'MENGE' '数量' '' 'X' '' '' '' '' '' '' '' '' '' 'QUAN' 'C',gt_fieldcat_lvc 'MEINS' '单位' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'TXZ01' '物料描述' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'FACTORY_CODE' '厂家码' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'SUBCODE' 'SUBCODE' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'WERKS' '工厂' '' 'X' '' '' '' '' '' '' '' 'T001W' 'WERKS' '' '',gt_fieldcat_lvc 'LGORT' '库存地点' '' 'X' '' '' '' '' '' 'X' '' '' '' '' '',gt_fieldcat_lvc 'EKORG' '采购组织' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'EKGRP' '采购组' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'NETPR_CO' '采购价格-含税' '' '' '' '' '' '' '' '' '' '' '' 'CURR' '',gt_fieldcat_lvc 'NETPR' '采购价格-未税' '' 'X' '' '' '' '' '' '' '' '' '' 'CURR' '',gt_fieldcat_lvc 'PEINH' '价格基数' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'WAERS' '采购货币' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'MWSKZ' '税码' '' '' '' '' '' '' '' '' '' 'EKPO' 'MWSKZ' '' '',gt_fieldcat_lvc 'LIFNR' '供应商' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'NAME1' '采购供应商名称' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'STATUS' '状态' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'MESSAGE' '消息' '30' '' '' '' '' '' '' '' '' '' '' '' ''.
ENDFORM.FORM create_fieldcat  USING p0 TYPE lvc_t_fcat p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15.DATA: l_alv_filed  TYPE lvc_s_fcat.l_alv_filed-fieldname     =  p1.  "内表中的字段 大写l_alv_filed-reptext       =  p2.  "表头的文本l_alv_filed-outputlen     =  p3.  "字段长度l_alv_filed-edit          =  p4.  "是否编辑l_alv_filed-convexit      =  p5.  "转换例程l_alv_filed-key           =  p6.  "左右滑动 固定列l_alv_filed-do_sum        =  p7.  "汇总l_alv_filed-checkbox      =  p8.  "CHECK BOXl_alv_filed-no_zero       =  p9.  "LV 控制: 为输出隐藏零l_alv_filed-hotspot       =  p10. "当击敏感l_alv_filed-qfieldname    =  p11. "参考单位l_alv_filed-f4availabl    = 'X'.  "是否有搜索帮助l_alv_filed-ref_table     =  p12. "内表对应的搜索帮助表l_alv_filed-ref_field     =  p13. "内表对应的搜索帮助字段l_alv_filed-datatype      =  p14. "输出类型l_alv_filed-inttype       =  p15. ""指定该字段类型APPEND l_alv_filed TO p0.CLEAR l_alv_filed.
ENDFORM.*&---------------------------------------------------------------------*
*& Form DISPLAY_ALV
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM display_alv .DATA: ls_layout TYPE lvc_s_layo.IF gt_data IS NOT INITIAL.ls_layout-zebra = 'X'.ls_layout-box_fname = 'CHECK'.  "指定行选择字段ls_layout-cwidth_opt = 'X'."---------------enterDATA: gt_event TYPE slis_t_event WITH HEADER LINE,ref_grid TYPE REF TO cl_gui_alv_grid.gt_event-name = 'CALLER_EXIT'.gt_event-form = 'FM_BUTTON'.APPEND gt_event .CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'EXPORTINGi_callback_program       = sy-repid "这里是调用这个ALV的程序名i_callback_pf_status_set = 'PF_STATUS' "设置ALV状态栏的函数i_callback_user_command  = 'USER_COMMAND' "获取用户事件的函数is_layout_lvc            = ls_layout "显示的布局it_fieldcat_lvc          = gt_fieldcat_lvc "设置显示的字段以及字段的功能it_events                = gt_event[]TABLESt_outtab                 = gt_dataEXCEPTIONSprogram_error            = 1.IF sy-subrc <> 0.ENDIF.ELSE.
* 这个消息用来显示我们是不是获取到了数据,自己用的时候把这个硬代码换成你需要的TEXT-XXX.MESSAGE '没有获取到数据,请重新检索!' TYPE 'S' DISPLAY LIKE 'E'.LEAVE TO LIST-PROCESSING.EXIT.ENDIF.ENDFORM.CLASS lcl_event_receiver DEFINITION.PUBLIC SECTION.METHODS handle_modifyFOR EVENT data_changed_finished OF cl_gui_alv_gridIMPORTING e_modified et_good_cells.
ENDCLASS. "LCL_EVENT_RECEIVER DEFINITIONDATA: ref_grid TYPE REF TO cl_gui_alv_grid.
CLASS lcl_event_receiver IMPLEMENTATION.METHOD handle_modify.DATA stbl TYPE lvc_s_stbl.PERFORM frm_refresh_alv.stbl-row = 'x'." 基于行的稳定刷新stbl-col = 'x'." 基于列稳定刷新CALL METHOD ref_grid->refresh_table_displayEXPORTINGis_stable = stbl.ENDMETHOD. "HANDLE_MODIFY
ENDCLASS. "LCL_EVENT_RECEIVER IMPLEMENTATIONDATA:gt_event_receiver TYPE REF TO lcl_event_receiver."实现FM_BUTTON:
FORM fm_button USING e_grid TYPE slis_data_caller_exit.CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'IMPORTINGe_grid = ref_grid."设置enter事件CALL METHOD ref_grid->register_edit_eventEXPORTINGi_event_id = cl_gui_alv_grid=>mc_evt_enterEXCEPTIONSerror      = 1OTHERS     = 2.CREATE OBJECT gt_event_receiver.SET HANDLER gt_event_receiver->handle_modify FOR ref_grid.
ENDFORM. "FM_BUTTON
*&---------------------------------------------------------------------*
*& Form FRM_REFRESH_ALV
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM frm_refresh_alv ."全表更新 含税价。CLEAR gs_data.IF gt_data IS NOT INITIAL.LOOP AT gt_data INTO gs_data.IF gs_data-netpr IS NOT INITIAL.gs_data-netpr_co = gs_data-netpr * ( 1 + gs_data-effwr ).MODIFY gt_data FROM gs_data.ENDIF.ENDLOOP.ENDIF.
ENDFORM.*&---------------------------------------------------------------------*
*& 包含               ZRP008_FRM
*&---------------------------------------------------------------------**&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM get_data.SELECTekko~bukrs "公司代码ztmm_incom_list~incom "来料单ztmm_incom_list~item "项次ztmm_incom_list~ebeln "采购订单号ztmm_incom_list~ebelp  "采购订单项次ztmm_incom_list~matnr "物资编码makt~maktx AS txz01ztmm_incom_list~menge "数量ztmm_incom_list~meins "订单单位ztmm_incom_list~netpr_co "采购含税价ztmm_incom_list~peinh "价格基数ztmm_incom_list~netpr "采购未税价格ztmm_incom_list~mwskz "税码ekko~bsart "取采购凭证类型ekko~lifnr "供应商lfa1~name1 "供应商名称ekko~ekorg "采购组织ekko~ekgrp "采购组ekpo~werks "工厂ekpo~lgort"库存地点ekpo~subcode"SUBCODEekpo~factory_code"厂家码
*      ekpo~factory_codeINTO CORRESPONDING FIELDS OF TABLE gt_dataFROM ztmm_incom_listINNER JOIN ekko ON ztmm_incom_list~ebeln = ekko~ebelnINNER JOIN ekpo ON ztmm_incom_list~ebeln = ekpo~ebeln AND  ztmm_incom_list~ebelp = ekpo~ebelpINNER JOIN lfa1 ON ekko~lifnr = lfa1~lifnrLEFT JOIN makt ON makt~matnr = ztmm_incom_list~matnrWHEREztmm_incom_list~incom IN so_incom ANDztmm_incom_list~item IN so_item ANDztmm_incom_list~ebeln IN so_ebeln ANDztmm_incom_list~ebelp IN so_ebelp ANDztmm_incom_list~matnr IN so_matnr ANDekko~lifnr IN so_lifnr."根据税码取税率IF gt_data IS NOT INITIAL.DATA lt_ftaxp TYPE TABLE OF ftaxp.DATA ls_ftaxp TYPE ftaxp.LOOP AT gt_data INTO gs_data."税码转换成税率CALL FUNCTION 'GET_TAX_PERCENTAGE'EXPORTINGaland   = 'CN'datab   = sy-datummwskz   = gs_data-mwskztxjcd   = 'TAXBRA'
*         EXPORT  = ' 'TABLESt_ftaxp = lt_ftaxp.IF sy-subrc = 0.READ TABLE lt_ftaxp INTO ls_ftaxp INDEX 1.gs_data-effwr = ls_ftaxp-kbetr / 1000.gs_data-kbetr = ls_ftaxp-kbetr.ENDIF."单位转换CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'EXPORTINGinput    = gs_data-meinslanguage = sy-languIMPORTING
*         LONG_TEXT            =output   = gs_data-meins
*         SHORT_TEXT           =
*       EXCEPTIONS
*         UNIT_NOT_FOUND       = 1
*         OTHERS   = 2.IF sy-subrc = 0.ENDIF.MODIFY gt_data FROM gs_data.ENDLOOP.ENDIF.
ENDFORM.FORM check_inputterm .DATA lv_times TYPE num10.lv_times  = 0.IF so_incom IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_item IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_ebeln IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_ebelp IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_matnr IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF so_lifnr IS NOT INITIAL.lv_times = lv_times + 1.ENDIF.IF lv_times = 0.MESSAGE '选择屏幕至少需要填写一个字段!' TYPE 'E'.ENDIF.ENDFORM.*DATA: fieldcat  TYPE lvc_t_fcat.
FORM prm_bulid_field .PERFORM create_fieldcat USING:gt_fieldcat_lvc 'BUKRS' '公司代码' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'INCOM' '来料单号' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'ITEM' '来料单项次' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'BSART' '采购订单类型' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'EBELN' '采购订单号' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'EBELP' '采购订单项次' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'MATNR' '物资编码' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'MENGE' '数量' '' 'X' '' '' '' '' '' '' '' '' '' 'QUAN' 'C',gt_fieldcat_lvc 'MEINS' '单位' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'TXZ01' '物料描述' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'FACTORY_CODE' '厂家码' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'SUBCODE' 'SUBCODE' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'WERKS' '工厂' '' 'X' '' '' '' '' '' '' '' 'T001W' 'WERKS' '' '',gt_fieldcat_lvc 'LGORT' '库存地点' '' 'X' '' '' '' '' '' 'X' '' '' '' '' '',gt_fieldcat_lvc 'EKORG' '采购组织' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'EKGRP' '采购组' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'NETPR_CO' '采购价格-含税' '' '' '' '' '' '' '' '' '' '' '' 'CURR' '',gt_fieldcat_lvc 'NETPR' '采购价格-未税' '' 'X' '' '' '' '' '' '' '' '' '' 'CURR' '',gt_fieldcat_lvc 'PEINH' '价格基数' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'WAERS' '采购货币' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'MWSKZ' '税码' '' '' '' '' '' '' '' '' '' 'EKPO' 'MWSKZ' '' '',gt_fieldcat_lvc 'LIFNR' '供应商' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'NAME1' '采购供应商名称' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'STATUS' '状态' '' '' '' '' '' '' '' '' '' '' '' '' '',gt_fieldcat_lvc 'MESSAGE' '消息' '30' '' '' '' '' '' '' '' '' '' '' '' ''.
ENDFORM.FORM create_fieldcat  USING p0 TYPE lvc_t_fcat p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15.DATA: l_alv_filed  TYPE lvc_s_fcat.l_alv_filed-fieldname     =  p1.  "内表中的字段 大写l_alv_filed-reptext       =  p2.  "表头的文本l_alv_filed-outputlen     =  p3.  "字段长度l_alv_filed-edit          =  p4.  "是否编辑l_alv_filed-convexit      =  p5.  "转换例程l_alv_filed-key           =  p6.  "左右滑动 固定列l_alv_filed-do_sum        =  p7.  "汇总l_alv_filed-checkbox      =  p8.  "CHECK BOXl_alv_filed-no_zero       =  p9.  "LV 控制: 为输出隐藏零l_alv_filed-hotspot       =  p10. "当击敏感l_alv_filed-qfieldname    =  p11. "参考单位l_alv_filed-f4availabl    = 'X'.  "是否有搜索帮助l_alv_filed-ref_table     =  p12. "内表对应的搜索帮助表l_alv_filed-ref_field     =  p13. "内表对应的搜索帮助字段l_alv_filed-datatype      =  p14. "输出类型l_alv_filed-inttype       =  p15. ""指定该字段类型APPEND l_alv_filed TO p0.CLEAR l_alv_filed.
ENDFORM.*
*
**&---------------------------------------------------------------------*
**& Form SET_CATALOG
**&---------------------------------------------------------------------*
**& text
**&---------------------------------------------------------------------*
**& -->  p1        text
**& <--  p2        text
**&---------------------------------------------------------------------*
*FORM set_catalog .
*  DATA:lv_position TYPE i VALUE 1.
*  CLEAR: lv_position.
*  lv_position = lv_position + 1.
** 预定义一个输出模式
*  DEFINE df_fieldcat.
*    CLEAR gs_fieldcat_lvc.
*    gs_fieldcat_lvc-col_pos = lv_position."ALV 控制: 输出列
*    gs_fieldcat_lvc-scrtext_m   = &1."中字段标签
*    gs_fieldcat_lvc-fieldname = &2."ALV 控制: 内部表字段的字段名称
*    gs_fieldcat_lvc-no_zero = &3."ALV 控制: 为输出隐藏零
*    gs_fieldcat_lvc-checkbox = &4."ALV 控制: 作为复选框输出
*    gs_fieldcat_lvc-edit = &5."设置可编辑模式
*    gs_fieldcat_lvc-hotspot = &6."ALV 控制: 单击敏感
**    gs_fieldcat_lvc-outputlen = &7."输出长度
*    gs_fieldcat_lvc-datatype = &7."输出类型
*    gs_fieldcat_lvc-f4availabl = 'X'."是否有搜索帮助
**    gs_fieldcat_lvc-qfieldname = &8. "参考单位
**    gs_fieldcat_lvc-convexit = &9."转换例程
*    gs_fieldcat_lvc-ref_table = &8."内表对应的搜索帮助表
*    gs_fieldcat_lvc-ref_field = &9."内表对应的搜索帮助字段
*
*    APPEND gs_fieldcat_lvc TO gt_fieldcat_lvc.
*    ADD 1 TO lv_position.
*  END-OF-DEFINITION.
*  df_fieldcat:
*   '公司代码' 'BUKRS' '' '' '' '' '' '' '',
*   '来料单号' 'INCOM' '' '' '' '' '' '' '',
*   '来料单项次' 'ITEM ' '' '' '' '' '' '' '',
*   '采购订单类型' 'BSART' '' '' '' '' '' '' '',
*   '采购订单号' 'EBELN' '' '' '' '' '' '' '',
*   '采购订单项次' 'EBELP' '' '' '' '' '' '' '',
*   '物资编码' 'MATNR' '' '' '' '' '' '' '',
*   '数量' 'MENGE' '' '' 'X' '' 'QUAN' '' '',
*   '单位' 'MEINS' '' '' '' '' '' '' '',
*   '物料描述' 'TXZ01' '' '' '' '' '' '' '',
**   '原厂码' 'MFRPN' '' '' '' '' '' '' '',
*   '厂家码' 'FACTORY_CODE' '' '' '' '' '' '' '',
*   'Subcode' 'SUBCODE' '' '' '' '' '' '' '',
*   '工厂' 'WERKS' '' '' 'X' '' '' 'T001W' 'WERKS',
*   '库存地点' 'LGORT' '' '' 'X' 'X' '' '' '',
*   '采购组织' 'EKORG' '' '' '' '' '' '' '',
*   '采购组' 'EKGRP' '' '' '' '' '' '' '',
*   '采购价格-含税' 'NETPR_CO' '' '' '' '' 'CURR' '' '',
*   '采购价格-未税' 'NETPR' '' '' 'X' '' 'CURR' '' '',
*   '价格基数' 'PEINH' '' '' '' '' '' '' '',
*   '采购货币' 'WAERS' '' '' '' '' '' '' '',
*   '税码' 'MWSKZ' '' '' 'X' '' '' 'EKPO' 'MWSKZ',
*   '供应商' 'LIFNR' '' '' '' '' '' '' '',
*   '采购供应商名称' 'NAME1' '' '' '' '' '' '' '',
*   '状态' 'STATUS' '' '' '' '' '' '' '',
*   '消息' 'MESSAGE' '' '' '' '' '' '' ''
*
*   .
*ENDFORM.*&---------------------------------------------------------------------*
*& Form DISPLAY_ALV
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM display_alv .DATA: ls_layout TYPE lvc_s_layo.IF gt_data IS NOT INITIAL.ls_layout-zebra = 'X'.ls_layout-box_fname = 'CHECK'.  "指定行选择字段ls_layout-cwidth_opt = 'X'."---------------enterDATA: gt_event TYPE slis_t_event WITH HEADER LINE,ref_grid TYPE REF TO cl_gui_alv_grid.gt_event-name = 'CALLER_EXIT'.gt_event-form = 'FM_BUTTON'.APPEND gt_event .CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'EXPORTINGi_callback_program       = sy-repid "这里是调用这个ALV的程序名i_callback_pf_status_set = 'PF_STATUS' "设置ALV状态栏的函数i_callback_user_command  = 'USER_COMMAND' "获取用户事件的函数is_layout_lvc            = ls_layout "显示的布局it_fieldcat_lvc          = gt_fieldcat_lvc "设置显示的字段以及字段的功能it_events                = gt_event[]TABLESt_outtab                 = gt_dataEXCEPTIONSprogram_error            = 1.IF sy-subrc <> 0.ENDIF.ELSE.
* 这个消息用来显示我们是不是获取到了数据,自己用的时候把这个硬代码换成你需要的TEXT-XXX.MESSAGE '没有获取到数据,请重新检索!' TYPE 'S' DISPLAY LIKE 'E'.LEAVE TO LIST-PROCESSING.EXIT.ENDIF.ENDFORM.CLASS lcl_event_receiver DEFINITION.PUBLIC SECTION.METHODS handle_modifyFOR EVENT data_changed_finished OF cl_gui_alv_gridIMPORTING e_modified et_good_cells.
ENDCLASS. "LCL_EVENT_RECEIVER DEFINITIONDATA: ref_grid TYPE REF TO cl_gui_alv_grid.
CLASS lcl_event_receiver IMPLEMENTATION.METHOD handle_modify.DATA stbl TYPE lvc_s_stbl.PERFORM frm_refresh_alv.stbl-row = 'x'." 基于行的稳定刷新stbl-col = 'x'." 基于列稳定刷新CALL METHOD ref_grid->refresh_table_displayEXPORTINGis_stable = stbl.ENDMETHOD. "HANDLE_MODIFY
ENDCLASS. "LCL_EVENT_RECEIVER IMPLEMENTATIONDATA:gt_event_receiver TYPE REF TO lcl_event_receiver."实现FM_BUTTON:
FORM fm_button USING e_grid TYPE slis_data_caller_exit.CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'IMPORTINGe_grid = ref_grid."设置enter事件CALL METHOD ref_grid->register_edit_eventEXPORTINGi_event_id = cl_gui_alv_grid=>mc_evt_enterEXCEPTIONSerror      = 1OTHERS     = 2.CREATE OBJECT gt_event_receiver.SET HANDLER gt_event_receiver->handle_modify FOR ref_grid.
ENDFORM. "FM_BUTTON
*&---------------------------------------------------------------------*
*& Form FRM_REFRESH_ALV
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM frm_refresh_alv ."全表更新 含税价。CLEAR gs_data.IF gt_data IS NOT INITIAL.LOOP AT gt_data INTO gs_data.IF gs_data-netpr IS NOT INITIAL.gs_data-netpr_co = gs_data-netpr * ( 1 + gs_data-effwr ).MODIFY gt_data FROM gs_data.ENDIF.ENDLOOP.ENDIF.
ENDFORM.*&---------------------------------------------------------------------*
*& 包含 ZRP008_PBO
*&---------------------------------------------------------------------**&---------------------------------------------------------------------*
*& Form PF_STATUS
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM pf_status USING i_it_extab TYPE slis_t_extab.
* 这里我们需要设置状态栏 首先要在程序里面创建一个状态栏
* 定义好名称来这里替换硬代码SET PF-STATUS 'ZSTATUS_001'.* 这里我们需要设置状态栏标题 首先要在程序里面创建一个状态栏标题
* 定义好名称来这里替换硬代码SET TITLEBAR 'ZSTATUS_TITLE'.
ENDFORM.*&---------------------------------------------------------------------*
*& 包含               ZRP008_PAI
*&---------------------------------------------------------------------**&---------------------------------------------------------------------*
*& Form USER_COMMAND
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*FORM user_command USING i_ucomm TYPE sy-ucommi_wa_selfield TYPE slis_selfield."------------------------------刷新ALV---------------DATA: lr_grid TYPE REF TO cl_gui_alv_grid.CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'IMPORTINGe_grid = lr_grid.CALL METHOD lr_grid->check_changed_data.CALL METHOD lr_grid->refresh_table_display.i_wa_selfield-refresh = 'X'.DATA lv_length TYPE num10.CASE i_ucomm.WHEN '&IC1'.READ TABLE gt_data INTO gs_data INDEX i_wa_selfield-tabindex.CASE i_wa_selfield-fieldname.WHEN 'LGORT'.DATA: l_dselc TYPE TABLE OF dselc WITH HEADER LINE.DATA: l_ddshretval TYPE TABLE OF ddshretval WITH HEADER LINE.TYPES:BEGIN OF ly_t001l,werks TYPE t001l-werks,lgort TYPE t001l-lgort,lgobe TYPE t001l-lgobe,END OF ly_t001l.DATA: lt_lgort TYPE TABLE OF ly_t001l WITH HEADER LINE."T001L 库存地点SELECT lgort lgobe werks INTO CORRESPONDING FIELDS OF TABLE lt_lgort FROM t001l WHERE werks = gs_data-werks.l_dselc-fldname = 'LGORT'.l_dselc-dyfldname = 'LGORT'.APPEND l_dselc.l_dselc-fldname = 'LGOBE'.l_dselc-dyfldname = 'LGOBE'.APPEND l_dselc.CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'EXPORTINGretfield        = 'LGORT'dynpprog        = sy-repiddynpnr          = sy-dynnrdynprofield     = 'LGORT' "返回到屏幕上的ALV  或者屏幕上对应的字段。window_title    = '选择库存地点'value_org       = 'S' "StructureTABLESvalue_tab       = lt_lgort[]return_tab      = l_ddshretval[]dynpfld_mapping = l_dselc[]EXCEPTIONSparameter_error = 1no_values_found = 2OTHERS          = 3.IF sy-subrc = 0.IF l_ddshretval[] IS NOT INITIAL.READ TABLE l_ddshretval[] INTO l_ddshretval INDEX 1.gs_data-lgort = l_ddshretval-fieldval.MODIFY gt_data FROM gs_data INDEX i_wa_selfield-tabindex.ENDIF.ENDIF.ENDCASE.WHEN 'CREATE_PO'. "创建采购退货订单lv_length = 0.CLEAR gs_data.REFRESH gt_data_copy.LOOP AT gt_data INTO gs_data WHERE check = 'X' .lv_length = lv_length + 1.IF gs_data-status = 'S'.APPEND gs_data TO gt_data_copy.ENDIF.ENDLOOP.IF lv_length = 0.MESSAGE '请选择行!' TYPE 'E'.ENDIF.IF lines( gt_data_copy ) > 0 .MESSAGE '选中的行有已经创建成功的记录!' TYPE 'E'.ENDIF."供应商、公司、采购组织、采购组 都相同的数据,创建在同一张采购订单不同行上。CLEAR gs_data.REFRESH gt_data_copy.LOOP AT gt_data INTO gs_data WHERE check = 'X'.APPEND gs_data TO gt_data_copy.ENDLOOP.DELETE ADJACENT DUPLICATES FROM gt_data_copy COMPARING bukrs lifnr ekorg ekgrp."=========创建PO需要的参数类型定义DATA ls_poheader TYPE bapimepoheader.DATA ls_poheaderx TYPE bapimepoheaderx.DATA ls_poitem TYPE  bapimepoitem.DATA lt_poitem TYPE TABLE OF bapimepoitem.DATA ls_poitemx TYPE  bapimepoitemx.DATA lt_poitemx TYPE TABLE OF bapimepoitemx.DATA lv_poitem TYPE num10.DATA lt_bapiret2 TYPE TABLE OF bapiret2.DATA ls_bapiret2 TYPE bapiret2.DATA lt_extensionin TYPE TABLE OF bapiparex .DATA ls_extensionin TYPE bapiparex .DATA ls_bapi_te_mepoitem TYPE bapi_te_mepoitem.DATA ls_bapi_te_mepoitemx TYPE bapi_te_mepoitemx.CLEAR gs_data_copy.LOOP AT gt_data_copy INTO gs_data_copy.ls_poheader-comp_code = gs_data_copy-bukrs. "公司代码ls_poheader-doc_type = gs_data_copy-bsart. "采购凭证类型ls_poheader-creat_date = sy-datum. "系统当前日期ls_poheader-created_by = sy-uname.ls_poheader-item_intvl = '00010'. "项目编号间隔ls_poheader-vendor = gs_data_copy-lifnr."指定的供应商ls_poheader-purch_org = gs_data_copy-ekorg. "采购组织ls_poheader-pur_group = gs_data_copy-ekgrp. "采购组ls_poheaderx-comp_code = 'X'. "公司代码ls_poheaderx-doc_type = 'X'. "采购凭证类型ls_poheaderx-creat_date = 'X'. "系统当前日期ls_poheaderx-created_by = 'X'.ls_poheaderx-item_intvl = 'X'. "项目编号间隔ls_poheaderx-vendor = 'X'."指定的供应商ls_poheaderx-purch_org = 'X'. "采购组织ls_poheaderx-pur_group = 'X'. "采购组lv_poitem = 10.LOOP AT gt_data INTO gs_data WHERE bukrs = gs_data_copy-bukrsAND lifnr = gs_data_copy-lifnr AND ekorg = gs_data_copy-ekorg AND ekgrp = gs_data_copy-ekgrp AND check = 'X'.ls_poitem-po_item = lv_poitem.
*          ls_poitem-material = gs_data-matnr."物料号 "注:不支持40位物料号,故换成 :ls_poitem-material_long = gs_data-matnr."物料号ls_poitem-material_long = gs_data-matnr."物料号ls_poitem-plant = gs_data-werks."工厂ls_poitem-info_rec = ''."采购信息记录的编号ls_poitem-quantity = gs_data-menge."数量"外部单位转换成内部单位IF gs_data-meins IS NOT INITIAL.PERFORM conversion_exit_cunit_input CHANGING gs_data.ENDIF.ls_poitem-po_unit = gs_data-meins."单位ls_poitem-net_price = gs_data-netpr."采购价格-未税ls_poitem-price_unit = gs_data-peinh. "价格单位ls_poitem-tax_code = gs_data-mwskz."税ls_poitem-ret_item = 'X'."退货项目APPEND ls_poitem TO lt_poitem.ls_poitemx-po_item = lv_poitem.ls_poitemx-po_itemx = 'X'.
*          ls_poitemx-material = 'X'."物料号ls_poitemx-material_long = 'X'."物料号ls_poitemx-plant = 'X'."工厂ls_poitemx-info_rec = 'X'."采购信息记录的编号ls_poitemx-quantity = 'X'."数量ls_poitemx-po_unit = 'X'."单位ls_poitemx-net_price = 'X'."采购价格-含税ls_poitemx-price_unit = 'X'. "价格单位ls_poitemx-tax_code = 'X'."税ls_poitemx-ret_item = 'X'."退货项目APPEND ls_poitemx TO lt_poitemx."增强字段ls_bapi_te_mepoitem-po_item = lv_poitem."项次ls_bapi_te_mepoitemx-po_item = lv_poitem."项次  "注:增强这个位置比较特殊。ls_bapi_te_mepoitem-item_note = gs_data-incom."行项目备注-来料单号ls_bapi_te_mepoitemx-item_note = 'X'."行项目备注ls_extensionin-structure = 'BAPI_TE_MEPOITEM'.ls_extensionin-valuepart1 = ls_bapi_te_mepoitem.APPEND ls_extensionin TO lt_extensionin.CLEAR: ls_extensionin.ls_extensionin-structure = 'BAPI_TE_MEPOITEMX'.ls_extensionin-valuepart1 = ls_bapi_te_mepoitemx.APPEND ls_extensionin TO lt_extensionin.CLEAR: ls_extensionin.lv_poitem = lv_poitem + 10.APPEND gs_data TO gt_data_temp. "临时记录将要被更新的记录ENDLOOP."创建一个PODATA ls_expheader TYPE bapimepoheader.CALL FUNCTION 'BAPI_PO_CREATE1'EXPORTINGpoheader    = ls_poheaderpoheaderx   = ls_poheaderxIMPORTINGexpheader   = ls_expheaderTABLESreturn      = lt_bapiret2poitem      = lt_poitempoitemx     = lt_poitemxextensionin = lt_extensionin.IF sy-subrc = 0."表示PO创建成功,更新内表记录IF lt_bapiret2 IS NOT INITIAL.DATA zmessage(255) TYPE c.zmessage = ''.DATA zflag(8) TYPE c.LOOP AT lt_bapiret2 INTO ls_bapiret2 .IF ls_bapiret2-type = 'E'.zmessage = zmessage && ls_bapiret2-type && ':' && ls_bapiret2-message && ','.ELSEIF ls_bapiret2-type = 'S'.zflag = 'S'.ENDIF.ENDLOOP.IF zmessage IS NOT INITIAL. "表示有失败的信息记录MESSAGE zmessage TYPE 'S' DISPLAY LIKE 'E'.LOOP AT gt_data_temp INTO gs_data_temp.gs_data_temp-status = 'E'.gs_data_temp-message = zmessage.MODIFY gt_data_temp FROM gs_data_temp.ENDLOOP.ELSE.IF zflag = 'S'. "确认采购订单被创建成功DATA ls_pocommit_return TYPE bapiret2.CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' "BAPI事务提交EXPORTINGwait   = 'X'IMPORTINGreturn = ls_pocommit_return.zmessage = ls_expheader-po_number && '采购订单创建成功'.MESSAGE zmessage TYPE 'S'.LOOP AT gt_data_temp INTO gs_data_temp.gs_data_temp-status = zflag.gs_data_temp-message = zmessage.MODIFY gt_data_temp FROM gs_data_temp.ENDLOOP.ENDIF.APPEND LINES OF gt_data_temp TO gt_data_success_log. "最终记录创建成功的记录。ENDIF.ENDIF.ENDIF.CLEAR ls_poitemx.CLEAR ls_poitem.REFRESH lt_poitemx.REFRESH lt_poitem.CLEAR ls_bapi_te_mepoitem.CLEAR ls_bapi_te_mepoitemx.CLEAR: ls_extensionin.REFRESH lt_extensionin.REFRESH gt_data_temp.ENDLOOP."对创建成功的记录更新到ALV显示内表  GT_DADA.CLEAR gs_data.LOOP AT gt_data INTO gs_data WHERE check = 'X'.READ TABLE gt_data_success_log INTO gs_data_success_log WITH KEY ebeln = gs_data-ebeln  ebelp = gs_data-ebelp.IF sy-subrc = 0."在记录表中存在, 将更新GT_DATA 记录状态。gs_data-status = gs_data_success_log-status.gs_data-message = gs_data_success_log-message.MODIFY gt_data FROM gs_data.ENDIF.ENDLOOP.WHEN OTHERS.ENDCASE.
ENDFORM.*& Form CONVERSION_EXIT_CUNIT_INPUT
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      <-- GS_DATA
*&---------------------------------------------------------------------*
FORM conversion_exit_cunit_input  CHANGING p_gs_data TYPE gy_data.CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'EXPORTINGinput    = p_gs_data-meinslanguage = sy-languIMPORTINGoutput   = p_gs_data-meins.
ENDFORM.

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

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

相关文章

YOLOv5、YOLOv8改进:BoTNet Transformer

目录 1.简介 2.YOLOv5改进 2.1增加以下yolov5s_botnet.yaml文件 2.2common.py配置 2.3 yolo.py配置修改 1.简介 论文地址 Paper 本文提出的BoTNet是一种简单高效的网络&#xff0c;有效的将SA应用到多种视觉任务&#xff0c;如图像识别、目标检测、实例分割任务。通过将R…

06-基础例程6

基础例程6 01、WIFI实验—WebServer 实验介绍 ​ 连接路由器上网是我们每天都做的事情&#xff0c;日常生活中只需要知道路由器的账号和密码&#xff0c;就可以使用手机或电脑连接到路由器&#xff0c;然后上网。 ​ 连接路由器&#xff0c;将ESP32的IP地址等信息通过shell…

自动化运维:Ansible脚本之playbook剧本

目录 一、理论 1.playbooks 2.YAML 3.使用ansible批量安装apache服务 4.定义、引用变量 5.指定远程主机sudo切换用户 6.when条件判断 7.迭代 8.Templates 模块 9.tags 模块 10.Roles 模块 二、实验 1.使用ansible批量安装apache服务 2.定义、引用变量…

【STM32】学习笔记-江科大

【STM32】学习笔记-江科大 1、STM32F103C8T6的GPIO口输出 2、GPIO口输出 GPIO&#xff08;General Purpose Input Output&#xff09;通用输入输出口可配置为8种输入输出模式引脚电平&#xff1a;0V~3.3V&#xff0c;部分引脚可容忍5V输出模式下可控制端口输出高低电平&#…

华为数通方向HCIP-DataCom H12-821题库(单选题:101-120)

第101题 可用于多种路由协议,由 ​​if-match​​​和 ​​apply​​子句组成的路由选择工具是 A、​​route-policy​​ B、​​IP-Prefix​​ C、​​commnityfilter​​ D、​​as-path-filter​​ 答案&#xff1a;A 解析&#xff1a; Route-policy&#xff08;路由策…

Oracle数据传输加密方法

服务器端“dbhome_1\NETWORK\ADMIN\”sqlnet.ora文件中添加 SQLNET.ENCRYPTION_SERVER requested SQLNET.ENCRYPTION_TYPES_SERVER (RC4_256) 添加后新的链接即刻生效&#xff0c;服务器无需重新启动。 也可以通过Net manager管理工具添加 各个参数含义如下&#xff1a; 是…

excel功能区(ribbonx)编程笔记--2 button控件与checkbox控件

我们上一章简单先了解了ribbonx的基本内容,以及使用举例实现自己修改ribbox的内容,本章紧接上一章,先讲解一下ribbonx的button控件。 在功能区的按钮中,可以使用内置图像或提供自已的图像,可以指定大按钮或者更小的形式,添加少量的代码甚至可以同时提供标签。此外,可以利…

LoRA学习笔记

Background 全参微调 全量微调指的是&#xff0c;在下游任务的训练中&#xff0c;对预训练模型的每一个参数都做更新。例如图中&#xff0c;给出了Transformer的Q/K/V矩阵的全量微调示例&#xff0c;对每个矩阵来说&#xff0c;在微调时&#xff0c;其d*d个参数&#xff0c;都…

数据库CPU飙高问题定位及解决

在业务服务提供能力的时候&#xff0c;常常会遇到CPU飙高的问题&#xff0c;遇到这类问题&#xff0c;大多不是数据库自身问题&#xff0c;都是因为使用不当导致&#xff0c;这里记录下业务服务如何定位数据库CPU飙高问题并给出常见的解决方案。 CPU 使用率飙升根因分析 在分…

Centos7 安装Docker管理工具Portainer

0、前提条件 已安装Docker并且开启Docker&#xff0c;安装Docker可参见&#xff1a;Centos7 安装 Docker_瘦身小蚂蚁的博客-CSDN博客 1、 拉取portainer-ce镜像 docker pull portainer/portainer-ce:latest [rootlocalhost ~]# docker pull portainer/portainer-ce:latest la…

Doris架构中包含哪些技术?

Doris主要整合了Google Mesa(数据模型)&#xff0c;Apache Impala(MPP Query Engine)和Apache ORCFile (存储格式&#xff0c;编码和压缩)的技术。 为什么要将这三种技术整合? Mesa可以满足我们许多存储需求的需求&#xff0c;但是Mesa本身不提供SQL查询引擎。 Impala是一个…

1 Hadoop入门

1.Hadoop是什么&#xff1f; (1)Hadoop是一个由Apache基金会所开发的分布式系统基础架构。 (2)主要解决&#xff0c;海量数据的存储和海量数据的分析计算问题。 (3)广义上来说&#xff0c;Hadoop通常是指一个更广泛的概念——Hadoop生态圈 2.Hadoop的优势 3 Hadoop组成 4 HDF…

git 基础

1.下载安装Git&#xff08;略&#xff09; 2.打开git bash窗口 3.查看版本号、设置用户名和邮箱 用户名和邮箱可以随意起&#xff0c;与GitHub的账号邮箱没有关系 4.初始化git 在D盘中新建gitspace文件夹&#xff0c;并在该目录下打开git bash窗口 git init 初始化完成后会…

GO语言语法结构

GO语言结构 包声明引入包函数变量语句 && 表达式注释 package main import "fmt" func main() {fmt.Println("Hello,World!") } 如这段代码块根据上面的语法结构进行逐行解释 第一行的 package main 是定义一个包名&#xff0c;必须在源文件…

vector实现遇到的问题

前言&#xff1a;vector是表示可变大小数组的序列容器。就像数组一样&#xff0c;vector也采用的连续存储空间来存储元素。也就是意味着可以采用下标对vector的元素进行访问&#xff0c;和数组一样高效。但是又不像数组&#xff0c;它的大小是可以动态改变的&#xff0c;而且它…

阿里云大数据实战记录8:拆开 json 的每一个元素,一行一个

目录 一、前言二、目标介绍三、使用 pgsql 实现3.1 拆分 content 字段3.2 拆分 level 字段3.3 拼接两个拆分结果 四、使用 ODPS SQL 实现4.1 拆分 content 字段4.2 拆分 level 字段4.3 合并拆分 五、使用 MySQL 实现六、总结 一、前言 商业场景中&#xff0c;经常会出现新的业…

docker network

docker network create <network>docker network connect <network> <container>docker network inspect <network>使用这个地址作为host即可 TODO&#xff1a;添加docker-compose

【CI/CD技术专题】「Docker实战系列」本地进行生成镜像以及标签Tag推送到DockerHub

背景介绍 Docker镜像构建成功后&#xff0c;只要有docker环境就可以使用&#xff0c;但必须将镜像推送到Docker Hub上去。创建的镜像最好要符合Docker Hub的tag要求&#xff0c;因为在Docker Hub注册的用户名是liboware&#xff0c;最后利用docker push命令推送镜像到公共仓库…

Redis发布订阅

Redis发布订阅 Redis 发布订阅(pub/sub)是一种 消息通信模式&#xff1a;发送者(pub)发送消息&#xff0c;订阅者(sub)接收消息。 Redis 客户端可以订阅任意数量的频道。 订阅/发布消息图&#xff1a; 下图展示了频道 channel1 &#xff0c; 以及订阅这个频道的三个客户端 —…