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

Function Modules In PP

 The below will be the list of Function modules which will be useful !! I will keep this list added !!

1. VC_I_GET_CONFIGURATION
   * This will help you to get the configuration parameters of the configurable material

2. CO_BT_GET_ALL_VORNR_IN_ORDER
  * This will Help you to get the Operation details in the Production order.

3. MD_STOCK_REQUIREMENTS_LIST_API
   * This will help you to get the MRP Stock requirement list.
   * Most of the details that are seen in the MD05/07 Can be extracted from thism

4. BAPI_CLASS_GET_CHARACTERISTICS
   * In case if you need to get the characteristics and the values for the Class ( Like 300 /023) etc, then you can use this FM
   * You need to give the Class and the class type
   * It will give you the output  with characteristics with / without values.

5. BAPI_PRODORD_GET_LIST
* You can get the list of the Production orders.

6.CS_BOM_EXPL_MAT_V2
* This will help you to get the list of Materials in a BOM

7. Planned Independent Requirement:(Create,change,Display) 
The below 3 FM will help you in the PIR Create, Change and Display.
BAPI_REQUIREMENTS_GETDETAIL
BAPI_REQUIREMENTS_CHANGE
BAPI_REQUIREMENTS_CREATE

8.CO_61_CHECK_ORD_TO_SDOC
* This will help to get the planned order @ sales order leve.

9.CUCB_GET_CONFIGURATION
 * Get the configuration.

10.BAPI_PRODORD_GET_DETAIL
* Get the Operation in the Productoin order.
11. Copy the variants fro a program
RS_COPY_SELECTION_SETS

Other Which will be helpful
1. BKK_GET_NEXT_WORKDAY – Get Next workday

2. BKK_ADD_WORKINGDAY – Add working days