Skip to Content
0
Jun 10, 2014 at 10:54 AM

Configuration is not updating in sales order using function module SD_SALESDOCUMENT_CREATE

662 Views

Hello Experts,

we are using SD_SALESDOCUMENT_CREATE function module to create sales order.

Sales order is creating successfully but the configuration for the items are not updating.

Could any one help me out on this ....we tried in different ways but couldn't ....

Here is the code....

*---Filling Configuration data
*--- Filling Configuration Reference Item / Instance
w_sales_cfgs_refinst-posex = w_items-itm_number.
w_sales_cfgs_refinst-config_id = '000001'.
w_sales_cfgs_refinst-inst_id = '00000001'.
APPEND w_sales_cfgs_refinst TO t_sales_cfgs_refinst.
CLEAR w_sales_cfgs_refinst.

*---Filling Configuration Reference Data SALES_CFGS_REF Table
w_sales_cfgs_ref-posex = w_items-itm_number.
w_sales_cfgs_ref-config_id = '000001'.
w_sales_cfgs_ref-sce = '1'.
w_sales_cfgs_ref-root_id = '00000001'.
w_sales_cfgs_ref-complete = 'T'.
w_sales_cfgs_ref-consistent = 'T'.
APPEND w_sales_cfgs_ref TO t_sales_cfgs_ref.
CLEAR w_sales_cfgs_ref.

*---Filling Configuration Instances SALES_CFGS_INST Table
w_sales_cfgs_inst-config_id = '000001'.
w_sales_cfgs_inst-inst_id = '00000001'.
w_sales_cfgs_inst-obj_type = 'MARA'.
w_sales_cfgs_inst-class_type = '001'.
w_sales_cfgs_inst-obj_key = w_sales_items_in-material.
w_sales_cfgs_inst-quantity = w_items-target_qty.
w_sales_cfgs_inst-quantity_unit = 'EA'.
w_sales_cfgs_inst-complete = 'T'.
w_sales_cfgs_inst-consistent = 'T'.
w_sales_cfgs_inst-OBJECT_GUID = 'T'.
w_sales_cfgs_inst-PERSIST_ID_TYPE = w_sales_items_in-material.
APPEND w_sales_cfgs_inst TO t_sales_cfgs_inst.
CLEAR w_sales_cfgs_inst.

*---Filling Configuration Characteristic Values SALES_CFGS_VALUE Table
LOOP AT w_items-itm_config INTO wa_itm_config.
w_sales_cfgs_value_in-config_id = '000001'.
w_sales_cfgs_value_in-inst_id = '00000001'.
w_sales_cfgs_value_in-charc = wa_itm_config-charc_name.
w_sales_cfgs_value_in-value = wa_itm_config-charc_value.
APPEND w_sales_cfgs_value_in TO t_sales_cfgs_value.

*---Filling Configuration Variant Condition Key SALES_CFGS_VK
w_sales_cfgs_vk-config_id = '000001'.
w_sales_cfgs_vk-inst_id = '00000001'.
w_sales_cfgs_vk-vkey = wa_itm_config-charc_name.
APPEND w_sales_cfgs_vk TO t_sales_cfgs_vk.
CLEAR : w_sales_cfgs_value_in,w_sales_cfgs_vk.
ENDLOOP.

Regards,

Harsha P