Archived discussions are read-only. Learn more about SAP Q&A

Update price in PO using BAPI_PO_CHANGE

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.

          purchaseorder = wt_wbs_elements-ebeln
          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?

Not what you were looking for? View more on this topic or Ask a question