资金管理平台 -SAP创建凭证测试程序及增强!

文章目录

  • 主要程序
    • 创建程序
    • 程序
  • 代码解析
    • 变量定义
    • 抬头和项目初始值
    • 表头赋值
    • 调用BAPI
    • 其他的子例程
  • 核心内表
  • 增强部分
    • LFACIF5D程序
    • FI_DOCUMENT_CHECK
      • 完整程序
    • BADI增强

主要程序

创建程序

在这里插入图片描述

程序

&---------------------------------------------------------------------*
*& Report Z_TEST_LHY
*& Description:测试调用BAPI 创建预制凭证和会计凭证
*& Create On:202464*& Creater:Liuhongyu
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT z_test_lhy.
TYPES: BEGIN OF typ_head,bldat TYPE bkpf-bldat,  "凭证日期budat TYPE bkpf-budat,  "过账日期blart TYPE bkpf-blart,  "凭证类型bukrs TYPE bkpf-bukrs,  "公司代码monat TYPE bkpf-monat,  "过账期间waers TYPE bkpf-waers,  "币种bktxt TYPE bkpf-bktxt,  "凭证抬头文本kursf TYPE bkpf-kursf,  "汇率numpg TYPE bkpf-numpg,  "发票的页数num   TYPE char10,  "索引END OF typ_head.
TYPES: BEGIN OF typ_item,num     TYPE char10,     "凭证顺序号bschl   TYPE bseg-bschl, "记账码  "系统根据金额正负自动设置hkont   TYPE bseg-hkont, "科目umskz   TYPE bseg-umskz, "特别总账标识rstgr   TYPE bseg-rstgr,  "原因代码      "RSTGRkkber   TYPE bseg-kkber,  "信贷控制范围wrbtr   TYPE bseg-wrbtr, "原币金额dmbtr   TYPE bseg-dmbtr, "本币金额mwskz   TYPE bseg-mwskz, "税码
*         dmbtr      TYPE bapiaccr09-amt_doccur, "本币金额zterm   TYPE bseg-zterm, "付款条件kostl   TYPE bseg-kostl, "成本中心aufnr   TYPE bseg-aufnr, "内部订单prctr   TYPE bseg-prctr, "利润中心zfbdt   TYPE bseg-zfbdt, "收付款基准日期*         zzwwjsh TYPE char10, "外围结算号xref1   TYPE bseg-xref1,zuonr   TYPE bseg-zuonr, "分配/外围单号sgtxt   TYPE bseg-sgtxt, "凭证行项目文本xnegp   TYPE bseg-xnegp, "反记账
*         wname   TYPE bsed-wname, "收票人      "没有写进bapi
*         wbzog   TYPE bsed-wbzog, "出票人      "没有写进bapi*         menge   TYPE bseg_add-menge, "数量
*         meins   TYPE bseg_add-meins, "单位wdate   TYPE bsed-wdate, "汇票签发日    "没有写进bapiprojk   TYPE char24, "工作分解结构元素 (WBS 元素)zbd1t   TYPE bseg-zbd1t, "现金折旧天数hkont_a TYPE bseg-hkont,  "备选总账科目??netdt   TYPE acdoca-netdt, "到期日期wstat   TYPE t031t-txt30,  "汇票状态
*         wdate   TYPE bsed-wdate,   "签发日期wname   TYPE bsed-wname,   "收款人wort2   TYPE bsed-wort2,   "收票人城市wbzog   TYPE bsed-wbzog,   "付款人wort1   TYPE bsed-wort1,   "出票人城市matnr   TYPE char18, "bseg-matnr, "物料号vbel2   TYPE bseg-vbel2, "销售订单CHENYL 20211018posn2   TYPE bseg-posn2, "销售订单CHENYL 20211018anln1   TYPE bseg-anln1, "资产-CHENYLebeln   TYPE bseg-ebeln, "采购凭证CHENYLebelp   TYPE bseg-ebelp, "采购凭证CHENYLkunnr   TYPE kna1-kunnr,werks   TYPE werks_d,vkorg   TYPE vbrk-vkorg, "销售组织vtweg   TYPE vbak-vtweg, "分销渠道bewar   TYPE bseg-bewar, "事务类型END OF typ_item.
DATA: gs_head TYPE typ_head,gt_head TYPE TABLE OF typ_head.
DATA: gs_item TYPE typ_item,gt_item TYPE TABLE OF typ_item.
DATA: gs_t001 TYPE t001,gt_t001 LIKE TABLE OF gs_t001.
DATA: gs_tbsl TYPE tbsl,gt_tbsl LIKE TABLE OF gs_tbsl.
DATA: gs_documentheader    LIKE  bapiache09.  "表头
DATA: gs_accountgl         LIKE  bapiacgl09,gt_accountgl         LIKE TABLE OF  bapiacgl09, "总帐科目项gs_currencyamount    LIKE bapiaccr09,gt_currencyamount    LIKE TABLE OF  bapiaccr09, "货币项目gs_return            LIKE bapiret2,gt_return            LIKE TABLE OF  bapiret2,gs_extension2        LIKE  bapiparex,gt_extension2        LIKE TABLE OF  bapiparex,gs_accountreceivable LIKE  bapiacar09, "客户项目gt_accountreceivable LIKE TABLE OF  bapiacar09,gs_accountpayable    LIKE  bapiacap09, "供应商项目gt_accountpayable    LIKE TABLE OF  bapiacap09.DATA: ls_zfidoc TYPE zfis002. "定义增强点结构DATA: ls_head LIKE gs_head.
DATA: BEGIN OF ls_bsed,wdate TYPE bsed-wdate, "汇票签发日wstat TYPE t031t-txt30,  "汇票状态wname TYPE bsed-wname,   "收款人wort2 TYPE bsed-wort2,   "收票人城市wbzog TYPE bsed-wbzog,   "付款人wort1 TYPE bsed-wort1,   "出票人城市END OF ls_bsed.
DATA: lt_bsed LIKE TABLE OF ls_bsed.
DATA: BEGIN OF gt_anbwa OCCURS 0,posnr LIKE accit-posnr,bschl LIKE bseg-bschl,anbwa LIKE accit-anbwa,END OF gt_anbwa.
* ============================★  应付类  START==============================
"应付类可以生成成功
* "如需要使用该抬头可以取消注释
*"-------------应付类抬头赋值 START $-------------------------------
*
*gs_head = VALUE #( bldat = '20240725' "凭证日期
*                   budat = '20240725' "过账日期
*                   blart = 'KZ' "凭证类型
*                   bukrs = '1000' "公司代码
*                   monat = '7'  "期间
*                   waers = 'CNY'  "币种
*                   bktxt = '支付联星焊接30%发货款-Z_TEST_LHY程序创建' "抬头文本
*                   numpg = '000'
*                   num = '1'
*                   ).
*APPEND gs_head TO gt_head.
*"-------------应付类抬头赋值 END $--------------------------------
*
*
*"项目赋值
**------应付类项目3 START $--------------*
*"原来是项目3的,现在换成项目1 ,因为这样才有收款人等信息!!!!
*gs_item-bschl = '19'. "记账码
*gs_item-hkont = |{ '100961' ALPHA = IN }|. "总账科目
*gs_item-umskz = 'W'.  "特别总账标识
*gs_item-wrbtr = '500'. "金额
*gs_item-sgtxt = '支付联星焊接30%发货款-Z_TEST_LHY程序创建'."项目文本
*gs_item-wdate = '20240501'. "签发日期
*gs_item-netdt = '20240825'.  "到期日期
*gs_item-wname = '珠海市联星焊接设备有限公司'. "收款人
*gs_item-wort2 = '中国光大银行股份有限公司XXXX支行'. "汇票受票人所在的城市
*gs_item-wbzog = '广东XXXX铝材股份有限公司'. "付款人
*gs_item-wort1 = '123456789123456789'. "汇票出票人所在的城市
*APPEND gs_item TO gt_item.
*CLEAR gs_item.
**------应付类项目3 END  $--------------*
*
**------应付类项目1 START $--------------*
*gs_item-bschl = '29'. "记账码
*gs_item-hkont = |{ '100026' ALPHA = IN }|. "总账科目
*gs_item-umskz = 'A'.  "特别总账标识
*gs_item-wrbtr = '1000'. "金额
*gs_item-sgtxt = '支付联星焊接30%发货款-Z_TEST_LHY程序创建'."项目文本
*APPEND gs_item TO gt_item.
*CLEAR gs_item.
**------应付类项目1 END  $--------------*
*
**------应付类项目2 START $--------------*
*gs_item-bschl = '50'. "记账码
*gs_item-hkont = |{ '10020005' ALPHA = IN }|. "总账科目
*gs_item-wrbtr = '500'. "金额
*gs_item-rstgr = '220'.  "原因代码
*gs_item-sgtxt = '支付联星焊接30%发货款-Z_TEST_LHY程序创建'."项目文本
*APPEND gs_item TO gt_item.
*CLEAR gs_item.
**------应付类项目2 END  $--------------*
* ============================★  应付类  END==============================* ============================★  报销类  START==============================
"对应的文档:D:\File\Self\任务\20240725_SAP自动生成凭证所需字段V5.0_lhy.xlsx  TIME: AT 2024.07.30*"-------------报销类抬头赋值 START $-------------------------------gs_head = VALUE #( bldat = '20240531' "凭证日期budat = '20240531' "过账日期blart = 'SA' "凭证类型bukrs = '1000' "公司代码monat = '5'  "期间waers = 'CNY'  "币种bktxt = '支付张三费用报销-Z_TEST_LHY程序创建' "抬头文本numpg = '000'num = '1').
APPEND gs_head TO gt_head.
*"-------------报销类抬头赋值 END $--------------------------------*"-------------报销类项目赋值 START $-------------------------------
"对应的文档:D:\File\Self\任务\20240725_SAP自动生成凭证所需字段V5.0_lhy.xlsx  TIME: AT 2024.07.30*------报销类项目1 START $--------------*
gs_item-bschl = '40'. "记账码
gs_item-hkont = |{ '66010034' ALPHA = IN }|. "总账科目
gs_item-wrbtr = '1769.91'. "金额
gs_item-mwskz = 'J0'. "税码
gs_item-kostl = |{ '100011007' ALPHA = IN }|. "成本中心100011007
gs_item-sgtxt = '支付张三费用报销-Z_TEST_LHY程序创建'."项目文本
APPEND gs_item TO gt_item.
CLEAR gs_item.
*------报销类项目1 END   $--------------**------报销类项目2 START $--------------*
gs_item-bschl = '40'. "记账码
gs_item-hkont = |{ '66010035' ALPHA = IN }|. "总账科目
gs_item-wrbtr = '3000'. "金额
gs_item-mwskz = 'J0'. "税码
gs_item-kostl = |{ '100011007' ALPHA = IN }|. "成本中心100011007
gs_item-sgtxt = '支付张三费用报销-Z_TEST_LHY程序创建'."项目文本
APPEND gs_item TO gt_item.
CLEAR gs_item.
*------报销类项目2 END   $--------------**------报销类项目3 START $--------------*
gs_item-bschl = '40'. "记账码
gs_item-hkont = |{ '22210001' ALPHA = IN }|. "总账科目
gs_item-wrbtr = '230.09'. "金额
gs_item-sgtxt = '支付张三费用报销-Z_TEST_LHY程序创建'."项目文本
APPEND gs_item TO gt_item.
CLEAR gs_item.
*------报销类项目3 END   $--------------**------报销类项目4 START $--------------*
gs_item-bschl = '34'. "记账码
gs_item-hkont = |{ '200020' ALPHA = IN }|. "科目,后面会放到供应商字段
gs_item-hkont_a = |{ '12210001' ALPHA = IN }|. "科目,备选总账科目?
gs_item-wrbtr = '1000'. "金额
gs_item-sgtxt = '支付张三费用报销-Z_TEST_LHY程序创建'."项目文本
APPEND gs_item TO gt_item.
CLEAR gs_item.
*------报销类项目4 END   $--------------**------报销类项目5 START $--------------*
gs_item-bschl = '50'. "记账码
gs_item-hkont = |{ '10020005' ALPHA = IN }|. "总账科目10020005
gs_item-wrbtr = '4000'. "金额
gs_item-rstgr = '251'.  "原因代码
gs_item-sgtxt = '支付张三费用报销-Z_TEST_LHY程序创建'."项目文本
APPEND gs_item TO gt_item.
CLEAR gs_item.
*------报销类项目5 END   $--------------***"-------------报销类项目赋值 END   $-------------------------------* ============================★  应收类  END==============================* ============================★  应收类  START==============================
"应收类可以生成成功
**"-------------应收类抬头赋值 START $-------------------------------
*
*gs_head = VALUE #( bldat = '20240531' "凭证日期
*                   budat = '20240531' "过账日期
*                   blart = 'DZ' "凭证类型
*                   bukrs = '1000' "公司代码
*                   monat = '5'  "期间
*                   waers = 'CNY'  "币种
*                   bktxt = '收到客户3月货款-Z_TEST_LHY程序创建' "抬头文本
*                   numpg = '000'
*                   num = '1'
*                   ).
*APPEND gs_head TO gt_head.
**"-------------应收类抬头赋值 END $--------------------------------
*
**"-------------应收类项目赋值 START $-------------------------------
**------应收类项目1 START $--------------*
*gs_item-bschl = '09'. "记账码
*gs_item-hkont = |{ '100961' ALPHA = IN }|. "总账科目
*gs_item-umskz = 'W'.  "特别总账标识
*gs_item-wrbtr = ' 10000.00 '. "金额
*gs_item-sgtxt = '收到客户3月货款-Z_TEST_LHY程序创建'."项目文本
*gs_item-wdate = '20240501'. "签发日期
*gs_item-netdt = '20240825'.  "到期日期
*gs_item-wname = '广东XXXX铝材股份有限公司'. "收款人
*gs_item-wort2 = '中国光大银行股份有限公司XXXX支行'. "汇票受票人所在的城市
*gs_item-wbzog = '广东长盈精密技术有限公司'. "付款人
*gs_item-wort1 = '123456789123456789'. "汇票出票人所在的城市
*APPEND gs_item TO gt_item.
*CLEAR gs_item.
**------应收类项目1 END   $--------------*
*
**------应收类项目2 START $--------------*
*gs_item-bschl = '40'. "记账码
*gs_item-hkont = |{ '10020005' ALPHA = IN }|. "总账科目
*gs_item-wrbtr = '40000'. "金额
*gs_item-rstgr = '120'.   "原因代码
*gs_item-sgtxt = '收到客户3月货款-Z_TEST_LHY程序创建'."项目文本
*APPEND gs_item TO gt_item.
*CLEAR gs_item.
**------应收类项目2 END   $--------------*
*
**------应收类项目3 START $--------------*
*gs_item-bschl = '11'. "记账码
*gs_item-hkont = |{ '100961' ALPHA = IN }|. "总账科目
*gs_item-wrbtr = '50000'. "金额
*gs_item-sgtxt = '收到客户3月货款-Z_TEST_LHY程序创建'."项目文本
*APPEND gs_item TO gt_item.
*CLEAR gs_item.
**------应收类项目3 END   $--------------*
**"-------------应收类项目赋值 END  $-------------------------------* ============================★  应收类  END==============================*------会计凭证表头 START $--------------*
gs_documentheader-username = sy-uname. "用户名
gs_documentheader-comp_code = gs_head-bukrs.  "公司代码
gs_documentheader-doc_type = gs_head-blart. "凭证类型
gs_documentheader-doc_date = gs_head-bldat. "凭证日期
gs_documentheader-pstng_date = gs_head-budat.  "过账日期
gs_documentheader-fis_period = COND #( WHEN gs_head-monat = 13 THEN 13WHEN gs_head-monat = 14 THEN 14WHEN gs_head-monat = 15 THEN 15WHEN gs_head-monat = 16 THEN 16ELSE gs_head-budat+4(2) ).
gs_documentheader-header_txt = gs_head-bktxt. "凭证抬头文本
*------会计凭证表头  END  $--------------*DATA: lv_no TYPE char10.
DATA: i_s_log             TYPE  bal_s_log. "应用日志: 日志标题数据
DATA: i_s_msg             TYPE  bal_s_msg. "应用日志: 消息数据
DATA: e_log_handle        TYPE  balloghndl."应用程序日志:日志处理
DATA: l_s_display_profile TYPE  bal_s_prof."应用日志: 日志输出格式参数文件PERFORM get_tbsl. "查询TBSL,获取过账码的数据
PERFORM get_t001. "查询t001,获取公司代码和货币码CALL FUNCTION 'BAL_GLB_MEMORY_REFRESH'. "重置整个应用程序日志内存(=>FM文档)
CALL FUNCTION 'BAL_LOG_CREATE' "创建日志EXPORTINGi_s_log                 = i_s_logIMPORTINGe_log_handle            = e_log_handleEXCEPTIONSlog_header_inconsistent = 1OTHERS                  = 2.
LOOP AT gt_item INTO gs_item.DATA: lv_umskz(1) TYPE c.ls_head = gs_head.ADD 1 TO lv_no.IF gs_item-umskz = 'W' OR gs_item-umskz = 'S'.   " 特别总账标识WSlv_umskz = gs_item-umskz.MOVE-CORRESPONDING  gs_item TO ls_bsed.APPEND ls_bsed TO lt_bsed.CLEAR ls_bsed.ENDIF.PERFORM add_front_0 USING lv_no.
*------------ 总帐科目项 START --------------------*IF gs_item-bschl BETWEEN '40' AND '50'.CLEAR gs_accountgl.PERFORM add_front_0 USING lv_no.gs_accountgl-itemno_acc = lv_no. "序号gs_accountgl-item_text   = gs_item-sgtxt."项目文本PERFORM add_front_0 USING gs_item-hkont.gs_accountgl-gl_account = gs_item-hkont. "科目gs_accountgl-acct_type = 'S'.   "科目类型gs_accountgl-doc_type = ls_head-blart.  "凭证类型gs_accountgl-comp_code = ls_head-bukrs. "公司代码gs_accountgl-fis_period = COND #( WHEN ls_head-monat = 13 THEN 13   "期间WHEN ls_head-monat = 14 THEN 14WHEN ls_head-monat = 15 THEN 15WHEN ls_head-monat = 16 THEN 16ELSE ls_head-budat+4(2) ).gs_accountgl-fisc_year = ls_head-budat+0(4). "年度gs_accountgl-pstng_date = ls_head-budat. "过账日期PERFORM add_front_0 USING gs_item-kostl.gs_accountgl-costcenter = gs_item-kostl. "成本中心PERFORM add_front_0 USING gs_item-prctr.gs_accountgl-profit_ctr = gs_item-prctr. "利润中心PERFORM add_front_0 USING gs_item-aufnr.gs_accountgl-orderid = gs_item-aufnr. "订单(内部订单)gs_accountgl-material_long = gs_item-matnr."物料编码gs_accountgl-asset_no  = gs_item-anln1."资产编号chenyl 20211018gs_accountgl-sales_ord = gs_item-vbel2."销售订单chenyl 20211018gs_accountgl-s_ord_item = gs_item-posn2."销售订单行项目chenyl 20211018gs_accountgl-po_number = gs_item-ebeln."采购订单chenyl 20211018gs_accountgl-po_item = gs_item-ebelp."采购订单行项目chenyl 20211018
*
*gs_accountgl-alloc_nmbr = gs_item-zuonr. "分配(外围单号)gs_accountgl-tax_code = gs_item-mwskz. "税代码gs_accountgl-ref_key_1 = gs_item-xref1. "税代码"客户编码gs_accountgl-customer    = |{ gs_item-kunnr ALPHA  = IN  }|.gs_accountgl-plant       = gs_item-werks.gs_accountgl-salesorg    = gs_item-vkorg.gs_accountgl-distr_chan  = gs_item-vtweg.APPEND gs_accountgl TO gt_accountgl.ELSEIF gs_item-bschl BETWEEN '70' AND '75'.CLEAR gt_anbwa.gt_anbwa-posnr = lv_no.gt_anbwa-bschl = gs_item-bschl.gt_anbwa-anbwa = gs_item-bewar. "事务类型APPEND gt_anbwa.CLEAR gs_accountgl.PERFORM add_front_0 USING lv_no.gs_accountgl-itemno_acc = lv_no. "序号gs_accountgl-item_text   = gs_item-sgtxt."项目文本IF gs_item-hkont IS INITIAL.SELECT SINGLE ktogr INTO @DATA(lv_ktogr) FROM anla WHERE bukrs = @gs_head-bukrsAND anln1 = @gs_item-anln1.IF sy-subrc EQ 0.SELECT SINGLE ktansw INTO @DATA(lv_ktansw) FROM t095 WHERE ktogr = @lv_ktogr.ENDIF.PERFORM add_front_0 USING lv_ktansw.gs_accountgl-gl_account = lv_ktansw. "科目ENDIF.gs_accountgl-acct_type = 'A'.gs_accountgl-doc_type = ls_head-blart.  "凭证类型gs_accountgl-comp_code = ls_head-bukrs. "公司代码* MOD 20230424 By JTliudi  DV8K903943gs_accountgl-fis_period = COND #( WHEN ls_head-monat = 13 THEN 13WHEN ls_head-monat = 14 THEN 14WHEN ls_head-monat = 15 THEN 15WHEN ls_head-monat = 16 THEN 16ELSE ls_head-budat+4(2) )."GS_ACCOUNTGL-FIS_PERIOD = LS_HEAD-BUDAT+4(2). "期间
* MOD 20230424 By JTliudi  DV8K903943gs_accountgl-fisc_year = ls_head-budat+0(4). "年度gs_accountgl-pstng_date = ls_head-budat. "过账日期PERFORM add_front_0 USING gs_item-kostl.gs_accountgl-costcenter = gs_item-kostl. "成本中心PERFORM add_front_0 USING gs_item-prctr.gs_accountgl-profit_ctr = gs_item-prctr. "利润中心PERFORM add_front_0 USING gs_item-aufnr.gs_accountgl-orderid = gs_item-aufnr. "订单(内部订单)gs_accountgl-material_long = gs_item-matnr."物料编码gs_accountgl-asset_no  = gs_item-anln1."资产编号chenyl 20211018gs_accountgl-sales_ord = gs_item-vbel2."销售订单chenyl 20211018gs_accountgl-s_ord_item = gs_item-posn2."销售订单行项目chenyl 20211018gs_accountgl-po_number = gs_item-ebeln."采购订单chenyl 20211018gs_accountgl-po_item = gs_item-ebelp."采购订单行项目chenyl 20211018*        PERFORM add_front_0 USING gs_item-vbund.
*        gs_accountgl-trade_id = gs_item-vbund. "贸易伙伴gs_accountgl-alloc_nmbr = gs_item-zuonr. "分配(外围单号)gs_accountgl-tax_code = gs_item-mwskz. "税代码gs_accountgl-ref_key_1 = gs_item-xref1. "税代码"客户编码gs_accountgl-customer    = |{ gs_item-kunnr ALPHA  = IN  }|.gs_accountgl-plant       = gs_item-werks.gs_accountgl-salesorg    = gs_item-vkorg.gs_accountgl-distr_chan  = gs_item-vtweg."GS_ACCOUNTGL-CS_TRANS_T  = GS_ITEM-BEWAR. "事务类型 假的没有,不要尝试APPEND gs_accountgl TO gt_accountgl.ENDIF.
*------------- 总帐科目项 END --------------------**------------- 读取借贷标识 START --------------------*READ TABLE gt_tbsl INTO gs_tbsl WITH KEY bschl = gs_item-bschl.IF sy-subrc = 0.IF gs_tbsl-shkzg = 'H'.MULTIPLY gs_item-wrbtr BY -1.  "原币金额,相当于dobj2 = dobj2 / dobj1.MULTIPLY gs_item-dmbtr BY -1.  "本币金额ENDIF.ENDIF.
*------------- 读取借贷标识 END  --------------------**------------- 货币项目 START ----------------------*READ TABLE gt_t001 INTO gs_t001 WITH KEY bukrs = ls_head-bukrs.IF sy-subrc = 0.IF gs_t001-waers = ls_head-waers.CLEAR gs_currencyamount.PERFORM add_front_0 USING lv_no.gs_currencyamount-itemno_acc = lv_no. "序号gs_currencyamount-curr_type = '00'.  "货币类型:凭证货币gs_currencyamount-currency = ls_head-waers. "货币码(币种)gs_currencyamount-amt_doccur = gs_item-wrbtr. "交易货币金额"            gs_currencyamount-exch_rate = ls_head-kursf. "汇率APPEND gs_currencyamount TO gt_currencyamount.ELSE.CLEAR gs_currencyamount.PERFORM add_front_0 USING lv_no.gs_currencyamount-itemno_acc = lv_no. "序号gs_currencyamount-curr_type = '00'.  "货币类型:凭证货币gs_currencyamount-currency = ls_head-waers. "货币码(币种)gs_currencyamount-amt_doccur = gs_item-wrbtr. "交易货币金额gs_currencyamount-exch_rate = ls_head-kursf. "汇率
*            GS_CURRENCYAMOUNT-EXCH_RATE_V = LS_HEAD-KURSF. "汇率APPEND gs_currencyamount TO gt_currencyamount.CLEAR gs_currencyamount.PERFORM add_front_0 USING lv_no.gs_currencyamount-itemno_acc = lv_no. "序号gs_currencyamount-curr_type = '10'.  "货币类型:凭证货币gs_currencyamount-currency = gs_t001-waers. "货币码(币种)gs_currencyamount-exch_rate = ls_head-kursf. "汇率
*            GS_CURRENCYAMOUNT-EXCH_RATE_V = LS_HEAD-KURSF. "汇率gs_currencyamount-amt_doccur = gs_item-dmbtr. "交易货币金额"            gs_currencyamount-exch_rate = ls_head-kursf. "汇率APPEND gs_currencyamount TO gt_currencyamount.ENDIF.ENDIF.*------------- 货币项目 END  ---------------------**------------  增强结构   START ------------------*CLEAR: gs_extension2.CLEAR: ls_zfidoc.ls_zfidoc-posnr = lv_no.          "凭证行项目ls_zfidoc-bschl = gs_item-bschl.  "记账代码ls_zfidoc-xnegp = gs_item-xnegp.  "反记账ls_zfidoc-rstgr = gs_item-rstgr.  "原因代码ls_zfidoc-ps_psp_pnr = gs_item-projk. "工作分解结构元素ls_zfidoc-numpg = gs_head-numpg.  "凭证顺序号IF gs_item-bschl = '19' OR gs_item-bschl = '09' OR gs_item-bschl = '29' OR gs_item-bschl = '39'.ls_zfidoc-umskz = gs_item-umskz .ENDIF.
*  ls_zfidoc-wdate = gs_item-wdate.  " 签发日期
*  ls_zfidoc-wname = gs_item-wname.  " 汇票收款人
*  ls_zfidoc-wort2 = gs_item-wort2.  " 汇票受票人的城市
*  ls_zfidoc-wbzog = gs_item-wbzog.  " 汇票付款人
*  ls_zfidoc-wort1 = gs_item-wort1.  " 出票人城市"ls_zfidoc-status_new = '2'. "2,代表预制凭证*------------  增强结构   END  ------------------*gs_extension2-structure  = 'ZFIS002'.gs_extension2-valuepart1 = ls_zfidoc."增强字段APPEND gs_extension2 TO gt_extension2.CLEAR: gs_extension2.CLEAR: ls_zfidoc.*------------  客户项目   START ------------------*IF gs_item-bschl BETWEEN '01' AND '19'.CLEAR gs_accountreceivable.gs_accountreceivable-itemno_acc  = lv_no."凭证行gs_accountreceivable-item_text   = gs_item-sgtxt."项目文本PERFORM add_front_0 USING gs_item-hkont.gs_accountreceivable-customer    = gs_item-hkont."客户IF gs_item-hkont_a IS NOT INITIAL .gs_accountreceivable-gl_account  = |{ gs_item-hkont_a ALPHA = IN }|."科目ENDIF .gs_accountreceivable-sp_gl_ind   = gs_item-umskz."SGL(特别总账标志)gs_accountreceivable-pmnttrms    = gs_item-zterm."基准日期(付款条件)gs_accountreceivable-bline_date  = gs_item-zfbdt."基准日期(收付款基准日期)gs_accountreceivable-dsct_days1  = gs_item-zbd1t."现金折扣天数"    gs_accountreceivable-profit_ctr  = gs_item-prctr."利润中心gs_accountreceivable-alloc_nmbr  = gs_item-zuonr."分配gs_accountreceivable-c_ctr_area  = gs_item-kkber."信用gs_accountreceivable-bline_date  = gs_item-netdt. "到期日期APPEND gs_accountreceivable TO gt_accountreceivable.ENDIF.
*------------  客户项目   END   ------------------**------------  供应商项目 START ------------------*"IF gs_item-bschl BETWEEN '21' AND '39'.CLEAR gs_accountpayable.gs_accountpayable-itemno_acc  = lv_no."凭证行gs_accountpayable-item_text   = gs_item-sgtxt."项目文本PERFORM add_front_0 USING gs_item-hkont.gs_accountpayable-vendor_no   = gs_item-hkont. "供应商,使用的是原始值的hkont字段IF gs_item-hkont_a IS NOT INITIAL .gs_accountpayable-gl_account  = |{ gs_item-hkont_a ALPHA = IN }|. "备选总账科目??ENDIF .gs_accountpayable-sp_gl_ind   = gs_item-umskz. "特别总账标识
*          gs_accountpayable-comp_code   =  ls_head-bukrs.gs_accountpayable-pmnttrms    = gs_item-zterm."付款条件码gs_accountpayable-bline_date  = gs_item-zfbdt."基准日gs_accountpayable-dsct_days1  = gs_item-zbd1t."现金折扣天数PERFORM add_front_0 USING gs_item-prctr."       gs_accountpayable-profit_ctr  = gs_item-prctr."利润中心gs_accountpayable-alloc_nmbr  = gs_item-zuonr."分配gs_accountpayable-bline_date  = gs_item-netdt. "到期日期APPEND gs_accountpayable TO gt_accountpayable.ENDIF.
*------------  供应商项目  END   ------------------*
ENDLOOP.* 特别总账标识特殊处理( 详见LFACIF5DFI_DOCUMENT_CHECK )
IF lv_umskz = 'W' OR lv_umskz = 'S'.FREE MEMORY ID 'ZFIU001'.EXPORT lv_umskz TO MEMORY ID 'ZFIU001'.CLEAR lv_umskz.FREE MEMORY ID 'ZFIU001_ED'.EXPORT lt_bsed TO MEMORY ID 'ZFIU001_ED'."CLEAR lt_bsed.
ENDIF.DATA: obj_key  LIKE bapiache02-obj_key,obj_type LIKE bapiache02-obj_type,obj_sys  LIKE bapiache02-obj_sys.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'EXPORTINGdocumentheader    = gs_documentheader   "表头
*   CUSTOMERCPD       =
*   CONTRACTHEADER    =
*       IMPORTING
*   OBJ_TYPE          =
*   OBJ_KEY           =
*   OBJ_SYS           =TABLESaccountgl         = gt_accountgl    "总帐科目项accountreceivable = gt_accountreceivable  "客户项目accountpayable    = gt_accountpayable     "供应商项目
*   ACCOUNTTAX        =currencyamount    = gt_currencyamount   "货币项目
*   CRITERIA          =
*   VALUEFIELD        =
*   EXTENSION1        =return            = gt_return
*   PAYMENTCARD       =
*   CONTRACTITEM      =extension2        = gt_extension2
*   REALESTATE        =
*   ACCOUNTWT         =.IF sy-subrc = 0.READ TABLE gt_return INTO gs_return WITH KEY type = 'E'.IF sy-subrc <> 0.*---------原本顾问这里是没有的,但是要再次将ZFIU001这个内存ID赋值,否则无法创建特殊总账标识为W的凭证!!!! ADD BY LHY 20240726 START $ -----
*----核心函数:FI_DOCUMENT_CHECK的第9行和第10行的增强,因为在使用完BAPI_ACC_DOCUMENT_CHECK之后,会删除ZFIU001内存,
*----导致创建会计凭证的时候再去执行FI_DOCUMENT_CHECK,就会不通过,就会报错!!!!lv_umskz = 'W'. "手动赋值为W,一定要有!* 特别总账标识特殊处理( 详见LFACIF5DFI_DOCUMENT_CHECK )IF lv_umskz = 'W' OR lv_umskz = 'S'.FREE MEMORY ID 'ZFIU001'.EXPORT lv_umskz TO MEMORY ID 'ZFIU001'.CLEAR lv_umskz.FREE MEMORY ID 'ZFIU001_ED'.EXPORT lt_bsed TO MEMORY ID 'ZFIU001_ED'.CLEAR lt_bsed.ENDIF.
*---------原本顾问这里是没有的,但是要再次将ZFIU001这个内存ID赋值,否则无法创建特殊总账标识为W的凭证!!!! ADD BY LHY 20240726 END  $ -----"传递事务类型EXPORT t1 = gt_anbwa TO MEMORY ID 'GT_ANBWA'.REFRESH gt_return.CLEAR gs_return.CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'EXPORTINGdocumentheader    = gs_documentheader
*       CUSTOMERCPD       =
*       CONTRACTHEADER    =
*      IMPORTING
*       obj_type          =
*       obj_key           =
*       obj_sys           =TABLESaccountgl         = gt_accountgl "总帐科目项accountreceivable = gt_accountreceivableaccountpayable    = gt_accountpayable
*       ACCOUNTTAX        =currencyamount    = gt_currencyamount
*       CRITERIA          =
*       VALUEFIELD        =
*       EXTENSION1        =return            = gt_return
*       PAYMENTCARD       =
*       CONTRACTITEM      =extension2        = gt_extension2
*       REALESTATE        =
*       ACCOUNTWT         =.ENDIF.
ENDIF.READ TABLE gt_return INTO gs_return WITH KEY type = 'E'.
IF sy-subrc = 0 .ROLLBACK WORK .LOOP AT gt_return INTO gs_return.i_s_msg-msgty = gs_return-type.i_s_msg-msgid = gs_return-id.i_s_msg-msgno = gs_return-number.i_s_msg-msgv1 = gs_return-message_v1.i_s_msg-msgv2 = gs_return-message_v2.i_s_msg-msgv3 = gs_return-message_v3.i_s_msg-msgv4 = gs_return-message_v4.CALL FUNCTION 'BAL_LOG_MSG_ADD'EXPORTINGi_log_handle = e_log_handlei_s_msg      = i_s_msg.ENDLOOP.CALL FUNCTION 'BAL_DSP_PROFILE_POPUP_GET'IMPORTINGe_s_display_profile = l_s_display_profileEXCEPTIONSOTHERS              = 1.l_s_display_profile-use_grid          = 'X'.l_s_display_profile-disvariant-report = sy-repid.l_s_display_profile-disvariant-handle = 'LOG'.CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'EXPORTINGi_s_display_profile = l_s_display_profileEXCEPTIONSOTHERS              = 1.STOP .
ELSE .CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'EXPORTINGwait = 'X'.IF sy-langu = '1'."DATA: msgtext TYPE string.MESSAGE s000(zfi_msg) WITH '数据导入成功!!!' .ELSE.MESSAGE s000(zfi_msg) WITH 'Data import is successful!!!' .ENDIF.LOOP AT gt_return INTO gs_return.i_s_msg-msgty = gs_return-type.i_s_msg-msgid = gs_return-id.i_s_msg-msgno = gs_return-number.i_s_msg-msgv1 = gs_return-message_v1.i_s_msg-msgv2 = gs_return-message_v2.i_s_msg-msgv3 = gs_return-message_v3.i_s_msg-msgv4 = gs_return-message_v4.CALL FUNCTION 'BAL_LOG_MSG_ADD'EXPORTINGi_log_handle = e_log_handlei_s_msg      = i_s_msg.ENDLOOP."MESSAGE gs_return-message TYPE 'S'.CALL FUNCTION 'BAL_DSP_PROFILE_POPUP_GET'IMPORTINGe_s_display_profile = l_s_display_profileEXCEPTIONSOTHERS              = 1.l_s_display_profile-use_grid          = 'X'.l_s_display_profile-disvariant-report = sy-repid.l_s_display_profile-disvariant-handle = 'LOG'.CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'EXPORTINGi_s_display_profile = l_s_display_profileEXCEPTIONSOTHERS              = 1.
ENDIF.
*&---------------------------------------------------------------------*
*& Form add_front_0:添加前导0
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*&      --> LV_NO
*&---------------------------------------------------------------------*
FORM add_front_0 USING string.CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'EXPORTINGinput  = stringIMPORTINGoutput = string.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_T001:获取公司代码和货币码
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM get_t001 .CHECK gt_head IS NOT INITIAL.DATA: ls_head LIKE gs_head,lt_head LIKE gt_head.lt_head = gt_head.SORT lt_head BY bukrs.DELETE ADJACENT DUPLICATES FROM lt_head COMPARING bukrs.CHECK lt_head IS NOT INITIAL.SELECT bukrs waers FROM t001 "获取公司代码和货币码INTO CORRESPONDING FIELDS OF TABLE gt_t001FOR ALL ENTRIES IN lt_headWHERE bukrs = lt_head-bukrs.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form GET_TBSL:获取过帐码
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM get_tbsl .SELECT * FROM tbsl INTO TABLE gt_tbsl.
ENDFORM.

