CX Works

CX Works brings the most relevant leading practices to you.
It is a single portal of curated, field-tested and SAP-verified expertise for SAP Customer Experience solutions

Build an Email Alert Notification for Import Monitor with SAP Integration Suite

15 min read

How to build your Email Alert Notification for Import Monitor Errors with SAP Integration Suite

One of the most important aspects of a successful digital marketing strategy is the quality of data. In SAP Marketing Cloud, data is crucial to getting a 360-degree view of the customers besides to having a well-designed procedure to import data into the system. 

How do you identify specific dataload application issues, such as exceptions raised from data mappings or missing configuration steps and react on time? Why not implement an alert mechanism to send notifications in a variety of channels and priorities depending on conditions you define.

With an alert mechanism, you could relieve system administrators from actively watching your systems so that they can improve efficiency and productivity. To make this feasible, the system must be able to grab your attention when necessary. In this article, you will learn how to build an e-mail alert notification for import data errors from SAP Marketing Cloud via the Cloud Integration capability within SAP Integration Suite. 

Table of Contents


The goal of the alerts is to reliably notify operators and system administrators when import data fails. The main purpose is the system to inform you of errors during message processing. 

In this use case, we will build a Cloud Integration iFlow to call a standard SAP Marketing Cloud application programming interface (APIs). The cloud Integration capability in SAP Integration Suite will query for failed import data messages into SAP Marketing Cloud, then map the results in an Email to send to the business system administrator as a notification alert via Mail Adapter feature.

The following prerequisites have to be met in order to implement this alert notification:

  • Ensure your SAP Marketing Cloud API is published. We will follow the Monitoring API standard integration process documented here.
  • Ensure your Cloud Integration is ready. Please follow the guide here.
  • You need an Email Provider - confirm if your email receiver host (SMTP or External Email Provider) is able to receive notifications.

Please note, on the cloud Integration capability in SAP Integration Suite:

  • there are no additional licenses needed for the scenario described in this article (sending emails to an external Email Provider when using mail adapters) since you have cloud integration capability in SAP Integration Suite subscription available running under the bandwidth agreement.
  • We recommend processing messages that do not exceed 40MB payload + Attachments of 100MB size to avoid memory bottlenecks.

Data Import Monitoring

As a system administrator you are interested to monitor the dataload into the system. SAP Marketing Cloud provides a set of functionalities to the users to monitor import messages and keep track of their status. 

Data Load Monitor app

The Data Load Monitor app enables system administrators to optimize the data imports monitoring by:

  • View import messages across the landscape and decide what action to take.
  • Correct errors in SAP Marketing Cloud or in the source systems in a timely fashion and restart imports.
  • Analyze imports and messages by multiple dimensions, and quickly resolve issues.
  • Identify system issues that may have been previously hidden.
  • View various status messages such as success messages, errors, and warnings to identify issues with data mapping or system configuration.

The following video provides an overview of how the app works:

Import Monitor app

SAP Marketing Cloud provides tools for business administrators to monitor the data import from different data sources into SAP Marketing Cloud via File Upload or OData Services.

By the Import Monitor app (image below), SAP Marketing Cloud generates a list of notifications with the related status that denotes the progress of a data import. Find more information in Import Monitor documentation.

Import Monitor app

The imported data is stored in an "inbound queue", the staging area, and then further processed by SAP Marketing Cloud. In this area, system validations are performed. If errors occur during the data import, you can find the error message via Import Notification details. 

As an example, you can handle import notifications that are caused by the importation of Business Partners or Business Documents from SAP CRM or SAP Sales/Service Cloud.

Import Monitor Notifications

Currently, Custom Business Objects (CBOs) are not supported in Import Monitor app.

Monitoring API

In addition, SAP Marketing Cloud provides the API API_MKT_IMPORT_MONITORING to Get Import Monitor notifications messages. This API service can be used by all API services whose data imports are processed via the staging area.

Find more about this API service in our SAP Help documentation.

Name of the Service



The following business catalog is required: SAP_CEC_BC_MKT_API_IC2_PC

Communication Scenario IDs





These are just some of the communication scenarios that implement this service. There may be others.
API Business Hub Details

This is a read-only service,  you can only perform GET operations with it. In our use case we are going to query all the messages with Failed status based on a Timestamp/Date using this API service.

