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。

相关推荐
lrlianmengba13 天前
推荐一款强大的图像处理软件:Adobe Photoshop2025
图像处理·人工智能·adobe
1021123456789014 天前
怎么对 PDF 添加权限密码或者修改密码-免费软件分享
人工智能·网络安全·adobe·pdf·密码学·wps·福昕阅读器
不秃头的UI设计师16 天前
告别复杂协作:Adobe XD的简化替代方案
adobe
狂小虎19 天前
亲测解决adobe genuine service alert
adobe
IT利刃出鞘1 个月前
Adobe Media Encoder--将可变帧率视频转为固定帧率
adobe·音视频
WCF向光而行1 个月前
Adobe正版服务弹窗 - 解决方案
adobe
白蜡虫可1 个月前
Adobe Illustrator如何在图片快速插入latex公式
ui·adobe·illustrator
shelly聊AI1 个月前
Adobe的反击,传统大厂全面AI化,正面激战OpenAI!
人工智能·adobe
不秃头的UI设计师1 个月前
“探索Adobe Photoshop 2024:订阅方案、成本效益分析及在线替代品“
ui·adobe·photoshop
仙剑魔尊重楼1 个月前
Adobe Photoshop 2025(PS2025版) v26.0.0.26 中文版新功能特色
ui·adobe·photoshop