代码解析

变量定义

在这里插入图片描述

抬头和项目初始值

在这里插入图片描述

表头赋值

在这里插入图片描述

调用BAPI

在这里插入图片描述

其他的子例程

在这里插入图片描述

核心内表

在这里插入图片描述

 EXPORTINGdocumentheader    = gs_documentheader   "表头TABLESaccountgl         = gt_accountgl    "总帐科目项accountreceivable = gt_accountreceivable  "客户项目accountpayable    = gt_accountpayable     "供应商项目
*   ACCOUNTTAX        =currencyamount    = gt_currencyamount   "货币项目

增强部分

LFACIF5D程序

在这里插入图片描述
在这里插入图片描述

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Form FI_DOCUMENT_PREPARE, End                                                                                                                     A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1  ZFIE001.    "active version
*ADD BY JT-XZH BY 2022.06.13
DATA: BEGIN OF ls_bsed,wdate TYPE bsed-wdate, "汇票签发日wstat TYPE t031t-txt30,  "汇票状态wname TYPE bsed-wname,   "收款人wort2 TYPE bsed-wort2,   "收票人城市wbzog TYPE bsed-wbzog,   "付款人wort1 TYPE bsed-wort1,   "出票人城市"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(5) Form FI_DOCUMENT_PREPARE, End, Enhancement ZFIE001, Struct. LS_BSED, End                                                                          S"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(5) Form FI_DOCUMENT_PREPARE, End, Enhancement ZFIE001, Struct. LS_BSED, End                                                                          SEND OF ls_bsed.
DATA: lt_bsed LIKE TABLE OF ls_bsed.IMPORT lt_bsed FROM MEMORY ID 'ZFIU001_ED'.
FREE MEMORY ID 'ZFIU001_ED'.LOOP AT xbseg WHERE umsks = 'W' OR umsks = 'S'. " OR umsks = 'S'l_tabix = sy-tabix.READ TABLE lt_bsed INTO ls_bsed INDEX l_tabix.    " 会计凭证汇票明细赋值IF sy-subrc = 0.MOVE-CORRESPONDING ls_bsed TO xbsed.MOVE-CORRESPONDING xbseg TO xbsed.APPEND xbsed.CLEAR ls_bsed.ENDIF.ENDLOOP.
*END BY JT-XZH BY 2022.06.13
ENDENHANCEMENT.
*$*$-End:   (1)---------------------------------------------------------------------------------$*$*
ENDFORM.                    "FI_DOCUMENT_PREPARE

