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: 

BAPI_SALESORDER_CHANGE conditions

Former Member
0 Kudos

Hello all,

I use the BAPI "BAPI_SALESORDER_CHANGE" to update conditions. I'm using the following data:

order_header_in-updateflag = 'U'

conditions_in-itm_number = w_konv2-kposn.
conditions_inx-itm_number = k_checked.

conditions_in-cond_st_no = '85'.
conditions_inx-cond_st_no = k_checked.

conditions_in-cond_count = '0'.
conditions_inx-cond_count = k_checked.

conditions_in-cond_type = 'Z999'.
conditions_inx-cond_type = k_checked.

conditions_in-cond_value = w_condition-cond_value / 10.
conditions_inx-cond_value = k_checked.
conditions_inx-updateflag = 'U'.

APPEND conditions_in TO conditions_in.
APPEND conditions_inx TO conditions_inx.

The function returns no error and the BAPI "BAPI_TRANSACTION_COMMIT" is called after processing. Instead of updating the conditions the bapi insert a new item.

Can anyone help me?

Best regards

Petra Rimkus

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Petra,

In fact you need to change also:

> conditions_inx-cond_st_no = k_checked.

> conditions_inx-cond_count = k_checked.

> conditions_inx-cond_type = k_checked.

to

conditions_inx-cond_st_no = '85'.

conditions_inx-cond_count = '0'.

conditions_inx-cond_type = 'Z999'.

Cheers,

Brad

Message was edited by: Brad Williams

3 REPLIES 3

Former Member
0 Kudos

Hi Petra,

Change the following line:

> conditions_inx-itm_number = k_checked.

to

conditions_inx-itm_number = w_konv2-kposn.

If this does not work, you may need to populate ORDER_ITEM_IN and ORDER_ITEM_INX. You should just be able to put the item number in ORDER_ITEM_IN and the item number and the update flag 'U' in ORDER_ITEM_INX.

Hope that helps.

Cheers,

Brad

christian_wohlfahrt
Active Contributor
0 Kudos

Hi Petra!

Have a look at OSS 188972 - this Bapi is not designed to change conditions. But if you don't fill conditions_inx, then you will have a behavior, which can get as near as possible: new conditions and deactivated old conditions.

Regards,

Christian

Former Member
0 Kudos

Hi Petra,

In fact you need to change also:

> conditions_inx-cond_st_no = k_checked.

> conditions_inx-cond_count = k_checked.

> conditions_inx-cond_type = k_checked.

to

conditions_inx-cond_st_no = '85'.

conditions_inx-cond_count = '0'.

conditions_inx-cond_type = 'Z999'.

Cheers,

Brad

Message was edited by: Brad Williams