在使用该BAPI创建和新增PO行项目时,行项目价格都能得到创建,但是在修改已经存在的行价格时,BAPI成功,但价格没有被修改,需要填写POCOND/POCONDX内表数据,示例如下:
PARAMETERS: p_ebeln LIKE ekko-ebeln.
 
DATA: t_poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE.
DATA: t_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.
DATA: t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: t_cond LIKE bapimepocond OCCURS 0 WITH HEADER LINE.
DATA: t_condx LIKE bapimepocondx OCCURS 0 WITH HEADER LINE.
 
 
t_poitem-po_item = '00010'.
t_poitem-net_price = '17.00'.
APPEND t_poitem.
 
t_poitemx-po_item = '00010'.
t_poitemx-net_price = 'X'.
t_poitemx-po_itemx = 'X'.
APPEND t_poitemx.
 
t_cond-itm_number = '00010'.
t_cond-cond_type = 'P000'.    " Give the pricing condition type that derives netprice
t_cond-cond_value = '17.00'.
t_cond-currency = 'USD'.
t_cond-change_id = 'U'.
APPEND t_cond.
 
t_condx-itm_number = '00010'.
t_condx-itm_numberx = 'X'.
t_condx-cond_type = 'X'.
t_condx-cond_value = 'X'.
t_condx-currency = 'X'.
t_cond-change_id = 'X'.
APPEND t_condx.
 
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = p_ebeln
TABLES
return = t_return
poitem = t_poitem
poitemx = t_poitemx
pocond = t_cond
pocondx = t_condx.
 
COMMIT WORK.

参考资料:
https://forums.sdn.sap.com/thread.jspa;jsessionid=(J2EE5212100)ID0223132050DB10264534696541550164End;saplb_*=(J2EE5212100)5212150?messageID=7559709#7559709
posted on 2009-08-24 11:09  zhumk  阅读(4150)  评论(0编辑  收藏  举报