fbpx

Sales order Creation with Variant Configuration

The creation of sales order with variant configuration characteristics will be a little tricky one.
we have to use the below  Function module(FM) –
For Creation : SD_SALESDOCUMENT_CREATE
For Changes: SD_SALESDOCUMENT_CHANGE
 
one of the advantage of using this FM is that this will support all document types like Sales order, Scheduling agreements, Customer independent Requirements.

In the following section we will see the usage of this FM to create a simple Customer Independent requirement (MD81) with the variant configuration values passed on to the same.The below are the fM structure you need to work with

 

ORDER_HEADER_IN
ORDER_ITEMS_IN
SALES_SCHEDULES_IN
SALES_CFGS_REF
SALES_CFGS_INST
SALES_CFGS_VALUE

ORDER_HEADER_IN:

 

StructureFieldValueLogic
ORDER_HEADER_INREFOBJTYPEBUS2032Fixed
 REFOBJKEYRAMIRO1Fixed
 DOC_TYPE`01Fixed

ORDER_ITEMS_IN

 

StructureFieldValueLogic
ORDER_ITEMS_INITM_NUMBER10Fixed
 HG_LV_ITEM0 
 PO_ITM_NO10Fixed
 MATERIAL Dyanamic
 PLANT Dyanamic
 TARGET_QTY Dyanamic
 REQMTS_TYPKEKFixed
 MATERIAL_LONG Dyanamic

Note: In this structure the “common mistake” most of them do is not filling in the po_itm_no- if this is not filled then the SO will not be created with the characteristics values

SALES_SCHEDULES_IN

Structure Field Value Logic
SALES_SCHEDULES_IN ITM_NUMBER 10 Fixed
  SCHED_LINE 1 c
  REQ_DATE   Dynamic
  REFOBJKEY RAMIRO1 Fixed

SALES_CFGS_REF

Structure Field Value Logic
SALES_CFGS_REF POSEX 10 Fixed
  CONFIG_ID `000001 Fixed
  ROOT_ID `00000001 Fixed
  COMPLETE T Fixed
  CONSISTENT T Fixed
  CBASE_ID_TYPE G Fixed

SALES_CFGS_INST

Structure Field Value Logic
SALES_CFGS_INST CONFIG_ID `000001 Fixed
  INST_ID `00000001 Fixed
  OBJ_TYPE MARA Fixed
  CLASS_TYPE 300 Fixed
  OBJ_KEY   Dynamic-This will be Material Number
  OBJ_TXT    
  QUANTITY 10 Dynamic
  QUANTITY_UNIT TO Fixed
  COMPLETE T Fixed
  CONSISTENT T Fixed
  OBJECT_GUID   Dynamic-This will be Material Number
  PERSIST_ID_TYPE G Fixed

SALES_CFGS_VALUE

Structure Field Value Value Value
SALES_CFGS_VALUE CONFIG INST_ID CHARC VALUE
  `000001 `00000001 Charcteritics 1 Value 1
  `000001 `00000001 Charcteritics 2 Value 2
  `000001 `00000001 Charcteritics 3 Value 3