10-30-2007 2:26 PM
Hi all,
I modified sales order positions using BAPI_SALESORDER_CHANGE, now I need to force re-price type 'C'... I tried adding LOGIC_SWITCH-PRICING = 'C' and LOGIC_SWITCH-COND_HANDL = 'X' but it doesn't work.
I really thank any help.
cya,
dimas.
10-30-2007 3:00 PM
Make sure you pass CONDITIONS_X parameter table filled properly. Then it should be enough to set LOGIC_SWITCH like this:
clear LOGIC_SWITCH.
LOGIC_SWITCH-PRICING = 'C'.
regards
10-30-2007 3:05 PM
10-31-2007 7:39 AM
Here's a sample code that fills 1 row of CONDITIONS and CONDITIONS_X to be passed as params for BAPI_SALESORDER_CHANGE:
clear CONDITIONS.
clear CONDITIONS_X.
*
CONDITIONS_X-UPDATEFLAG = item_cond_operation. " I, U or D
*
CONDITIONS-ITM_NUMBER = QIN_ITEMS-POSNR.
CONDITIONS_X-ITM_NUMBER = CONDITIONS-ITM_NUMBER.
*
CONDITIONS-COND_ST_NO = '010'.
CONDITIONS_X-COND_ST_NO = CONDITIONS-COND_ST_NO.
*
CONDITIONS-COND_COUNT = '05'.
CONDITIONS_X-COND_COUNT = CONDITIONS-COND_COUNT.
*
CONDITIONS-COND_TYPE = 'PR00'.
CONDITIONS_X-COND_TYPE = CONDITIONS-COND_TYPE.
*
if item_cond_operation <> 'D'.
CONDITIONS-COND_VALUE = QIN_ITEMS-CENA_KAT. " new price
CONDITIONS_X-COND_VALUE = 'X'.
endif.
*
CONDITIONS-CURRENCY = CURRENCY.
CONDITIONS_X-CURRENCY = 'X'.
*
append CONDITIONS.
append CONDITIONS_X.
good luck
10-31-2007 1:30 PM
hi,
thanks for your answer but I don't want to make it manually... I want the BAPI to recalculate prices, the same way you do it with VA02...
is there a way to make the BAPI an automatic re-prices????
thanks!!!
dimas
10-31-2007 2:01 PM
You have to decide what kind of recalculating you want to perform. When you press "Update prices" in VA02 you choose one of the pricing types - this is the same what you set in LOGIC_SWITCH-PRICING. If you don't want to have any manual conditions in your order, then just try with LOGIC_SWITCH-PRICING set to 'A' or 'B'.
regards
10-31-2007 2:03 PM
Let me try... but i already did it with C type and checking also cond_handl... and it doesn't work
cya,
dimas
10-31-2007 2:36 PM
11-03-2007 3:30 PM
I'm really surprised that thare's not any ABAPer here who knows how to do that...
11-27-2007 6:01 AM
Hi,
I am facing the same issue you had.
were you able to solve that??.If then Pls let me know.
Regards,
Karuna
09-14-2009 8:35 AM
Hi all,
do anybody knows the answer or how to solve it?
Thanks in advance.
05-19-2010 1:12 PM
If you want to just re-price the order without do any other changes, just fill these structures and call BAPI_SALESORDER_CHANGE fm:
This parameter identify the Sales Order number to be recalculated
salesdocument
Here you will define the re-pricing mode do you want to:
logic_switch-pricing = 'B'.
Tell the BAPI that you will change something on SO
order_header_inx-updateflag = 'U'.
Create one entry in both structures for each item do you want to re-calc
order_item_in-itm_number = item number.
order_item_inx-itm_number = item number.
order_item_inx-updateflag = 'U'.
I hope it helps.
Marcelo Vieira
10-30-2007 7:24 PM
02-09-2011 5:36 PM
Followed Marcelo's instruction.... didn't work initially.
But forgot the basic BAPI rule, need to call 'BAPI_TRANSACTION_COMMIT'
now the repricing is working.
06-23-2011 9:30 AM