0 Replies Latest reply: Nov 17, 2010 2:03 PM by Wil V RSS

BAPI_PO_CHANGE to update price

Wil V
Currently Being Moderated

Hi

 

I am using the below code to update the net price of the PO but it does not work. Any idea why? I noticed while looking at ME22N that the price field is disabled even in change mode, I can only change the price in ME22N by going to the services tab and changing the gross price.

 

The documentation of the bapi states

"Services and limits

Changes to existing items cannot be carried out with the Change method. It is only possible to create new items."

 

So I dont think this bapi can change the price of existing items through services. Below is the code im using and am unable to change the price. Please advice me on this.

 

 

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'.
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.

 

Actions