PARAMETERS p_dn TYPE vbeln_vl.
PARAMETERS p_so TYPE vbeln_va.
DATA: lt_billingdatain TYPE TABLE OF bapivbrk,
ls_billingdatain TYPE bapivbrk,
lt_success TYPE TABLE OF bapivbrksuccess,
ls_success TYPE bapivbrksuccess,
lt_return TYPE TABLE OF bapiret1,
ls_return TYPE bapiret1.
CLEAR lt_billingdatain[].
*ls_billingdatain-ref_doc_ca = 'J' . "先期SD凭证的凭证类别
*G 合同
*H 退货
*I 免费订单
*J 交货
*K 贷项凭单请求
*L 借项凭单请求
*M 发票
*N 取消发票
*O 贷项凭单
** BAPI赋值
* LOOP AT tp_din_item INTO ls_din_item.
* lv_index = lv_index + 1.
ls_billingdatain-doc_number = p_dn ."销售凭证
ls_billingdatain-itm_number = 10.
ls_billingdatain-ref_doc = p_so."参考单据的单据编号
ls_billingdatain-ref_item = 10.
ls_billingdatain-ref_doc_ca = 'J' . "先期SD凭证的凭证类别
ls_billingdatain-salesorg = 'LM00'.
ls_billingdatain-distr_chan = '10'.
ls_billingdatain-division = '10'.
ls_billingdatain-plant = 'LM00'.
ls_billingdatain-material = 'LMTEST'.
ls_billingdatain-req_qty = 5.
ls_billingdatain-sales_unit = 'EA'.
APPEND ls_billingdatain TO lt_billingdatain.
ls_billingdatain-doc_number = p_dn ."."销售凭证
ls_billingdatain-itm_number = 10.
ls_billingdatain-ref_doc = p_so."."参考单据的单据编号
ls_billingdatain-ref_item = 10.
ls_billingdatain-ref_doc_ca = 'J' . "先期SD凭证的凭证类别
ls_billingdatain-salesorg = 'LM00'.
ls_billingdatain-distr_chan = '10'.
ls_billingdatain-division = '10'.
ls_billingdatain-plant = 'LM00'.
ls_billingdatain-material = 'LMTEST'.
ls_billingdatain-req_qty = 5.
ls_billingdatain-sales_unit = 'EA'.
APPEND ls_billingdatain TO lt_billingdatain.
CLEAR: ls_billingdatain.
* ENDLOOP.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
TABLES
billingdatain = lt_billingdatain
* conditiondatain = lt_conditiondatain
* CCARDDATAIN =
* TEXTDATAIN =
* ERRORS =
return = lt_return
success = lt_success
.
*
READ TABLE lt_success INTO ls_success INDEX 1.
WRITE ls_success-bill_doc.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
另外VF04是功能程序,可以copy出来根据需要修改
DEMO:VF01 、VF04外向交货单开票BAPI_BILLINGDOC_CREATEMULTIPLE
原创sapLiuMeng ©著作权
©著作权归作者所有:来自51CTO博客作者sapLiuMeng的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Day04 Docker
Docker
docker Docker 系统资源 -
DEMO:VF01、VF04外向交货单开票BAPI_BILLINGDOC_CREATEMULTIPLE_SAP刘梦_新浪博客
ABLEOFbapivbrk,ls_billingdatainTYPEbapivbrk,lt_successTYPETABLEO...
python singleton jquery bootstrap php -
ABAP vF01拆分数量开票BAPI
一、根据**公司的实际情况,物流系统参数设置如下:1. 不允许负库存2. 暂估差额生成方式:单到冲回;3. 暂估入库单和发票金额相同时也需生成红蓝单据;4. &n
ABAP vF01拆分数量开票BAPI 数据库 企业管理 参数设置 数据录入