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: 

How to insert new service condition in PO using BAPI_PO_CHANGE?

Former Member
0 Kudos

Hi all,

I'm trying to insert a new condition under a service line in a PO. This can be seen in ME23N under the services tab of the PO item. Then click on conditions (the button with the dollar and yen symbol).

I tried using the internal table POCOND and POCONDX. But these tables update the conditions of the PO item itself and not the service conditions. In ME23N this is the conditions tab of the PO item.

    • build condition item table

wa_conditem-change_id = 'I'.

wa_conditem-itm_number = wa_items-po_item.

wa_conditem-cond_type = c_condtypz.

wa_conditem-cond_value = l_plndisamt.

wa_conditem-currency = l_poheader-currency.

APPEND wa_conditem TO it_conditem.

CLEAR wa_conditem.

    • build condition item change parameter table.

wa_conditemx-itm_number = wa_items-po_item.

wa_conditemx-itm_numberx = 'X'.

wa_conditemx-cond_type = 'X'.

wa_conditemx-cond_value = 'X'.

wa_conditemx-currency = 'X'.

wa_conditemx-change_id = 'X'.

APPEND wa_conditemx TO it_conditemx.

CLEAR wa_conditemx.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = wa_ekpo_u-ebeln

TABLES

return = it_return

poitem = it_poitem

poitemx = it_poitemx

pocond = it_conditem

pocondx = it_conditemx

EXCEPTIONS

OTHERS = 1.

I tried using the internal tables POCONDHEADER and POCONDHEADERX but this doesn't seem to insert anything.

Can anyone guide me how to insert a new service condition?

thanks,

Shafiq

3 REPLIES 3

Former Member
0 Kudos

Maybe there is another BAPI to do this?

0 Kudos

Found a SAP note 499626 quoted below. So it seems that it's not possible to use BAPI_PO_CHANGE.

"Can I create or change conditions on the service level with BAPI_PO_CREATE1 or BAPI_PO_CHANGE?

Answer:

Such a function is currently not available."

Anybody know any FM to do this?

Edited by: shafiq shamsuddin on Mar 16, 2011 4:38 AM

0 Kudos

Hello Shafiq,

Were you able to resolve this issue?

Thanks,