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
Hi Carles,
I think you didn't call the Transaction commit work in your code.
Regards,
Srini.
Did you check note 1908567 ?
In another post about this issue the user solved it by filling the poitem and poitemx tables with the fields to be changed ONLY.
Before he had the same problem as you have, but he used BAPI_PO_GETDETAIL to get the details, used them to fill poitem and changed only the value then called PO_CHANGE at got the error.
See also:
http://scn.sap.com/thread/1265520
Maybe you can try this out as well (if applicable for your situation)
Peter
Oooops I see now it has been solved.
Add a comment