Process:- we create service order in CRM and add all spare parts required for our service as line items in service order. Once the service order is saved, based on theitem category of the line item it will create material reservation or Sales order in ECC system. In this document I will take an example of the scenario to create material reservation from the service order entered in the CRM.
Problem:- Once the material reservation is created user cannot determine against which service order this material reservation is created.
Solution:- We can add additional fields in RKPF table. And then map these field from the service order once its saved in CRM . We will use 2 BADIs here one in CRM and one in ECC.
In this example we will pass 2 fields From service order to the material reservation in ECC
1. Service order number (ZSERVICEORDER).
2. Priority of the service order (ZPRIORITY).
CRM Enhancement
Implement BADI CRM_LOG_EXT_MAP_BADI
Method CRM_SRV_LOG_MAPPING
CT_BAPI_EXT is the changing parameter for BAPI extensions
DATA: lt_bapi_ext TYPE bapiparex.
lt_bapi_ext-structure = ‘PRIORITY’.
* Read the priority of order in variable lv_priority
lt_bapi_ext-valuepart1 = lv_priority.
Append lt_bapi_ext to ct_bapi_ext.
ERP Enhancement
1. Enhance the table RKPF with additional fields in our case its service order number and priority
2. Implement BADI: CRM_SRV_MAP_RS_BADI
a. Method:- MAP_RESERVATION
FIELD-SYMBOLS <fs_bapiparex> TYPE bapiparex.
Ct_header-zserviceorder = is_header-process_id
Lop AT it_bapi_ext ASSIGNING <fs_bapiparex>.
if <fs_bapiparex>-structure = ‘PRIORITY’
ct_header-zpriority = <fs_bapiparex>-valuepart1
Endloop.