Application Development and Automation 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: 
Read only

BAPI_PO_CHANGE - Change Condition Value

Former Member
0 Likes
3,443

Hi,

I want to change the Condition value for a particular Condition type using BAPI_PO_CHANGE.

I am populating values for following

Import parameters

PURCHASEORDER

POHEADER (Fields PO_NUMBER)

POHEADERX (Fields PO_PO_NUMBER = X)

Tables

POITEM (Fields PO_ITEM, PLANT, STGE_LOC

POITEMX (Field PO_ITEM, PO_ITEMX = X, PLANT = X, STGE_LOC= X)

POCOND (Fields COND_TYPE, COND_VALUE, CURRENCY)

POCONDX (Fields COND_TYPE = X, COND_VALUE = X, CURRENCY = X)

But PO condition value is not getting changed...

Regards,

Balaji Viswanath.

Hi,

I want to change the Condition value for a particular Condition type using BAPI_PO_CHANGE.

I am populating values for following

Import parameters

PURCHASEORDER

POHEADER (Fields PO_NUMBER)

POHEADERX (Fields PO_PO_NUMBER = X)

Tables

POITEM (Fields PO_ITEM, PLANT, STGE_LOC

POITEMX (Field PO_ITEM, PO_ITEMX = X, PLANT = X, STGE_LOC= X)

POCOND (Fields COND_TYPE, COND_VALUE, CURRENCY)

POCONDX (Fields COND_TYPE = X, COND_VALUE = X, CURRENCY = X)

But PO condition value is not getting changed...

Regards,

Balaji Viswanath.

2 REPLIES 2
Read only

Former Member
0 Likes
1,679

Hi,

I got the answer from Naren's earlier post... Given the answer below...

Hi,

I believe you can use this BAPI to PO conditions..

Check this code..

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.

DATA: t_cond LIKE bapimepocond OCCURS 0 WITH HEADER LINE.

DATA: t_condx LIKE bapimepocondx 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.

t_cond-itm_number = '00010'.

t_cond-cond_type = 'P000'.

t_cond-cond_value = '17.00'.

t_cond-currency = 'USD'.

t_cond-change_id = 'U'.

APPEND t_cond.

t_condx-itm_number = '00010'.

t_condx-itm_numberx = 'X'.

t_condx-cond_type = 'X'.

t_condx-cond_value = 'X'.

t_condx-currency = 'X'.

t_cond-change_id = 'X'.

APPEND t_condx.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = p_ebeln

TABLES

return = t_return

poitem = t_poitem

poitemx = t_poitemx

pocond = t_cond

pocondx = t_condx.

COMMIT WORK.

The above code works fine for me...

Thanks,

Naren

Read only

0 Likes
1,679

Thank you, very good contribution ....