SAP 采购订单 Adobe 消息输出

目录

[1 简介](#1 简介)

[2 业务数据例子](#2 业务数据例子)

[3 选择增强 & 代码](#3 选择增强 & 代码)

[1)BADI: MM_PUR_S4_PO_MODIFY_HEADER](#1)BADI: MM_PUR_S4_PO_MODIFY_HEADER)

[2)BADI: MM_PUR_S4_PO_MODIFY_ITEM](#2)BADI: MM_PUR_S4_PO_MODIFY_ITEM)

[4 自定义 Adobe form](#4 自定义 Adobe form)

[1)PO Master form](#1)PO Master form)

[2)PO form](#2)PO form)

[5 前台主数据配置](#5 前台主数据配置)

[6 后台配置](#6 后台配置)

1)基于常规规则定义输出,可以参考标准来配即可。

[2)关联自定义的 PO Master form 和 PO form。](#2)关联自定义的 PO Master form 和 PO form。)


1 简介

标准的 SAP 采购订单消息输出不会带税金额,但实际业务都会有税金额产生,这时候我们不得不选择做增强+创建自定义 Adboe form 的方式满足实际业务。

2 业务数据例子

PO 表头和行项目明细分别增加,自定义字段 PO 总金额(净价+税价)和自定义 PO 税金额和税码。自定义的 PO 总金额和 PO 税金额反映到 Adobe 自定义模板。

3 选择增强 & 代码

1)BADI: MM_PUR_S4_PO_MODIFY_HEADER

* purchaseorderchange-<your_field_name> = 'Your field content'.

data: lv_total_amount type if_ex_mmpur_final_check_po=>bwert.

data lv_taxRate TYPE P length 2.

loop at purchaseorderitem_table into data(ls_item) where purchasingdocumentdeletioncode = space.

clear lv_taxRate.

case ls_item-taxcode.

when 'J2'.

lv_taxRate = 13.

when 'Y1'.

lv_taxRate = 11.

when 'J4'.

lv_taxRate = 9.

when 'JB'.

lv_taxRate = 6.

when 'R3'.

lv_taxRate = 5.

when 'JC'.

lv_taxRate = 4.

when 'R2'.

lv_taxRate = 3.

when 'J5'.

lv_taxRate = 1.

when 'J0'.

lv_taxRate = 0.

WHEN others.

endcase.

lv_total_amount = lv_total_amount + ls_item-netamount + ls_item-netamount * lv_taxRate / 100.

endloop.

PURCHASEORDERCHANGE-YY1_PO_TOTAL_VALUE_PDH = lv_total_amount.

2)BADI: MM_PUR_S4_PO_MODIFY_ITEM

" purchaseorderitemchange-<your_field_name> = 'Enter your field content'.

"Defaulting of TaxCode for PO item in first round-trip

"IF purchaseorderitem_old IS INITIAL.

" purchaseorderitemchange-taxcode = 'V2'.

"ENDIF.

"Defaulting of PurchasingInfoRecordUpdateCode for PO item

"either in first round-trip or when material or plant changes

"IF purchaseorderitem_old IS INITIAL

" OR purchaseorderitem-material <> purchaseorderitem_old-material

" OR purchaseorderitem-plant <> purchaseorderitem_old-plant.

" purchaseorderitemchange-purchasinginforecordupdatecode = 'B'.

"ENDIF.

"Set the info update flag when the supplier number is filled.

"IF purchaseorderitem-suppliermaterialnumber IS NOT INITIAL.

" IF purchaseorderitem_old-purchasinginforecordupdatecode IS INITIAL AND

" purchaseorderitem-purchasinginforecordupdatecode IS INITIAL.

" purchaseorderitemchange-purchasinginforecordupdatecode = 'A'.

" ENDIF.

"ENDIF.

"Defaulting of Shipping Type in first roundtrip

"IF purchaseorderitem_old IS INITIAL AND purchaseorderitemchange-shippingtype IS INITIAL.

" purchaseorderitemchange-shippingtype = '01'.

"ENDIF.

data lv_taxcode type C length 2 .

data lv_taxRate TYPE P length 2.

if purchaseorderitemchange-taxcode is not initial.

lv_taxcode = purchaseorderitemchange-taxcode.

else.

select single TaxCode from I_PurchaseOrderItemAPI01

where PurchaseOrder = @purchaseorderitem-purchaseorder and PurchaseOrderItem = @purchaseorderitem-PurchaseOrderItem

into @lv_taxcode.

endif.

case lv_taxcode.

when 'J2'.

lv_taxRate = 13.

when 'Y1'.

lv_taxRate = 11.

when 'J4'.

lv_taxRate = 9.

when 'JB'.

lv_taxRate = 6.

when 'R3'.

lv_taxRate = 5.

when 'JC'.

lv_taxRate = 4.

when 'R2'.

lv_taxRate = 3.

when 'J5'.

lv_taxRate = 1.

when 'J0'.

lv_taxRate = 0.

WHEN others.

endcase.

if lv_taxcode is not initial.

purchaseorderitemchange-yy1_po_item_tax_amount_pdi = ( purchaseorderitem-netamount * lv_taxRate ) / 100 .

endif.

purchaseorderitemchange-yy1_po_tax_coce_pdi = lv_TaxCode .

4 自定义 Adobe form

自定义 PO Master form 和 PO form 关联起来。基于标准的 PO Master form 和 PO form 复制下来,然后再增加税金额字段。总金额字段重新命名成自定义字段,这样才能接收到前台 PO 自定义总金额数据。

1)PO Master form

2)PO form

5 前台主数据配置

基于常规的消息输出挨个定义即可。

6 后台配置

1)基于常规规则定义输出,可以参考标准来配即可。

2)关联自定义的 PO Master form 和 PO form。

相关推荐
Jennifer33K5 天前
Adobe Creative Cloud卸载
adobe
老K(郭云开)5 天前
最新版Chrome浏览器加载ActiveX控件之Adobe PDF阅读器控件
chrome·adobe·pdf
MediaTea5 天前
Pr:Adobe Stock 音乐流派分类
adobe
MediaTea5 天前
Pr:Adobe Stock 音乐氛围分类
adobe
shelby_loo8 天前
edu学生邮箱免费使用Adobe套件
adobe
1021123456789018 天前
PDF文件页面转换成图片怎么弄-免费PDF编辑工具分享
人工智能·科技·学习·adobe·pdf·wps·adobe acrobat reader
菜鸟财一生19 天前
Adobe illustrator-AI2025重磅发布:全新功能炫耀全面AI图像处理
ui·adobe·illustrator
MediaTea21 天前
Ps:存储 Adobe PDF - 一般
adobe·pdf
MediaTea22 天前
Ps:存储 Adobe PDF
adobe·pdf
TOMaster.23 天前
【真正离线安装】Adobe Flash Player 32.0.0.156 插件离线安装包下载(无需联网安装)
adobe·flash插件大全·flash离线安装包