on 04-13-2017 11:28 AM
Hi all,
we are trying to programmatically update prices of item conditions in Sales Order.
what we do manually is:
I checked in scn, but could not help.
is there any way, we can update pricing using pricing type 'G' using Bapi or batch mode.
Madhu_1980
Dear Madhu,
I am not sure what is your business requirements here. But you don't need to write a program and call BAPI to redetermine the prices. Just add a line code in MV45AFZB program as below.
FORM USEREXIT_NEW_PRICING_VBAP CHANGING NEW_PRICING.
new_pricing = 'G'.
ENDFORM.
This will redetermine the price for each item automatically. You can write any conditions or logic in the same for itself.
But if you want to make this happen with BAPI, please follow the below thread.
https://archive.sap.com/discussions/thread/617361
Let me know if you have any questions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks.
>>I am not sure what is your business requirements here.
We want this program to update the pricing of our selected SOs whenever we execute this program, and this need not be called everytime the SO gets saved for all SOs, so we are avoiding the user exit.
The following code worked for us.
PARAMETERS: p_vbeln TYPE vbeln_va OBLIGATORY.
DATA:
lv_salesdocument LIKE bapivbeln-vbeln,
ls_order_header_inx TYPE bapisdh1x,
ls_logic_switch TYPE bapisdls,
ls_return TYPE bapiret2,
ls_order_item_in TYPE bapisditm,
ls_order_item_inx TYPE bapisditmx,
lt_return TYPE TABLE OF bapiret2,
lt_order_item_in TYPE TABLE OF bapisditm,
lt_order_item_inx TYPE TABLE OF bapisditmx.
""""""""""""""""""""""""""""""""""""""""""""""""""""
lv_salesdocument = p_vbeln.
ls_order_header_inx-updateflag = 'U'.
ls_logic_switch-pricing = 'G'.
ls_order_item_in-itm_number = '10'.
ls_order_item_inx-itm_number = '10'.
ls_order_item_inx-updateflag = 'U'.
APPEND ls_order_item_in TO lt_order_item_in.
APPEND ls_order_item_inx TO lt_order_item_inx.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = lv_salesdocument
order_header_inx = ls_order_header_inx
logic_switch = ls_logic_switch
TABLES
return = lt_return
order_item_in = lt_order_item_in
order_item_inx = lt_order_item_inx
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = abap_true
IMPORTING
return = ls_return.
Thanks,
Madhu_1980
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.