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: 

Updating PO header partner with BAPI_PO_CHANGE

Former Member
0 Kudos

Hi everyone!

I want to update a partner on the PO header. This seems like a rather simple thing to do since there is BAPIs availeble but still I cannot get this to work so I hope that you guys can help me.

What I do is the following:


* Get all partners
  CALL FUNCTION 'BAPI_PO_GETDETAIL1'
    EXPORTING
      purchaseorder = '0060008482'
    IMPORTING
      poheader      = ls_pohead
    TABLES
      return        = lt_return
      popartner     = lt_popart.

* Change the CR partner number from 0000109093 to 91.
  READ TABLE lt_popart WITH KEY partnerdesc = 'CR' ASSIGNING <lw_popart>.
  <lw_popart>-buspartno = '0000109091'.

* Delete all other partners except for the one we want to update
  DELETE lt_popart WHERE partnerdesc <> 'CR'.

* Save changes
  CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
      purchaseorder = '0060008482'
    TABLES
      return        = lt_return
      popartner     = lt_popart.

* Commit
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

When I check lt_return I get a S022 message saying: "No data changed".

I have been trying to mix around with this for several hours now and I am getting very tired of not getting it to work. When I check the BAPI documentation it says that partners are changable. And I can do this change in ME22n.

What am I doing wrong? Any ideas?

Best Regards

Niklas

3 REPLIES 3

0 Kudos

Hi.

Sorry but this is not helpful. I have read the example but it is not handling the partners which is my problem.

Any other ideas?

/Niklas

0 Kudos

anyone?