cancel
Showing results for 
Search instead for 
Did you mean: 

Configuration is not updating in sales order using function module SD_SALESDOCUMENT_CREATE

former_member393841
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member393841
Participant
0 Kudos

Hello All,

My issue is Resolved...

Cheers,

Harsha

Lakshmipathi
Active Contributor
0 Kudos

Harsha Vardhan

My issue is Resolved

This is not going to help anybody who face similar issue.  Please develop the habit of updating the forum once you resolved your issue.

G. Lakshmipathi

former_member393841
Participant
0 Kudos

Hello All,

Actually there was a bug in my code to update configuration for an item in sales order

Below is my Updated Code with that i can updated configuration successfully....

*---Filling Configuration data
*---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      = '300'.
     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     = w_sales_items_in-material.
     w_sales_cfgs_inst-persist_id_type = 'G'.
     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.
     CLEAR : w_sales_items_in,wa_mara,w_items,w_sales_schedules_in,
             w_items-itm_number.
   ENDLOOP.



Cheers,

Harsha