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: 

Problem in update PO's partner function using BAPI_PO_CHANGE

Former Member
0 Kudos

Hi All,

I have some problem when i try to update PO partner function using BAPI_PO_CHANGE.

If i update partner function where business partner number is vendor (eg. GS) , it run successfully. But when I try to update partner function where business partner number is personnel number (eg. CS, VW, etc) , it was failed. And BAPI return message is "Please enter a partner role".

Please advice.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

are you executing BAPI_TRANSACTION_COMMIT after BAPI_PO_CHANGE?

Check this code for PO update..

PARAMETERS: p_ebeln LIKE ekko-ebeln.

DATA: t_poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE.

DATA: t_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.

DATA: t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

t_poitem-po_item = '00010'.

t_poitem-net_price = '17.00'.

APPEND t_poitem.

t_poitemx-po_item = '00010'.

t_poitemx-net_price = 'X'.

t_poitemx-po_itemx = 'X'.

APPEND t_poitemx.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = p_ebeln

TABLES

return = t_return

poitem = t_poitem

poitemx = t_poitemx.

COMMIT WORK.

<b>Reward points</b>

Regards

2 REPLIES 2

Former Member
0 Kudos

Hi,

are you executing BAPI_TRANSACTION_COMMIT after BAPI_PO_CHANGE?

Check this code for PO update..

PARAMETERS: p_ebeln LIKE ekko-ebeln.

DATA: t_poitem LIKE bapimepoitem OCCURS 0 WITH HEADER LINE.

DATA: t_poitemx LIKE bapimepoitemx OCCURS 0 WITH HEADER LINE.

DATA: t_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

t_poitem-po_item = '00010'.

t_poitem-net_price = '17.00'.

APPEND t_poitem.

t_poitemx-po_item = '00010'.

t_poitemx-net_price = 'X'.

t_poitemx-po_itemx = 'X'.

APPEND t_poitemx.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = p_ebeln

TABLES

return = t_return

poitem = t_poitem

poitemx = t_poitemx.

COMMIT WORK.

<b>Reward points</b>

Regards

0 Kudos

I was execute BAPI_TRANSACTION_COMMIT, but it still fail to update partner function.

Thanks