Skip to Content

BAPI_PO_CHANGE doesn't change MATNR

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.

purchaseorder = gwa_data-ebeln
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.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Dec 12, 2014 at 09:59 AM

    Hi Carles,

    I think you didn't call the Transaction commit work in your code.



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 12, 2014 at 10:03 AM

    Hii Carles,

    Usr commit bapi BAPI_TRANSACTION_COMMIT it will help



    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 12, 2014 at 10:15 AM

    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:

    Maybe you can try this out as well (if applicable for your situation)


    Oooops I see now it has been solved.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.