会计凭证创建

 

创建前检查  BAPI_ACC_DOCUMENT_CHECK

创建 BAPI_ACC_DOCUMENT_POST 

测试运行的可以用CHECK 检查数据正确性

预制凭证生成  调用创建 BAPI_ACC_DOCUMENT_POST  需要传递一个参数值

在BAPI的凭证抬头数据结构中 将doc_status  字段状态设置为 2 生成的就是预制凭证   否则不传递值

凭证抬头数据
  documentheader-comp_code = p_bukrs.                  "公司代码
  documentheader-doc_type = gt_item01-blart.           "凭证类型
  documentheader-username = sy-uname.                   "用户名
  documentheader-header_txt = gt_item01-bktxt.          "抬头文本
  documentheader-pstng_date = gt_item01-budat.          "过账日期
  documentheader-doc_date   = gt_item01-bldat.          "凭证日期
  documentheader-fis_period = gt_item01-monat.          "记账期间
  documentheader-ref_doc_no = gt_item01-xblnr.          "参考凭证号
  documentheader-bus_act = 'RFBU'.  "总账凭证,如果是资产类的不能是这个
  IF rb_2 = 'X'. "预制凭证
    documentheader-doc_status = '2'.
  ENDIF.

 

* 凭证行项目数据  略
 

 CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
        EXPORTING
          documentheader    = documentheader
*         CUSTOMERCPD       =
        IMPORTING
          obj_type          = obj_type
          obj_key           = obj_key
          obj_sys           = obj_sys
        TABLES
          accountreceivable = accountreceivable
          accountgl         = accountgl
          accounttax        = accounttax
          accountpayable    = accountpayable
          criteria          = criteria
*         VALUEFIELD        =
          currencyamount    = currencyamount
          return            = return
*         SALESORDER        =
*         SALESAMOUNT       =
          extension2        = extension2.
 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值