Connect Solutions - REST API for SAP Solution Manager
Migration of existing relationships (REST API for SAP Solution Manager)
Table for storing relationships with external entities
To store relationships of a ChaRM object with an external entity, the /GAL/SM_CHARM_EX table is used.
The columns of the table have the following meaning:
REF_GUID: Global unique ID of a CRM object with which a relationship is to be entered. This GUID references entries from the header table CRMD_ORDERADM_H.
EXTERNAL_ID: Unique ID of the external entity, e.g. the system ID from ServiceNow or the key from Jira.
CUSTOM_FIELD1 - CUSTOM_FIELD8: Fields for storing additional information required as part of the integration.
A standard scenario for using the custom fields is to store an identifier from which source or integration the relationship was created. For example, one can store SERVICE_NOW_CTASK, JIRA_STORY, or ADO_TASK values in CUSTOM_FIELD1 to represent with which external entity a relationship exists.
This information can be used as a filter criterion in webhook definitions to use different webhook URLs for different sources.
Migration of existing relationships
Entries in the /GAL/SM_CHARM_EX table are created automatically when ChaRM objects are created via the REST API. In the event that existing relationships are to be migrated, e.g. as part of an implementation project, an upload program with transaction code /GAL/SM_CHARM_EXTIDS can be used.
The selection screen contains the following program options:
File name: Name and path of the upload file with F4 value help.
Separator: Separator for field values. The default value is a semicolon ";".
With header: Indicator whether the upload file contains a header line.
A text file is expected for the upload file. The content of this text file must look like the following for files without headers. The file contains several lines, where exactly 3 values are expected per line, separated with the separator from the selection screen. The first value must be the GUID or the object ID of the ChaRM object, the second value the External ID and the third value a character from the set ["I", "M", "D"] for the database operation. “I” stands for Insert, “M” for Modify and “D” for Delete.
For files with header line the following must apply. The first line contains the technical column names of the /GAL/SM_CHARM_EX table that are to be filled via the file, whereby their order is irrelevant. At least the column names REF_GUID, EXTERRNAL_ID and OPERATION (for the database operation) must be specified. Allowed values for OPERATION are “I”, “M” and “D”, see previous chapter. The custom fields with column names CUSTOM_FIELD1 - CUSTOM_FIELD8 are optional.
After the program execution a log is output with error messages and information about the number of inserted, changed or deleted entries. The /GAL/SM_CHARM_EX table is not changed if at least one error occurs during program execution.
Initial synchronization
To synchronize values from Solution Manager with migrated external entities for the first time, transaction /GAL/SM_CHARM_WHKM can be used to execute webhooks for multiple ChaRM objects. It is useful to run the program in the background if a large number of objects are to be synchronized at once.
The following options are available in the selection screen:
Object ID: Selection option for ChaRM object IDs.
Request Delay in seconds: Delay between individual webhook calls in seconds.
Do not use BO layer: Indicator whether the ChaRM object should not be read via the BO layer, but via normal function modules.