Example: Query maximum 100 notifications with STATUS = 2 ( "Failed" ) and creation date time greater than 2019 November, 8th.

GET https://<Server>:<Port>/sap/opu/odata/sap/API_MKT_IMPORT_MONITORING_SRV/ImportHeaders?$expand=HeaderToMessage&$filter=Status eq '2'  and CreationUTCDateTime ge 20191108000000&$top=100

The "$expand = HeaderToMessage" was used to return in the same API call the Import Notification Header + Import Notification Messages.

API Response
<feed xmlns="" xmlns:m="" xmlns:d="" xml:base="https://Server:Port/sap/opu/odata/sap/API_MKT_IMPORT_MONITORING_SRV/">
    <title type="text">ImportHeaders</title>
    <link href="ImportHeaders" rel="self" title="ImportHeaders"/>    
        <title type="text">ImportHeaders(guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')</title>
        <category term="API_MKT_IMPORT_MONITORING_SRV.ImportHeader" scheme=""/>
        <link href="ImportHeaders(guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')" rel="self" title="ImportHeader"/>
        <link href="ImportHeaders(guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')/HeaderToMessage" rel="" type="application/atom+xml;type=feed" title="HeaderToMessage">
                <feed xmlns="" xmlns:m="" xmlns:d="" xml:base="https://Server:Port/sap/opu/odata/sap/API_MKT_IMPORT_MONITORING_SRV/">
                    <title type="text">ImportAggregatedMessages</title>
                    <link href="ImportHeaders(guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')/HeaderToMessage" rel="self" title="ImportAggregatedMessages"/>
                        <title type="text">ImportAggregatedMessages(ImportAggregatedMessageUUID=guid'02000a1b-a98f-1eda-81ac-9b2533d2e8f5',ImportHeaderUUID=guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')</title>
                        <category term="API_MKT_IMPORT_MONITORING_SRV.ImportAggregatedMessage" scheme=""/>
                        <link href="ImportAggregatedMessages(ImportAggregatedMessageUUID=guid'02000a1b-a98f-1eda-81ac-9b2533d2e8f5',ImportHeaderUUID=guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')" rel="self" title="ImportAggregatedMessage"/>
                        <content type="application/xml">
                            <m:properties xmlns:m="" xmlns:d="">
                                <d:SystemMessageText>Channel assignmt for interact. type &amp;1 and comm. medium &amp;2 does not exist</d:SystemMessageText>
                        <title type="text">ImportAggregatedMessages(ImportAggregatedMessageUUID=guid'02000a1b-a98f-1eda-81ac-9b2533d2c8f5',ImportHeaderUUID=guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')</title>
                        <category term="API_MKT_IMPORT_MONITORING_SRV.ImportAggregatedMessage" scheme=""/>
                        <link href="ImportAggregatedMessages(ImportAggregatedMessageUUID=guid'02000a1b-a98f-1eda-81ac-9b2533d2c8f5',ImportHeaderUUID=guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')" rel="self" title="ImportAggregatedMessage"/>
                        <content type="application/xml">
                            <m:properties xmlns:m="" xmlns:d="">
                                <d:SystemMessageText>Product &amp;1 is not in product master; upload with interaction not possible</d:SystemMessageText>
                        <title type="text">ImportAggregatedMessages(ImportAggregatedMessageUUID=guid'02000a1b-a98f-1eda-81ac-9b2533d2a8f5',ImportHeaderUUID=guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')</title>
                        <category term="API_MKT_IMPORT_MONITORING_SRV.ImportAggregatedMessage" scheme=""/>
                        <link href="ImportAggregatedMessages(ImportAggregatedMessageUUID=guid'02000a1b-a98f-1eda-81ac-9b2533d2a8f5',ImportHeaderUUID=guid'02000a1b-a98f-1eda-81ac-9b2533cfa8f5')" rel="self" title="ImportAggregatedMessage"/>
                        <content type="application/xml">
                            <m:properties xmlns:m="" xmlns:d="">
                                <d:SystemMessageText>Invalid value '&amp;1' for attribute '&amp;2'</d:SystemMessageText>
        <content type="application/xml">
            <m:properties xmlns:m="" xmlns:d="">

Based on the data returned by the API, we will use the following fields to build our message alert: 

  • Message UUID02000a1b-a98f-1eda-81ac-9b2533cfa8f5
  • Creation Timestamp: 20191112155529.1913280
  • UserCB9980000052
  • Notification message details:
    • Channel assignmt for interact. type &amp;1 and comm. medium &amp;2 does not exist
    • Product &amp;1 is not in product master; upload with interaction not possible
    • Invalid value '&amp;1' for attribute '&amp;2'

Please note:

  • A maximum of 5000 import headers can be fetched in a single request.
  • The specification of TOP is mandatory.

Integration Scenario

iFlow - Cloud Integration Capability in SAP Integration Suite 

Create a simple iFlow with a self-trigger to query for failed import data notification from SAP Marketing Cloud then send an Email Alert Notification to the business system administrator.

In our integration scenario, we are going to call the public OData API Service 'API_MKT_IMPORT_MONITORING', Monitoring API with entity 'ImportHeaders' through iFlow.

Start Timer

Timer Step to automatically start and run on a particular schedule. In our use case, it's hourly running.

get Interval Hour

Content Modifier step to import external parameters "intervalHour" and "importMonitorUrl".

Interval Hour: Parameter to define the time interval range to query message notification.

Import Monitor URL: Parameter to define SAP Marketing Cloud URL Base to the message id hyperlink.

get Search Date

Groovy Script Step to build the time range (current date time and search date time).

Groovy Script: GetSearchDate
import java.util.HashMap;
import java.text.SimpleDateFormat;

def Message processData(Message message) {
       map = message.getProperties();
       prop = map.get("intervalHour")
       def intervalHour = prop as Integer
       def date = new Date()
	   today    = new SimpleDateFormat("yyyyMMddHHmmss").format(date)
	    use(groovy.time.TimeCategory) {
              def datenew = date - intervalHour.hours
              searchDate = new SimpleDateFormat("yyyyMMddHHmmss").format(datenew)


       return message;

get Failed Messages

Request-Reply Step to call SAP Marketing Cloud OData API 'API_MKT_IMPORT_MONITORING' in a syncrhonous mode and get back the response.

OData Call

OData Call to Query the import monitor notifications from SAP Marketing Cloud OData API 'API_MKT_IMPORT_MONITORING' based on the datetime range defined in the previous steps.

Operation Details: GET

Resource Path: Import Headers

Query Options: $select=ImportHeaderUUID, UTCDateTime, Status, StatusName, ExternalReference, FileName, HasStagingArea, CreationUTCDateTime, CreatedByUser, LastChangedUTCDateTime, LastChangedUser, ServiceName, RecordCount, SynchronousImportIsForced, HeaderToMessage/ImportAggregatedMessageUUID, HeaderToMessage/ImportHeaderUUID, HeaderToMessage/SystemMessageText, HeaderToMessage/SystemMessageType, HeaderToMessage/SystemMessageClass, HeaderToMessage/SystemMessageNumber, HeaderToMessage/SystemMessageCount & $expand=HeaderToMessage & $top=1000&$filter=Status eq '2' and CreationUTCDateTime ge ${property.searchDate} & $orderby=CreationUTCDateTime desc

Messages Found?

Router Step to check if there are messages returned from SAP Marketing Cloud OData API 'API_MKT_IMPORT_MONITORING' .

Build HTML

XSLT Mapping Step to build the HTML mail mapping with the OData attributes returned by the OData API 'API_MKT_IMPORT_MONITORING'.

XSLT Mapping: buildHTML
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl=""  xmlns:hci="" 
   exclude-result-prefixes="xs do hci"
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:param name="currentDate" />
<xsl:param name="searchDate"/>
<xsl:param name="importMonitorUrl"/>

 <xsl:function name="do:dateFormat">
      <xsl:param name="inDate" as="xs:string" />
       <xsl:value-of select= "concat(substring($inDate, 0,5),'-',substring($inDate, 5,2), '-',substring($inDate, 7,2), ' ',substring($inDate, 9,2), ':',substring($inDate, 11,2),':',substring($inDate, 13,2) )" />

 <xsl:function name="do:createURL">
      <xsl:param name="inURL" as="xs:string" />
      <xsl:param name="inMsgId" as="xs:string" />
       <xsl:value-of select= "concat($inURL,upper-case(translate($inMsgId,'-', '')))" />

<xsl:template match="/">
               table {
                border-collapse: collapse;
                th {
                th, td {
                border:1px solid #1661BE;
                .nothing {
                border-collapse: collapse;
                .space {
                border-spacing:0 15px;
                h3 {

        <tr class="nothing"><td colspan="8"><img src="" alt="SAP" align="right" /></td></tr>
		<tr class="nothing"><td colspan="8"><h1>SAP Marketing Cloud</h1></td></tr>
		<tr class="nothing"><td colspan="8"><h2>Dataload Monitoring</h2></td></tr>
		<tr class="nothing"><td colspan="8"><h3>Alert Monitoring has detected <xsl:value-of select="count(//ImportHeader)"/> errors during data importing from  <xsl:value-of select="do:dateFormat($searchDate)" /> to <xsl:value-of select="do:dateFormat($currentDate)"/>  UTC Time. </h3></td></tr>
        <tr >
                <th>Service Name</th>
                <th>Creation UTC Date Time</th>
                <th>Import Header UUID</th>
                <th>System Message Class</th>
                <th>System Message Text</th>
     <xsl:for-each select="ImportHeaders/ImportHeader">
        <xsl:variable name="occ" select="count(descendant::SystemMessageClass)" />
        <xsl:for-each select="HeaderToMessage/ImportAggregatedMessage">
              <xsl:if test="position()=1">
                    <td><xsl:attribute name="rowspan"><xsl:value-of select="$occ"/></xsl:attribute><xsl:value-of select="../../ServiceName"/></td>
                    <td><xsl:attribute name="rowspan"><xsl:value-of select="$occ"/></xsl:attribute>

                    <xsl:value-of select="do:dateFormat(../../CreationUTCDateTime)" />


                    <td><xsl:attribute name="rowspan"><xsl:value-of select="$occ"/></xsl:attribute><xsl:value-of select="../../CreatedByUser"/></td>
                    <td><xsl:attribute name="rowspan"><xsl:value-of select="$occ"/></xsl:attribute><xsl:value-of select="../../StatusName"/></td>
                    <td><xsl:attribute name="rowspan"><xsl:value-of select="$occ"/></xsl:attribute><xsl:value-of select="../../FileName"/></td>
                    <td><xsl:attribute name="rowspan"><xsl:value-of select="$occ"/></xsl:attribute>
                    <a ><xsl:attribute name="href"> <xsl:value-of select="do:createURL($importMonitorUrl,../../ImportHeaderUUID)" /></xsl:attribute><xsl:value-of select="../../ImportHeaderUUID"/></a></td>
              <td><xsl:value-of select="SystemMessageClass"/></td>
              <td><xsl:value-of select="SystemMessageText"/></td>
Alert Triggered / Mail Call

Mail Call to send the Alert Notification Mails to the business system administrators.

The payload is used as Mail Body in the Email Attributes Configuration.

For Mail configuration you can see the following documentation:

Please note:

  • There will be maximum 5000 notifications per iFlow as the SAP Marketing Cloud API returns a maximum of 5000 import headers.

Alert Email Notification

As a result of iFlow execution, an email is going to be sent to the business system users. In our use case, that's the alert notification sent to:

Email Alert Notification

If you click in the Import Header UUID hyperlink you will be redirected to the Import Monitor Notification message in SAP Marketing Cloud as below:

Further Extensions and Use Cases 

As you may notice, our current iFlow uses Mail Adapter feature from the cloud integration capability in SAP Integration Suite to send Mail notifications. It is very flexible tool you can customize the integration iFlow as needed. 

As a requirement, a customer could require the use of another outputs methods besides Email like SMS Notifications, Push Notification or even the sending of notifications to a central monitoring event system. Even for this requirement, there is a suitable service on SAP Business Technology Platform (SAP BTP): the SAP Alert Notification service for SAP BTP . See the following documentation.


In this article, you learned how to create Email Alert Notifications for failed import data from SAP Marketing Cloud using the Cloud Integration capability within SAP Integration Suite. Through this simple approach, you can proactively monitor data load in SAP Marketing Cloud to efficiently solve integration issues,

Learn more about data import concepts and other important business administration tasks such as:

  • user lists
  • customer journey events
  • application log
  • import monitor

To access all our community or out of the box product documentation, please check out our List of Online Resources.