Hi experts,
I'm using BAPI_PO_CHANGE to modify the material in several PO but it doesn't work. If I modify it using ME22N it works fine, but I need to do it massively and so I can't use ME22N.
The code I'm using is:
MOVE gwa_data-ebelp TO gwa_poitem-po_item.
CONCATENATE lv_matnr 'N' INTO gwa_poitem-material. "lv_matnr is the old material
APPEND gwa_poitem TO gt_poitem.
MOVE gwa_data-ebelp TO gwa_poitemx-po_item.
MOVE 'X' TO gwa_poitemx-po_itemx.
MOVE 'X' TO gwa_poitemx-material.
APPEND gwa_poitemx TO gt_poitemx.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = gwa_data-ebeln
TABLES
return = gt_return
poitem = gt_poitem
poitemx = gt_poitemx.
The messages I get are:
But nothing is changed in the PO.
Thanks for your help.
Carles