Connect Solutions - REST API for SAP Solution Manager
REST API Configuration (REST API for Solution Manager)
Using the transaction /GAL/SM_REST_CONFIG, the following settings can be made in the REST API:
General REST API configuration
In the general REST API configuration, values can be assigned to predefined keys. The following keys are currently available.
Key | Data type | Description |
---|---|---|
APPROVE_STATUS | Character, length 5. | Approved user status for the approval of a change request, e.g. E0004. The value is only required if an approval is to be executed automatically via the API. |
REJECT_STATUS | Character, length 5. | Rejected user status for the approval of a change request, e.g. E003. The value is only required if an approval is to be executed automatically via the API. |
RFC_AWAIT_APPROVAL_STATUS | Character, length 5. | Status of a change request waiting for approval, e.g. E0012 (Either the associated user or system status can be specified). The value is only required if an approval is to be executed automatically via the API. |
REST_ACTIVE | Single-character indicator, "X"=True, ""=False | This key can be used in BAdI implementations to disable the implementation via customizing. |
IS_EXT_ID_RE_ASSIGNABLE | Single-character indicator, "X"=True, ""=False | Flag indicating whether an existing External ID may be changed if a new External ID is to be set via the REST API. |
LONGTEXT_WO_BOL | Single-character indicator, "X"=True, ""=False | Indicator whether text objects should always be read via function modules and not via the Business Objects Interface. |
DISPLAY_IMPORT_STATUS | Single-character indicator, "X"=True, ""=False | Indicator whether the import status for transport requests should be read in the REST API. |
Assignment of External IDs
In this view you can define per transaction type or for a transaction type pattern in which way external IDs for ChaRM objects should be stored. In addition, a checkbox can be used to define whether multiple external IDs can be assigned to a ChaRM object.
If you define multiple rules, for example, a rule for the specific business transaction type ZMMJ and a generic rule Z*, a search for a specific assignment is performed first, and if no specific assignment is found, a search for a generic assignment is performed.
The following scenarios are provided for storage for External IDs:
External IDs are stored in a custom field
External IDs are stored in a standard field
External IDs are stored in the "/GAL/SM_CHARM_EX" table of the addon (default)
The first two options are only available if the assignment of an External ID and a ChaRM object is one-to-one.
Storage of External IDs in a custom field
To store external IDs in a custom field, the option "Is custom field" must be checked in the maintenance view and the technical name of the custom field must be entered in the "Existing field name" field. You can view the technical names of custom fields using the CRMD_CUSTOMER_H table.
Storage of external IDs in standard fields
The definition for standard fields is a bit more complicated and is only possible if the field in the GenIL Model Browser is directly related (1:1) to the access object "BTAdminH". You can see if the requirement is met in transaction GENIL_MODEL_BROWSER.
To activate the storage in a standard field, the option "Is existing field" must be marked. In addition, the technical field name must be entered in the "Existing field name" field, the name of the relationship to the access object "BTAdminH" must be entered in the "Relationship name" field, and the technical name of the associated physical table must be entered in the "Table name" field. The "Object type" field must also be filled with the object type of the object to which the standard field belongs. A list of allowed object types can be found in the table CRMC_OBJECTS.
Example: You want to store a unique External ID in the standard field PO_NUMBER_SOLD. Using transaction GENIL_MODEL_BROWSER you can find out that the name of the relationship is BTHeaderSalesSet. From table CRMC_OBJECTS you deduce that the object type of the object "SALES" is assigned the value "11" and the table name is generally composed of CRMD_<OBJECT_NAME>, where <OBJECT_NAME> corresponds to the name of the object from CRMC_OBJECTS. In this example, the table name is therefore CRMD_SALES.
The header data of a CRM object (table CRMD_ORDERADM_H) is linked to the subobjects via the table CRMD_LINK. The column GUID_HI corresponds to the GUID from table CRMD_ORDERADM_H and GUID_SET corresponds to the GUID from the table, which is derived from the object type OBJTYPE_SET via table CRMC_OBJECTS.
Webhook definitions
The following three maintenance views are available in transaction /GAL/SM_REST_CONFIG for defining a webhook:
Webhook definition for the maintenance of the endpoint and general settings of the webhook.
Webhook filter to define specific filter criteria for different webhooks
Webhook authentication, if the endpoint of a webhook requires authentication
General webhook definition
The following settings are available under the general webhook settings.
Setting name | Description |
---|---|
Webhook name | Freely definable name for the webhook |
URI | The URL of the webhook endpoint. Endpoints in Conigma Connect correspond to the following pattern: Release 2021: http(s)://<domain>:<connect_port>/repositories/<repository_name>/connections/<connect_name>/events/<event_name> Release 2022: http(s)://<domain>:<connect_port>/connections/<connect_name>/events/<event_name> |
Description | A short description for the webhook |
Process type filter | The technical name of the transaction type for which the webhook should be triggered. Multiple transaction types can be separated with a semicolon (in characters ";"). |
Ext. ID may be empty | Checkbox whether the webhook can be triggered for ChaRM objects where the External ID does not contain a value. |
On create | Checkbox whether the webhook should be triggered when a new ChaRM object is created. |
On update | Checkbox whether the webhook should be triggered when an existing ChaRM object is updated. |
Is enabled | Checkbox whether the webhook is active. |
Webhook filter criteria definition
In the Webhook filter criteria maintenance view, you can either define a pattern for External IDs or filter on specific values in the addon table "/GAL/SM_CHARM_EX".
Two fields are available in the maintenance view for defining a pattern for External IDs:
Ext. ID filter: pattern for external IDs where the asterisk character (in character "*") is used as wildcard
Ext. ID filter option: selection of an operator to be used for comparing an External ID with the filter. The selection is made using a list of values that supports the following options: <, <=, =, >=, >, Contains pattern, Does not contain pattern.
Filtering on External ID can be useful if the External ID contains a constant value that delimits an organizational unit, a project, or something similar. For example, Jira task IDs contain a prefix that corresponds to the associated Jira project.
The table "/GAL/SM_CHARM_EX" contains 8 columns (CUSTOM_FIELD1 - CUSTOM_FIELD8) where customer specific content for a ChaRM object can be stored. In case ChaRM objects can be linked with external objects from different source systems, an abbreviation of the source system can be stored in one of the available columns, e.g. SNOW, ADO or JIRA. In the filter criteria, it can then be defined that a webhook is only triggered if the ChaRM object is assigned to a specific abbreviation, e.g. SNOW.
The following fields are available in the maintenance view for defining a customer-specific filter:
Custom Filter ID: selection of the customer specific fields from table "/GAL/SM_CHARM_EX" in which the filter value is stored.
Custom Filter value: The customer's own filter value.
Custom Filter option: selection of an operator to be used for the comparison of the filter value.
Definition of a webhook authentication
If an endpoint expects authentication, either a user name and password for basic authentication or a client certificate created in advance via transaction STRUST can be selected in the maintenance view for webhook authentication.
Default text objects for a transaction type
In this view, a text ID can be selected per transaction type that contains the long text or description of a ChaRM object. If a mapping is available, the longtext property can be used in the REST API to simply read or write the description. Otherwise, the description would have to be read or written using a text array containing the text ID and text.
An example of using the "longtext" property can be found at the following link.
Tables allowed for the REST API
Via the REST API it is possible to read SAP tables. This means that the contents of customer-specific SAP tables can be used in Conigma Connect, e.g. to transform source data. For example, if the assignment of ServiceNow configuration items to ChaRM configuration items is to be maintained in SAP, the name of the table has to be entered in this maintenance view to allow the REST API to access this table. Currently it is only possible to read table contents but not to write them.