MM Connector Spare Part
-
We need to configure a plant that using MM Connector Spart Part by insert data into two tables mmcsp_tenant & mmcsp_plant. No default data is inserted when service starts up.
INSERT INTO [mmcsp_tenant] ([tenant_id] ,[tenant_name] ,[source_system]) VALUES (<tenant_id, varchar(45),> ,<tenant_name, varchar(100),> ,<source_system, varchar(5),>)INSERT INTO [mmcsp_plant] ([plant_code] ,[tenant_id] ,[plant_name] ,[language]) VALUES (<plant_code, varchar(5),> ,<tenant_id, varchar(45),> ,<plant_name, varchar(100),> ,<language, varchar(10),>)-
tenant_id (mandatory): id of tenant in NIAS, should match with the tenant id inserted into table 'mmc_ProxyTenants' of MM Connector
-
tenant_name (optional): name of tenant
-
source_system (mandatory): source system of spare part in INDIRA (Q87, P87…)
-
plant_code (mandatory): plant code in SAP (0110, 0150 …)
-
plant_name (optional): plant name
-
language (optional): language of plant (EN, DE, FR …), default is EN
-
-
Example
INSERT INTO mmcsp_tenant ([tenant_id] ,[tenant_name] ,[source_system]) VALUES ('ID_OF_A_TENANT', 'NAME_OF_A_TENANT', 'P87')INSERT INTO mmcsp_plant ([plant_code] ,[tenant_id] ,[plant_name] ,[language]) VALUES ('CODE_OF_A_PLANT', 'ID_OF_A_TENANT', 'NAME_OF_A_PLANT','EN') -
To make this MM Connector Spare Part serve another plant, we need to manually add, update data into this 'mmcsp_tenant' & 'mmcsp_plant' tables.
-
To do the spare part reservation in SAP via S4R3 ODATA API, we need to configure data in table 'mmcsp_api_mappings'. This table contains the API endpoint and API key for communication with SAP.
-
Default endpoint is inserted by a liquibase script when the service starts for the first time. However it lacks information about, sap target system, sap api key. We need to manually update data in the table 'mmcsp_api_mappings'.
UPDATE [mmcsp_api_mappings] SET [endpoint_url] = replace(endpoint_url,'[SAP_SYSTEM]','sap_target_system') ,[api_key] = <api_key, varchar(255),>
-
endpoint_url (mandatory): Replace [SAP_SYSTEM] in default data with target SAP system (X87, Q87, P87)
-
api_key (mandatory): api key for communication with SAP
-
-
Example: sap_target_system = 'X87', api_key = 'API_KEY_FOR_SAP_ODATA_API'
UPDATE [mmcsp_api_mappings] SET [endpoint_url] = replace(endpoint_url,'[SAP_SYSTEM]','X87') ,[api_key] = 'API_KEY_FOR_SAP_ODATA_API'
-
Scheduled tasks of spare part sync is configured at table 'mmcsp_scheduled_task'. We can update the cron_expression (follow Java Cron Expression) of the task at the table to change trigger time & frequency. Then restart mm spare part service to activate the change. As the spare part sync job takes several hours to complete synchronization, it’s recommended not to run the spare part sync job several times a day.
-
Default triggers are inserted by liquibase:
-
Spare part sync job: 2:00 of every Saturday at UTC timezone
-
-
If we want to change trigger time of spare part sync job:
UPDATE [mmcsp_scheduled_task] SET [cron_expression] = <cron_expression, varchar(50),> WHERE [task_code] = 0
-
task_code : 0 for spare part sync job.
-