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 not working

Former Member
0 Likes
1,892

Dear All,

Iam using bapi(BAPI_PO_CHANGE) to update pricing conditions of PO. Sometimes it is working fine but sometimes it is misbehaving and not updating conditions in PO. Iam attaching code for reference please let me know if iam missing something.

 

it_poitem-po_item = it_poud-ebelp.

it_poitem-calctype = 'B'.

APPEND it_poitem.

it_poitemx-po_item = it_poud-ebelp. 

it_poitemx-po_itemx = 'X'.

it_poitemx-calctype = 'X'.

APPEND it_poitemx.

it_cond-itm_number = it_poud-ebelp.

it_cond-change_id = 'U'.

it_cond-cond_updat = 'X'.

APPEND it_cond.

it_condx-itm_number = it_poud-ebelp.

it_condx-itm_numberx = 'X'.

it_condx-change_id = 'X'.

it_condx-cond_updat = 'X'.

APPEND it_condx.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = ebeln

TABLES

return = it_return

poitem = it_poitem

poitemx = it_poitemx

pocond = it_cond

pocondx = it_condx.

COMMIT WORK AND WAIT.

Regards

Yogesh Sharma

1 ACCEPTED SOLUTION
Read only

rajesh_akarte2
Active Participant
0 Likes
1,463

Hi Yogesh,

I had faced a issue while uploading the multiple condition types for a PO.

I had the below observations:

1. While uploading the condition type with currency type ‘INR’ we need to   populate 'POCOND-CHANGE_ID'  field with value  ‘U’ or ‘I’.

When to maintain the fields?

U:When condition type automatically comes in PO and we want to overwrite it.

I:When condition type does not come automatically and we want to insert it.

2.     2. While Uploading condition types with currency in USD or % we need not to maintain the field with ‘U’ or ‘I’.

Hope this will help you.

Regards,

Rajesh Akarte

6 REPLIES 6
Read only

Former Member
0 Likes
1,463

Hi Yogesh,

Why are you not populating the Condition type?

IT_COND-COND_TYPE and IT_CONDX-COND_TYPE .

You can also pass CONDITION_NO, COND_ST_NO and COND_COUNT and check.

These are available in KONV table for EKPO-KNUMV.

Thanks,
Shambu

Read only

0 Likes
1,463

Dear Shambu,

We are updating multiple conditions simultaneously ex. mrp & net price. Net price working fine but sometimes mrp is not updating. We cannnot use IT_COND-COND_TYPE and IT_CONDX-COND_TYPE as we cannot process mrp condition manually in our scenerio.

Regards

Yogesh Sharma

Read only

0 Likes
1,463

MRP? is this Condition value?

Thanks,
Shambu

Read only

0 Likes
1,463

Yes it is condition type zmrp for MRP.

Regards

Yogesh Sharma

Read only

0 Likes
1,463

Hi Yogesh,

If you need to update a particular condition type you need to give the Condition type or the Condition Number.

Here you know that MRP is ZMRP, just give IT_COND-COND_TYPE = 'ZMRP' and set the X in the other structure.

Thanks,

Shambu

Read only

rajesh_akarte2
Active Participant
0 Likes
1,464

Hi Yogesh,

I had faced a issue while uploading the multiple condition types for a PO.

I had the below observations:

1. While uploading the condition type with currency type ‘INR’ we need to   populate 'POCOND-CHANGE_ID'  field with value  ‘U’ or ‘I’.

When to maintain the fields?

U:When condition type automatically comes in PO and we want to overwrite it.

I:When condition type does not come automatically and we want to insert it.

2.     2. While Uploading condition types with currency in USD or % we need not to maintain the field with ‘U’ or ‘I’.

Hope this will help you.

Regards,

Rajesh Akarte