Skip to Content
0
Former Member
Oct 31, 2007 at 04:09 AM

Conditions in BAPI sales order change

1530 Views

When I enter a condition in BAPI SAles order change having some existing condition type with different condition value. It goes and appends the condition into the set of condition making two records of same condition type and different value. I would like it to update one record with new value. How should I do it?

This is my code :

if y_wa_konv-kbetr ne y_wa_konv1-kbetr.

move: y_k_x to y_wa_condx-cond_value,

y_k_x to y_wa_condx-cond_type,

y_wa_konv-kschl to y_wa_cond-cond_type,

y_wa_vbap-posnr to y_wa_cond-itm_number.

y_lv_kbetr = ( y_wa_konv-kbetr / 10 ).

move y_lv_kbetr to y_wa_cond-cond_value.

endif.

endif.

move: y_k_u to y_wa_condx-updateflag,

y_wa_vbap-posnr to y_wa_cond-itm_number.

append y_wa_cond to y_i_cond.

append y_wa_condx to y_i_condx.