FI_DOCUMENT_CHECK

在这里插入图片描述
在这里插入图片描述

完整程序

FUNCTION fi_document_check.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Function Module FI_DOCUMENT_CHECK, Start                                                                                                          A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 2  ZFIE001.    "active version* ADD BY JT-XZH BY 2022.06.13
DATA: lv_umskz TYPE char1.IMPORT lv_umskz FROM MEMORY ID 'ZFIU001'.
FREE MEMORY ID 'ZFIU001'.IF lv_umskz IS NOT INITIAL.char_w = 'U'.
ENDIF.
* ADD BY JT-XZH BY 2022.06.13ENDENHANCEMENT.
*$*$-End:   (1)---------------------------------------------------------------------------------$*$*
*"----------------------------------------------------------------------
*"*"Globale Schnittstelle:
*"  TABLES
*"      T_ACCHD STRUCTURE  ACCHD
*"      T_ACCIT STRUCTURE  ACCIT
*"      T_ACCCR STRUCTURE  ACCCR
*"      T_ACCDA STRUCTURE  ACCDA OPTIONAL
*"      T_ACCFI STRUCTURE  ACCFI OPTIONAL
*"      T_ACCTX STRUCTURE  ACCBSET OPTIONAL
*"      T_ACCWT STRUCTURE  ACCIT_WT OPTIONAL
*"      T_AUSZ2 STRUCTURE  AUSZ2 OPTIONAL
*"      T_AUSZ_CLR STRUCTURE  AUSZ_CLR OPTIONAL
*"  EXCEPTIONS
*"      SYSTEM_ERROR
*"----------------------------------------------------------------------* Stop in case of preliminary postings with GLVOR = RFBVprocess = char_x.PERFORM check_pp CHANGING process.CHECK process EQ char_x.
*
* Initialisierung aller Daten
*PERFORM init_all.PERFORM init_iban.
*
* Schnittstellentabellen werden für Credit Card Processing angereichert
*PERFORM credit_card_complete.
*
* Schnittstellentabellen werden nach interne FI-Tabellen kopiert
*PERFORM document_read.
*
* Nur weiter, wenn FI-relevante Zeilen
*DESCRIBE TABLE accit_fi LINES sy-tfill.
* Start of note 1626962CLEAR acc_fi_no_comp.IF sy-tfill = 0.acc_fi_no_comp = 'X'.PERFORM complete_statistical_items.                   "note 3073796RETURN.ENDIF.
* End of note 1626962PERFORM document_read_clearing USING '1'.
*
* checks in case of change of parked documents
*PERFORM check_change_pp.
*
* FI-Prüfung der Eingaben des RW-Belegkopfes (jeweils für echt buchen,
* vorerfassen und vollständig setzen)
*PERFORM check_acchd.PERFORM check_accit.PERFORM check_acccr.* Schnittstellentabellen werden aus internen FI-Tabellen zurückkopiert
*PERFORM document_save.
* delete line items with amount 0PERFORM delete_zero_items.                   "notes 2071657 & 2338494PERFORM complete_statistical_items.                     "note 3073796
* Compression of internal tablesPERFORM compression_acc.CLEAR flg_rgurec."""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(2) Function Module FI_DOCUMENT_CHECK, End                                                                                                            A
*$*$-Start: (2)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1  ZFIE002.    "active version
* ADD BY JT-XZH BY 2022.06.13IF lv_umskz = 'W'.char_w = 'W'.ELSEIF lv_umskz = 'S'.char_w = 'S'.ENDIF.CLEAR lv_umskz .* ADD BY JT-XZH BY 2022.06.13
ENDENHANCEMENT.
*$*$-End:   (2)---------------------------------------------------------------------------------$*$*
ENDFUNCTION.

BADI增强

在这里插入图片描述
在这里插入图片描述

 METHOD IF_EX_ACC_DOCUMENT~CHANGE.
***********************************************************************
*       Example to move fields from BAPI parameter EXTENSION2 to structure  *
*       ACCIT (accounting document line items).                             *
*       The dictionary structure (content for EXTENSION2-STRUCTURE) must    *
*       contain field POSNR, (TYPE POSNR_ACC) to indentify the correct line *
*       item of the internal table ACCIT.                                   *
***********************************************************************DATA: WA_EXTENSION   TYPE BAPIPAREX,EXT_VALUE(960) TYPE C,WA_ACCIT       TYPE ACCIT,L_REF          TYPE REF TO DATA,LS_ACCIT       TYPE ACCIT.DATA: BEGIN OF GS_ANBWA,POSNR TYPE ACCIT-POSNR,BSCHL TYPE BSEG-BSCHL,ANBWA TYPE ACCIT-ANBWA,END OF GS_ANBWA.DATA: GT_ANBWA LIKE TABLE OF GS_ANBWA..FIELD-SYMBOLS: <L_STRUC> TYPE ANY,<L_FIELD> TYPE ANY.SORT C_EXTENSION2 BY STRUCTURE.LOOP AT C_EXTENSION2 INTO WA_EXTENSION.AT NEW STRUCTURE.CREATE DATA L_REF TYPE (WA_EXTENSION-STRUCTURE).ASSIGN L_REF->* TO <L_STRUC>.ENDAT.CONCATENATE WA_EXTENSION-VALUEPART1 WA_EXTENSION-VALUEPART2WA_EXTENSION-VALUEPART3 WA_EXTENSION-VALUEPART4INTO EXT_VALUE.MOVE EXT_VALUE TO <L_STRUC>.ASSIGN COMPONENT 'POSNR' OF STRUCTURE <L_STRUC> TO <L_FIELD>.READ TABLE C_ACCIT WITH KEY POSNR = <L_FIELD>INTO WA_ACCIT.IF SY-SUBRC IS INITIAL.MOVE-CORRESPONDING <L_STRUC> TO WA_ACCIT.MODIFY C_ACCIT FROM WA_ACCIT INDEX SY-TABIX.ENDIF.ENDLOOP."预制凭证DATA ZEXT_DATA TYPE ZFIS002.READ TABLE C_EXTENSION2 INTO DATA(LS_EXTE) WITH KEY STRUCTURE = 'ZFIS002'.IF SY-SUBRC = 0.ZEXT_DATA = LS_EXTE-VALUEPART1.MOVE ZEXT_DATA-STATUS_NEW TO C_ACCHD-STATUS_NEW.ENDIF."判断事务类型IF SY-CPROG = 'ZFIU001'.IMPORT T1 = GT_ANBWA FROM MEMORY ID 'GT_ANBWA'.LOOP AT C_ACCIT INTO LS_ACCIT.IF LS_ACCIT-BSCHL BETWEEN 70 AND 75.CLEAR GS_ANBWA.READ TABLE GT_ANBWA INTO GS_ANBWA WITH KEY POSNR = LS_ACCIT-POSNR.IF SY-SUBRC EQ 0.LS_ACCIT-ANBWA = GS_ANBWA-ANBWA.ENDIF.LS_ACCIT-ANLN2 = '0000'.MODIFY C_ACCIT FROM LS_ACCIT TRANSPORTING ANBWA ANLN2.ENDIF.ENDLOOP.ENDIF.ENDMETHOD.

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

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

相关文章

Matplotlib面积图绘制秘籍:让你的数据‘膨胀’起来,但不吹泡泡哦!

1. 引言 嘿&#xff0c;数据迷们&#xff01;想不想让你的数据‘活’起来&#xff0c;跳一曲色彩斑斓的面积舞&#xff1f;Matplotlib面积图&#xff0c;不只是数字的堆砌&#xff0c;它是故事的讲述者&#xff0c;让复杂数据变得一目了然&#xff0c;还带点小幽默。快来一探究…

鸿蒙应用框架开发【首选项】 本地数据与文件

首选项 简介 本示例使用ohos.data.preferences接口&#xff0c;展示了使用首选项持久化存储数据的功能。 效果预览 使用说明 1.点击顶部titleBar的右侧切换按钮&#xff0c;弹出主题菜单&#xff0c;选择任意主题则切换相应的主题界面&#xff1b; 2.退出应用再重新进入&a…

C++客户端Qt开发——界面优化(美化登录界面)

美化登录界面 在.ui中拖入一个QFream&#xff0c;顶层窗口的QWidget无法设置背景图片&#xff0c;套上一层QFrame将背景图片设置到QFrame上即可 用布局管理器管理元素&#xff1a;用户名LineEdit&#xff0c;密码LineEdit&#xff0c;记住密码ComboBox&#xff0c;登录Button…

Windows本地构建镜像推送远程仓库

下载 Docker Desktop https://smartidedl.blob.core.chinacloudapi.cn/docker/20210926/Docker-win.exe 使用本地docker构建镜像和推送至远程仓库&#xff08;harbor&#xff09; 1、开启docker的2375端口 2、配置远程仓库push镜像可以通过http harbor.soujer.com:5000ps&am…

【C语言】数据类型全解析:编程效率提升的秘诀

目录 C语言数据类型详解1. 基本数据类型1.1 整型示例代码输出结果 1.2 浮点型示例代码输出结果 1.3 字符型示例代码输出结果 2. 派生数据类型2.1 数组示例代码输出结果 2.2 指针示例代码输出结果 2.3 结构体示例代码输出结果 2.4 共用体示例代码输出结果 3. 类型限定符3.1 cons…

为什么Word中正文总会变成标题?

问题 选中文字之后点击正文&#xff0c;格式总是会自动变成标题&#xff0c;然后出现在目录中&#xff0c;改不掉。 方法 是因为段落样式的大纲级别设置了标题级别 选中识别成标题的正文&#xff0c;右键选择段落&#xff0c;把大纲级别设置成正文就好。

微信小程序云开发订单微信支付与小票和标签打印的完整高效流程

一个字“全”&#xff01;&#xff01;&#xff01; 前言一、流程设定1、如何开通云支付流程2、以订单下单为例的支付流程2.1 业务场景介绍2.2 业务场景流程图 二、代码与代码文件组成1、页面JS2、云函数payPre3、支付回调函数pay_cb3.1 准备条件3.2 必要认知3.3 pay_cb 完整函…

Llama 4训练已开启!Meta科学家最新采访,揭秘Llama 3.1是如何炼成的

Llama 3.1的诞生标志着人工智能领域的一个重要里程碑&#xff0c;它不仅是Meta在大型语言模型&#xff08;LLM&#xff09;研发上的一次重大突破&#xff0c;也代表了开源AI模型在技术进步和应用潜力上的新高度。以下是对Llama 3.1的炼成过程、观点阐述以及未来发展趋势的分析。…

莫斯科的社会生态环境之一瞥

题记 社会生态&#xff0c;它是指人类随着利用科技对环境的作用所呈现出的人和人的关系&#xff0c;人和人群的关系&#xff0c;人群和环境的关系 。而生态文明的理念&#xff0c;提倡的不止是尊重自然、顺应自然、保护自然&#xff0c;也包含注重规律的和谐性、可持续性、稳定…

如何使用CANoe自带的TCP/IP Stack验证TCP的零窗口探测机制

如果想利用CANoe自带的TCP/IP协议栈验证TCP的零窗口探测机制,就必须添加一个网络节点并配置独立的CANoe TCP/IP协议栈,作为验证对象。而与它进行TCP通信的对端也是一个网络节点,但不要配置TCP/IP协议栈,而是使用CAPL代码在底层组装TCP报文模拟TCP通信过程。这样可以尽量减少…

2024年最强网络安全学习路线,详细到直接上清华的教材!

关键词&#xff1a;网络安全入门、渗透测试学习、零基础学安全、网络安全学习路线 首先咱们聊聊&#xff0c;学习网络安全方向通常会有哪些问题前排提示&#xff1a;文末有CSDN官方认证Python入门资料包 &#xff01; 1、打基础时间太长 学基础花费很长时间&#xff0c;光语…

医院体检信息管理系统,C#体检系统源码,健康体检系统PEIS

体检服务全流程 检前 检前注意事项提醒-体检预约-套餐选择-体检签到-费用缴纳 检中 科室队列提醒-增项检中支付 检后 报告查询-体检百科-报告解读-问卷调查 体检管理系统模块介绍 一、登记管理模块 登记体检者基本信息&#xff0c;包括唯一的体检编号&#xff0c;姓名、…

【Golang 面试 - 基础题】每日 5 题(八)

✍个人博客&#xff1a;Pandaconda-CSDN博客 &#x1f4e3;专栏地址&#xff1a;http://t.csdnimg.cn/UWz06 &#x1f4da;专栏简介&#xff1a;在这个专栏中&#xff0c;我将会分享 Golang 面试中常见的面试题给大家~ ❤️如果有收获的话&#xff0c;欢迎点赞&#x1f44d;收藏…

Miniconda快速安装conda

关注B站可以观看更多实战教学视频&#xff1a;hallo128的个人空间 安装官方网址&#xff1a;https://docs.anaconda.com/miniconda/#quick-command-line-install 1. Miniconda for Windows curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe -o …

【LeetCode】56. 区间合并

区间合并 题目描述&#xff1a; 以数组 intervals 表示若干个区间的集合&#xff0c;其中单个区间为 intervals[i] [starti, endi] 。请你合并所有重叠的区间&#xff0c;并返回 一个不重叠的区间数组&#xff0c;该数组需恰好覆盖输入中的所有区间 。 示例 1&#xff1a; …

捷径,这世上有没有捷径

Q&#xff1a;大师&#xff0c;这个世界上有没有捷径&#xff1f; A&#xff1a;有呀&#xff0c;有捷径呀 Q&#xff1a;大师&#xff0c;那我要怎么走&#xff1f; A&#xff1a;你错啦&#xff0c;不要想着走捷径&#xff0c;因为捷径不是用来走的&#xff0c;捷径是用来飞的…

SNN系列论文阅读:梦开始的地方

论文地址:https://igi-web.tugraz.at/people/maass/psfiles/85a.pdf 1. nn分类 一开始论文将nn分为三类, 1. 最初的MP多层感知机 2. 加入非线性激活, 并可以反向传播训练的神经网络 3. SNN 注意分类不是普通的fc网络,rnn网络和snn网络 2. 理解脉冲 LIF模型,全称Leak…

CUDA_Occupancy_Calculator计算公式

CUDA_Occupancy_Calculator计算公式

【设计模式:单例模式】

单例模式的特点&#xff1a; 单例类只允许一个实例单例类必须自己创造自己的唯一实例单例类必须给所有其他对象提供这一实例 单例模式底层如何实现&#xff1a; 私有化构造函数&#xff0c;类外部无法创造类对象&#xff0c;实现了单例类只允许有一个实例对象的特点类定义中含有…

【技术支持案例】使用S32K144+NSD8381驱动电子膨胀阀

文章目录 1. 前言2. 问题描述3. 理论分析3.1 NSD8381如何连接电机3.2 S32K144和NSD8381的软件配置 4.测试验证4.1 测试环境4.2 测试效果4.3 测试记录 1. 前言 最近有客户在使用S32K144NSD8381驱动电子膨胀阀时&#xff0c;遇到无法正常驱动电子膨胀阀的情况。因为笔者也是刚开…