SRM PO传到ECC后,价格变成0

Issue:

因为业务需求,在某些采购组织下,需要去掉GR,IR indicator.可以在BADI - bbp_ecs_po_out_badi实现该需求.但将PO传到ECC后.发现SRM端虽然仍是net price,但在ECC端则价格为0..如果在SRM端更改价格, 则会产生RZ20 error...Please enter net price. ECC端的错误代码是06215

此问题出现在客户升级了support package   SRM5.0 (upgraded to SP 16)  ECC603 (SAP_APPL upgraded to SP 06)

Analysis:

SRM是通过FM BBP_PO_INBOUND更改ECC端的PO.此FM calls BAPI_PO_CREATE1/CHANGE in ECC.

所以需使用report FBGENDAT将测试数据放入BAPI_PO_CHANGE(具体方法见这里)

一些数据检查:

          

参考此note 580225 Purchasing BAPIs: Conditions and pricing对于以下两个值的解释:
- POITEM-PO_PRICE
PO_PRICE = '2': The value transferred in field NET_PRICE is copied as a net price that is set with the condition type specified as base price in the calculation procedure. All other  condition types are deleted. You can only use the PO_PRICE field when creating a  purchase order item. If you want to change the price in  an existing item, you must use the  POCOND or POCONDHEADER condition tables.


- POITEM-CALCTYPE

You can use the CALCTYPE field at item level to define the pricing type.This field includes the same functions as the 'Update' pushbutton on the'Conditions' tab of the Enjoy Purchase Order transaction. You receive the possible pricing types by either clicking the 'Update' pushbutton inthe Enjoy Purchase Order transaction or via the value range of domain KNPRS (Transaction SE11).

Recommendation:

之所以升级前没有此问题,是因为ECC603的SP06包中,有Note 1361829. 该Note将POITEM-CALCTYPE 赋值为 A


If you change POITEM-CALCTYPE from A to B then the system executes a new price determination. BAPI_PO_CHANGE doesn't get error 06215.


标准情况下,如果在SRM端去除了IR标识,传到ECC的PO就会变成net price = 0  (因为ECC的IR标识也没有勾上)

如果要改变这种情况,需要将POITEM-CALCTYPE= B..可以通过badi BBP_PO_INBOUND_BADI改变此逻辑


另外,经常提的问题是,为什么只传net price而不传price condition

逻辑是:SRM只传送net price而不传price determination.但可以通过badi BBP_PO_INBOUND_BADI改变此逻辑.

In standard, in case of extended classic scenario, SRM only sends net_price and quantity to the backend (ERP) system.Pricing conditions are not transfered to the backend PO because SRM PO is the leading PO and backend PO is just a copy of the SRM PO. So that no new price determination is again done at the backend PO. The backend PO is used for creating follow-on documents like GR and IV. You can not also edit a ECS PO in ERP system. That is the reason no pricing conditions are transfered to the backend PO. But only the net_price istransfered to the backend PO. However, if you want to transfer the conditions to the backend PO, you can meet this requirement by implementing the badi BBP_PO_INBOUND_BADI at the backend. For this requirement please implement the note 970839.

参考Note:

850335    Incorrect price in R/3 if currency is changed in SRM

970839    Incorrect price in R/3 if currency & price is changed in SRM

932236    BAPI_PO_CREATE1: Purchase order price unit not transferred

580225    Purchasing BAPIs: Conditions and pricing

539978    Automatic generation of BAPI test data directory

495264    ME21N Control of price determinatn - enhancement of standard

375886    BAPI: Error analysis for BAPIs in purchasing

总结一下:

假设前提: 在ECC,当IR标识去掉后,系统会认为不需要做发票校验,把net price设成0.

标准系统里PO_PRICE = '2' ==>只有net price,其他condition type都去除掉 

              POITEM-CALCTYPE = A ==> price condition不会自动更新(你会发现condition tab没有了)

现在的解决方法是把POITEM-CALCTYPE 赋值为B, 即可以自动更新price condition(你会发现condition tab神奇得出现了,价格也传过来了)

但这样一来,ECC里的IR居然也被勾上了....如果是这样的话,不是跟业务需求又违背了吗?直接改IR不就得了?!

整个故事有点乱...未完待续

原文地址:https://www.cnblogs.com/lazymango/p/1839235.html