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

Side-by-side Extensibility with SAP Rapid Application Development Service by Mendix Part 2/3

8 min read

SAP Marketing Cloud - Side-by-side extensibility with SAP Rapid Application Development Service by Mendix

The SAP Marketing Cloud standard solution can be enhanced with in-app extensibility and external tools. In this article series we will focus on SAP Rapid Application Development service by Mendix for side-by-side extensibility to build applications for desktop and mobile. SAP Rapid Application Development service by Mendix can be leveraged in all CX solutions, as well as for S4 and other SAP products. In the first article we gave a short overview on SAP Rapid Application Development service by Mendix as well as the trade fair use case. The use case will be used as an implementation example of the trade fair application in the third part of the article series. In this part you will learn more on how to get started with side-by-side extensibility of your solution.

Table of Contents

Prerequisites

Before starting to implement your application within SAP Rapid Application Development service by Mendix, there are some prerequisites you need to consider:

  1. Define a user story and identify the data objects/APIs of SAP Marketing Cloud you want to leverage for the scenario
  2. Setup the communication information in SAP Marketing Cloud 
    • For the trade fair user story a technical communication user as well as a communication system and arrangement needs to be created in order to grant access to the APIs that should be used in your application
  3. Setup of SAP BTP/Mendix account
    • The onboarding guide describes in detail how to create the SAP BTP and Mendix account
  4. Create an app in SAP Rapid Application Development service by Mendix based on SAP Apps
    • More information on the creation of the app can be found in the Mendix Academy - Lecture
    • The "SAP Fiori themed app" will be used for this scenario. With that, the OData Connector is already available in the app. Therefore no download from the Mendix store has to be performed.
  5. Open the app in SAP Rapid Application Development service by Mendix
    • The user story in this article will be implemented with Mendix Studio Pro.

Implementation Approach

When creating a SAP Marketing Cloud application with SAP Rapid Application Development service by Mendix, the following components are needed:

  1. SAP Marketing Cloud Domain Model to store/hold data within the application
  2. Connecting to SAP Marketing Cloud with Mendix OData Connector to retrieve data from/to SAP Rapid Application Development service by Mendix
  3. Create business logic with Microflows
  4. UI (pages) that shows/interacts with the microflows & domain model  

In the following sub-chapters we will provide detailed information about step 1. The other steps will be described in the third article.

Setup of the SAP Marketing Cloud Domain Model in SAP Rapid Application Development service by Mendix

Identify Data Objects/APIs in SAP Marketing Cloud

Identify the SAP Marketing Cloud data objects, that should be leveraged for the user story. In the trade fair scenario the following data objects are needed to implement the application:

  • Interaction Contact (visitor of the trade fair)
  • Event (trade fair & sessions)
  • Product (product demo)
  • Interactions (email invitation, trade fair participation, session registration & sales meeting)

In the next step, the data objects have to be mapped to the SAP Marketing Cloud APIs, so that we are be able to retrieve the data in SAP Rapid Application Development service by Mendix.

Retrieve OData metadata from SAP Marketing Cloud

First the APIs (OData) have to be downloaded from SAP Marketing Cloud.

  1. Below mentioned metadata request has to be executed in a web browser (e.g. Google Chrome) for your system (replace the host with your SAP Marketing Cloud system - e.g. XXXX-api.s4hana.ondemand.com)
  2. Select the content (STRG+A) and copy it to a text file (.txt)
  3. Delete the first row ("This XML file does not appear to have any style information associated with it. The document tree is shown below.") and save the file as xml file (.xml)
  4. Repeat this step for all OData requests listed below

Create SAP Rapid Application Development service by Mendix Domain Model

The above created XML files have now to be converted into a project format, so that SAP Rapid Application Development service by Mendix can work with them.

For this purpose, SAP Rapid Application Development service by Mendix created the "OData Model Creator for SAP solutions".

  1. Open the page https://sapodatamodelcreator.mendixcloud.com/
  2. Choose "Manual", select one of your XML files and continue 
  3. Select the schema, continue and generate the .mpk file
  4. Download the .mpk file


Import the Domain Model (.mpk files) to SAP Rapid Application Development service by Mendix

The generated .mpk files have to be imported into the application:

  1. Right click on your project (e.g. "Project 'SAPTradeFairApp'"), select option "Import module package..." and choose one of your .mpk files
  2. Import the Domain Model with option "Add as new module"
  3. After importing all services, the project should look like below
  4. All four objects are now available as data models in your project

Setup "Main" application Domain Model

To be able to navigate through and connect the different objects (data models), an additional domain model has to be created.
The so called "main" domain model ("TradeFairObject") will associate the four generated domain models.

Inside the microflows and pages an object "TradeFairObject" of the domain model will be created for each user that runs the app. 
The data is then replicated via the above mentioned APIs to SAP Rapid Application Development service by Mendix application, to store them in the four data models. Via the associations of object "TradeFairObject", the data can be accessed.

 


Conclusion

In this article you learned how to get started with SAP Rapid Application Development service by Mendix. This part highlighted how to retrieve the APIs you want to leverage in your application from SAP Marketing Cloud. Besides that the conversion of .xml files to the .mpk format with help of the OData Model Creator was explained, which enables you to upload files to SAP Rapid Application Development service by Mendix. In the last step you also learned how to create a main data model, which will be needed for further steps regarding the implementation of the use case that are described in the third article

Overlay