Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

.BAPI_PO_CHANGE - ME 664

Former Member
0 Kudos

Hi,

I am using BAPI_PO_CHANGE to change a purchase order line item.

In the POITEM structure I populate the necessary fields to be changed. So in 1 specific case, I am trying to change the material and the quantity. I also populate the necessary POITEMX structure with the necessary fields.

The BAPI works fine and changes the quantity, but does not change the material and returns message ME 664 ( Change Material could not be effected ). Adding a new line item with a material works fine, and changing other fields on the line item also works fine. So this problem is only for the material field.

When I try and change the purchase order line item manually, the material is able to be changed without any problems.

Has anyone come across a situation like this before?

Thanks,

Miguel

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Are you able to save PO manually. it might be the case that already PO has been released against the material number and hance it might not allow you to chnage material now. if some godds kovement have took place against the Po line item again it will not allow you to chnage the PO.

3 REPLIES 3

Former Member
0 Kudos

Are you able to save PO manually. it might be the case that already PO has been released against the material number and hance it might not allow you to chnage material now. if some godds kovement have took place against the Po line item again it will not allow you to chnage the PO.

0 Kudos

Hi Santosh,

Yes, I am able to successfully save the purchase order fine manually.

There is no purchase order history against the specific line item that I am trying to change the material of.

Thanks,

Miguel

0 Kudos

Hi,

The problem was that I was using BAPI_PO_GETDETAIL1, to get the line items of the purchase order.

I was then using the poitem table that is returned from this BAPI as the basis for the BAPI_PO_CHANGE poitem table, except that I was making the necessary changes to the field.

What I did was not use the poitem table from BAPI, but rather create one from scratch, with only the necessary changed fields populated.

The BAPI now makes the change to the material in the purchase order.

Thanks,

Miguel