CX Works

A single portal for curated, field-tested and SAP-verified expertise for your SAP C/4HANA suite. Whether it's a new implementation, adding new features, or getting additional value from an existing deployment, get it here, at CX Works.

How to Model Custom SAP HANA Views for SAP Marketing Cloud in Your Browser

How to model custom SAP HANA views for SAP Marketing Cloud in your browser

Customers who have very specific requirements for segmentation, scores or recommendations in SAP Marketing Cloud, sometimes need to create custom SAP HANA views.

In the past, this was done through Eclipse (including SAP HANA tools). You also needed time to set up the environment, communication to the database and more. Nowadays, you can do it purely in a ready to play cloud environment through SAP Cloud Platform.

In this article, you will learn how to do SAP HANA modelling on SAP Cloud Platform and how to add a custom view to SAP Marketing Cloud.

This approach will save time, cost and makes collaboration between colleagues easier.

For the Eclipse-based approach, please have a look at the blogs mentioned in the References section below.

Table of Contents


Ensure your SAP Marketing Cloud is ready. For general information about custom views in SAP Marketing Cloud, consult the documentation here.

Ensure your SAP Cloud Platform (Neo trial account) is ready. Please follow the guide here

SAP Cloud Platform provides two different development environments: Cloud Foundry and Neo.

Make sure you scroll down to "Access Neo Trial" when you are on to create a Neo development environment.

Step 1: Create an SAP HANA Database on SAP Cloud Platform

Log on to your SAP Cloud Platform Cockpit and create your SAP HANA database. For detailed documentation, have a look here.

Create the database with the standard settings as displayed in the screen below.

Wait until the database is created successfully and then click on the name of the SAP HANA database as shown below:

Step 2: Add Sufficient User Rights for SAP Cloud Platform HANA Web UI

After the successful creation of the database, we want to start SAP HANA modelling. However, to be able to do this, we need to enable some settings.

First, click on the SAP HANA Cockpit link and log in through the SYSTEM user and the defined password.

This will trigger the assignment of necessary roles to your SYSTEM user (as shown in the popup below) and is necessary for the next steps.

Next, click on OK and continue. You will now see your database's SAP HANA Cockpit.

Our user, however, is still not ready to use the SAP HANA Web-based Development Workbench Editor and Catalog functionality which is mandatory for SAP HANA modelling in the cloud. We need to add two roles. See the predefined SAP HANA Web-based Development Workbench roles here.

We will add the following roles to our user: “sap.hana.ide.roles::CatalogDeveloper” and “sap.hana.ide.roles::EditorDeveloper”. Note: These are the roles for our use case. The role/user assignment needs to be evaluated on a per project basis. Refer to the link above for available/required roles.

Click on the “Manage Roles and Users” tile in the SAP HANA Cockpit of your database (highlighted in the screen above).

Under User > SYSTEM, add those two roles through the plus button to your user. Save your changes (Ctrl + S).

Now, the SYSTEM user is able to open the editor and the catalog of the SAP HANA Web-based Development Workbench.

The last step for modelling preparation is to create an ABAP schema in the SAP HANA database catalog IDE as this is required by SAP Marketing Cloud.

Since SAP Marketing Cloud always works with this schema name, we will export all table SQLs for this ABAP schema.

Open the catalog and execute the following statement through the SQL console.


This will create a new schema “ABAP”. The schema should be visible after a refresh, as shown below.

Step 3: Custom View Modelling in SAP HANA Web-based Development Workbench

The environment is now ready and we can start modelling.

Some restrictions apply for SAP Marketing Cloud custom views which can be found here and will be checked during import of the custom view later on.

For example, this means that for segmentation we must provide the technical identifier (example, CONTACT_KEY) of the interaction contact in the semantics node of our custom view and need to add specific tables (example, CUAND_CE_IC_FCET).

To export existing views/tables from SAP Marketing Cloud which are necessary for your modelling project, use the SAP Marketing Cloud App “Add Custom Views”.

In the example below, we will export the CUAND_CE_IC_FCET table as this is necessary for our use case (1.).

Next, import the table definitions through SQL Console in SAP HANA Web-based Development Workbench Catalog as shown below (2.). The table should appear as shown below (3.).

Once all the necessary tables or views are imported, we can start modelling through the SAP HANA Web-based Development Workbench Editor.

Below is an example of a custom view that is adding the corresponding landing page name where a contact originates from, to Segmentation. Here, we used the CUAND_CE_IC_FCET table previously exported along with other tables.

To import this view through the App “Add Custom Views” in SAP Marketing Cloud, we need to save the view first as XML. To do this, right click on the view and use Open With > Text Editor (1.). This will open a new tab with XML data (2.).

Copy this XML representation of the SAP HANA view and save it as an XML file to your local computer. Next, import this file through the App “Add Custom Views” in SAP Marketing Cloud as shown below.


SAP Cloud Platform

SAP Marketing Cloud


In this article, you learned how to do SAP HANA modelling for SAP Marketing Cloud through browser-based web UIs. This allows you to jump-start your implementation projects and saves you time and money.