Skip to Content
avatar image
Former Member

How to change a PO Item using bapi_po_change

HI Abapers,

I encountered some problems: when I use "BAPI_PO_CHANGE" to change the Prod. Storage location in the component of the PO item (CH88 is changed to CH40).

(1) If I pass RSPOS(select from RESB) to ITEM_NO in the POCOMPONENTX,the Prod. Storage location would not change. If I pass POSNR(select from RESB)to ITEM_NOin the POCOMPONENTX,the Prod. Storage location would be changed,but if there is more than one same item number(POSNR),the first line in the component with the same item number will be changed even if its Prod. Storage location is not CH88.

(2)when I run this bapi,even if I only change the

Prod. Storage location ,the BOM item in the component will be change to

0010.0020.0030....

Looking forward for your help.

best Regards!

Ruhua.Chen

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 20 at 07:16 AM

    Picture of the above question:

    Add comment
    10|10000 characters needed characters exceeded

  • May 20 at 08:11 AM

    I can see from the ME22N Component overview that you have no unique value to identify the right component item. Material 5239011.00 is in first and second position and shows the same item number.

    I am without SAP system right now, so I would recommend that you list all those 5 items from table RESB in SE16N to determine in which fields they have different values. This may help to find the missing information to determine the component line.

    If there is really none, then it is likely that you have to transfer all items with the wanted values, SAP deletes then all existing records and uses the new values. I have seen this in other Idocs, e.g. vendor master bank data, and customer master unloading points.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      HI, Thanks very much for your answer.

      After I viewed it in SE16N, the RSPOS can determine the unique value. And I think RSPOS(select from RESB) should be transmitted to the parameter ITEM_NO in the POCOMPONENTX. We can also see through the fourth picture:ITEM_NO's Component Type is defined with reference to RSPOS, but I don't know why I can't update data after transmitting RSPOS, so maybe , is this a bug?

      best Regards!

      Ruhua.Chen