07-15-2010 1:23 PM
I have changed the price for a given material via tcode MEK2, and want afterwards to update the price on the PO.
The code looks like this:
ls_poitem-po_item = wt_wbs_elements-ebelp.
ls_poitem-calctype = 'C'.
APPEND ls_poitem TO lt_poitem.
ls_poitemx-po_item = wt_wbs_elements-ebelp.
ls_poitemx-po_itemx = 'X'.
ls_poitemx-calctype = 'X'.
APPEND ls_poitemx TO lt_poitemx.
ls_pocond-cond_type = 'YTPM'.
ls_pocond-itm_number = wt_wbs_elements-ebelp.
ls_pocond-change_id = 'U'. "update
APPEND ls_pocond TO lt_pocond.
ls_pocondx-cond_type = 'YTPM'.
ls_pocondx-itm_number = wt_wbs_elements-ebelp.
ls_pocondx-cond_value = 'X'.
ls_pocondx-change_id = 'X' .
APPEND ls_pocondx TO lt_pocondx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = wt_wbs_elements-ebeln
TABLES
return = lt_return
poitem = lt_poitem
poitemx = lt_poitemx
pocond = lt_pocond
pocondx = lt_pocondx.
It seems that the PO order is updated with the new price, so that's great.
The problem is, even that nothing is updated I got the message -that the PO is updated.
Return table contain following entries:
S 06 023 Standard PO 4500002304 changed
W 06 261 No message generated for output of purchasing document
I V1 204 Condition YTPM cannot be processed manually
Can anybody help?
07-16-2010 8:12 AM
During some test, I have found out - if I set the value 'X' in NO_MESSAGE_REQ (Import parameters), then I will not get the message S 06 "Standard PO 4500002304 changed".
But my problem is then, even that the price is updated, I don't get the message that the PO is changed.
So my case is:
If i set a X in NO_MESSAGE_REQ I don't get the wrong message about update, when the PO isn't updated - but I don't either get the message that the PO is updated, when it's acutally is updated.
Please help.
02-22-2016 9:59 AM
Hi Lars N,
Please use 'BAPI_TRANSACTION_COMMIT' after success message of BAPI_PO_CHANGE'
Regards,
PrAvIn