I have a requirement to create and pass back values to two pricing conditions (ZFST and ZFCT) to header level sales orders. I tried using BAPI_SALESORDER_CHANGE but it only creates duplicates of one of the conditions. It does not create both. *Note that these pricing conditions do not exist or have been created at time of sales order creation.
Example below, code creates condition ZFCT and adds the value which works, but instead of creating the other condition I get a duplicate.
Code below. Everything is hardcoded since I am trying to play around with different options but I can't figure it out. I call the BAPI_SALESORDER_CHANGE twice (one for each condition). I don't seem to get errors in the RETURN table but for some reason only one condition gets created while the second does not. Any ideas?
DATA: ls_order_header_inx TYPE bapisdh1x, ls_logic_switch TYPE bapisdls, lt_conditions_in TYPE STANDARD TABLE OF bapicond, ls_conditions_in TYPE bapicond, lt_conditions_inx TYPE STANDARD TABLE OF bapicondx, ls_conditions_inx TYPE bapicondx, lt_return TYPE STANDARD TABLE OF bapiret2, ls_return_commit TYPE bapiret2.
ls_logic_switch-pricing = 'C'. (Tried changing this to "B" and "C" but nothing works) ls_order_header_inx-updateflag = 'U'.