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: 

TO change the condition type po based on po number and Item

Former Member
0 Kudos
157

Hi Experts,

I have to change the condition type of the purchase order based on the purchase order item number

For example If any purchase order Item with the condition type 'ZARO' , I need to change this one

to 'ZAOO'.

Please suggest me is there any fM available to change this.

Thnx,

sam.

1 ACCEPTED SOLUTION

former_member156446
Active Contributor
0 Kudos
69

try using : BAPI_PO_CHANGE

4 REPLIES 4

Former Member
0 Kudos
69

Hi Sam,

I think u can simply code it like...

suppose u have 3variables for purchase order, item no and condition type.

v_purch_order,

v_item_no,

v_condition_type

then u can write if statement and in that change the value of condition type.

if v_purch_order = '123' AND

v_item_no = '100' AND

v_condition_type = 'ZARO'.

v_condition_type = 'ZAOO'.

endif.

this will change ur condition type to ZAOO, if it is ZARO and based on the PO number and item..

further u can use the changed condition type in ur code.

Hope this helps u...all the best

Regards,

Radhika

former_member156446
Active Contributor
0 Kudos
70

try using : BAPI_PO_CHANGE

Former Member
0 Kudos
69

Hi Sam,

I have used the BAPI_PO_CHANGE to change the Gross Price in a PO, same BAPI you can use to change the condition type in a PO. write the logic for when to call this BAPI , as in your case If any purchase order Item with the condition type 'ZARO' , change this oneto 'ZAOO'.

Condition type are stored in KONV table (KONV-KSCHL). Compare the ekko-KNUMV with konv-knumv for your set of POs and pick corresponding Line items for all the POs, check the condition type for those line items, change the condition type and pass this information to the BAPI. BAPI will update the condition type in PO and will update the field KSCHL in KONV table.

Remember if you will execute the BAPI in SE37 , it wont commit any changes, because we cannot directly change the PO through executing BAPI (go through documentation of BAPI, you will find an OSS note on this). But by calling this BAPI in your Report , u can commit the changes in database tables.

Regards

Vinod Varyani

0 Kudos
69

Dear Vinod,

You were saying like , if i were to execute the BAPI in SE37, it won't reflect in DB.

But it is sure to simulate the changes in POCOND (tables parameter in BAPI_PO_CHANGE) in SE37.right?

if i am correct, can you kindly tell me the parameters i should pass to change the gross price value.

My requirement is to change the Gross price and to calculate subsequent condition type values based on changed value.

i.e i have to recalculate the condition values based on changed Gross price just as it would work in ME22n.

Thanks and Regards,

Sandeep Sivan

Edited by: sandeep sivan on Apr 9, 2010 10:17 AM

Edited by: sandeep sivan on Apr 9, 2010 10:23 AM