How to Create Custom CDS Views for SAP Marketing Cloud
Supposed, as an Administrator in Marketing, you must prepare custom queries based on custom composite views, which consider other or additional base views than the standard composite views. In order to do so you can also create your own CDS composite views, which are used for custom analytical queries.
What are the Preconditions for using the “Custom CDS View” App?
As a prerequisite you have to prepare your administrator user in a way that the business catalog “Extensibility” is assigned to your business role. Your user administrator can take care on this.
The available attributes in the data base tables, e.g. for Interactions and Contacts, are sufficient for the scope of the desired query.
Apply “Custom CDS View” App to create you own View
To build a Customer CDS View you must launch the “Custom CDS Views” App from the Fiori Launchpad.
It is also possible to change existing Custom CDS Views if they are configured for editing.
You can select one from the list to change and adapt it to your needs by means of the Edit button.
If you want to create your own “Custom CDS View use the “Create” button.
If you want to use the Custom CDS View in Analytical scenarios you have to mark the corresponding check box.
You start your definition by selecting a Primary Data Source. SAP delivered and released basic views of application objects will appear in the list. From this list you must select the desired one.
Associated data sources will be selected and assigned the same way.
After the definition of the set of needed data sources and associations you must specify, which fields shall be included into the Custom CDS view.
You can also assign and define additional properties to the chosen fields.
In the last screen it is possible to define parameters and their values, which are applied when executing the view.
Using the “Data Preview” Button you can take a look at the data, this view is allowing you to access.
You can now start to define Custom Analytical Queries, if the new Custom View is defined as CDS Composite View (i.e. CDS Cube View).
To learn more about that, take a look at How to Create Custom Analytical Queries for SAP S/4HANA Marketing Cloud
Is it possible to write additional logic while creating this view? For example I want to expose only the distinct values from a property of existing view.
I think this could be achieved during the BADI which can be implemented in the Custom Fields and Logic app.
How to use filters. for example I want to filter my journal entry based on Posting date column
During the implementation step of Custom CDS View for filter you can find the Filter Formula and after you open it, you can define quite complex rules based on the available attributes of the underlying data sources.
Thanks for this blog.
In another forum it was recommended that I use CDS Views to achieve the following segmentation scenario:
Our customer wants to find out which customers interacted (visited the website, bought something, sent email, etc) at least N times over a certain period. How do you do this in segmentation without pre-counting the number of interactions outside of yMKT and storing the value in a marketing attribute? Normally if we use interaction date in segmentation and choose a period of one month for example, the resulting TG contains contacts/consumers who had at least 1 interaction during the period. What we want to find out is which contacts/customers interacted at least 10 times during the month of October for example. Another example is counting a specific interaction - which customers created at least 5 complaints over the last 2 years.
However, it wasn't clear how we can actually use CDS views for this. If you think CDS views can be used here can you please advise what additional steps we need to do to achieve this in segmentation.
Thanks and best regards,
CDS Views cannot be used in Segmentation, because due to the architecture of segmentation it is necessary to use native HANA Views in order to determine the relevant contacts.
However to my knowledge there are specific techniques to count the minimum required interactions in order to figure out the relevant contacts in a certain period. For more details please refer to the HANA developer Guideline.