Hi Gurus,
I am using standard Function module : BAPI_SALESORDER_SIMULATE to simulate pricing conditions.
I am trying to figure out the reason for the function module: BAPI_SALESORDER_SIMULATE not giving values in CONDITIONS EX when I use it to <b>simulate free goods</b> .
It is only not giving ORDER_CONDITION_EX for <b>free goods</b> materials.
BAPI simulates Bill of material, regular orders properly.
Example : one material has on free good .
Should give output in ORDER_CONDITION_EX
It is giving an output in ORDER_ITEMS_OUT - two materials line item 10 , 15 .
However in ORDER_CONDITION_EX it does not return anything , number of entries is zero .
What could be the reason. What is the correct input for the BAPI for it to give conditions in ORDER_CONDITION_EX for free goods.
I know my data for input are correct as I can make a sale order with the same data.
Please help me at the earliest to solve this problem.
<u>BAPIs reference : standard BAPI_SALESORDER_SIMULATE'</u>
CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'
EXPORTING
ORDER_HEADER_IN = order_header_in
CONVERT_PARVW_AUART = ' '
DELAY = 0
IMPORTING
SALESDOCUMENT =
ORDER_HEADER_EX =
SOLD_TO_PARTY =
SHIP_TO_PARTY =
BILLING_PARTY =
RETURN =
ORDER_HEADER =
TABLES
ORDER_ITEMS_IN = order_items_in
ORDER_PARTNERS = order_partners
ORDER_SCHEDULE_IN = order_schedule_in
ORDER_CONDITIONS_IN =
ORDER_ITEMS_OUT =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CCARD =
ORDER_CCARD_EX =
ORDER_SCHEDULE_EX =
ORDER_CONDITION_EX = order_condition_ex
ORDER_INCOMPLETE =
MESSAGETABLE = messagetable
EXTENSIONIN =
PARTNERADDRESSES =
WMDVSX =
WMDVEX =
AVAIL_OUT =
ORDER_SCHEDULE_IN2 =
ORDER_SCHEDULE_EX2 =
ORDER_ITEMS_IN2 =
ORDER_PARTNERS2
<u>Program being developed based on this BAPI</u>
selection-screen begin of block b1 with frame title text-001.
parameters : p_kunnr like kna1-kunnr,
p_matnr like vbap-matnr,
p_vkorg like vbak-vkorg,
p_vtweg like vbak-vtweg,
p_spart like vbak-spart.
selection-screen end of block b1.
data: doctype like bapisdhead-doc_type value 'OR',
itemno like bapiitemin-itm_number value '000010',
quantity(13) type N value '0000000000001',
partnertype like knvp-parvw value 'AG'.
data :count type i.
data : begin of order_condition_ex occurs 0.
include structure bapicond.
data: end of order_condition_ex.
data: begin of order_header_in.
include structure bapisdhead.
data: end of order_header_in.
data: begin of order_items_in occurs 1.
include structure bapiitemin.
data: end of order_items_in.
data: begin of order_partners occurs 1.
include structure bapipartnr.
data:end of order_partners.
data: begin of order_schedule_in occurs 1.
include structure bapischdl.
data:end of order_schedule_in.
data: begin of messagetable occurs 0 .
Include structure bapiret2.
data: end of messagetable.
order_header_in-doc_type = doctype.
order_header_in-sales_org = p_vkorg.
order_header_in-distr_chan = p_vtweg.
order_header_in-division = p_spart.
order_header_in-purch_date = sy-datum .
order_header_in-req_date_h = sy-datum.
order_items_in-itm_number = itemno.
order_items_in-material = p_matnr.
order_items_in-req_qty = quantity.
append order_items_in.
order_schedule_in-itm_number = itemno.
order_schedule_in-req_qty = quantity.
append order_schedule_in.
order_schedule_in-req_date = sy-datum.
order_partners-partn_role = partnertype.
order_partners-partn_numb = p_kunnr.
append order_partners.
order_partners-itm_number = itemno.
CALL FUNCTION 'Z_BAPI_SALESORDER_SIMULATE'
EXPORTING
ORDER_HEADER_IN = order_header_in
CONVERT_PARVW_AUART = ' '
DELAY = 0
IMPORTING
SALESDOCUMENT =
ORDER_HEADER_EX =
SOLD_TO_PARTY =
SHIP_TO_PARTY =
BILLING_PARTY =
RETURN =
ORDER_HEADER =
TABLES
ORDER_ITEMS_IN = order_items_in
ORDER_PARTNERS = order_partners
ORDER_SCHEDULE_IN = order_schedule_in
ORDER_CONDITIONS_IN =
ORDER_ITEMS_OUT =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CCARD =
ORDER_CCARD_EX =
ORDER_SCHEDULE_EX =
ORDER_CONDITION_EX = order_condition_ex
ORDER_INCOMPLETE =
MESSAGETABLE = messagetable
EXTENSIONIN =
PARTNERADDRESSES =
WMDVSX =
WMDVEX =
Z_AVAIL_OUT =
ORDER_SCHEDULE_IN2 =
ORDER_SCHEDULE_EX2 =
ORDER_ITEMS_IN2 =
ORDER_PARTNERS2