cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP Marketing - Consuming a CDS view (cube) via Odata in SAP CPI

malte_suessmann
Discoverer
0 Likes
1,364

Hello everyone,

I am facing the following problem.

I would like to consume a standard CDS View via the SAP CPI and process the aggregated data with mapping and so on.

This is the C_MKT_CAMPAIGNSUCCESSQ_CDS view.

If I call it via Postman or the browser as follows, I get the desired result.

C_MKT_CAMPAIGNSUCCESSQ_CDS/C_MKT_CAMPAIGNSUCCESSQ(P_StartDate=datetime'2020-09-01T10:26:00',P_EndDate=datetime'2020-09-15T10:26:00')/Results? $format=json&$select=MarketingArea,CampaignName,NumberOfSentMessages,NumberOfDeliveredMessages,NumberOfTotalClicks,NumberOfOpenedMessages,NumberOfUniqueClicks

The SAP CPI wants to do this but cannot and wants to work with the parameter $expand. In my opinion the call would be the following:

sap/opu/odata/sap/C_MKT_CAMPAIGNSUCCESSQ_CDS/C_MKT_CAMPAIGNSUCCESSQ(P_StartDate=datetime'2020-09-01T10:26:00',P_EndDate=datetime'2020-09-15T10:26:00')?$format=json&$select=Results/MarketingArea,Results/NumberOfSentMessages&$expand=Results

but I always get the following error message:

<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <code>BW_BICS_EQ/131</code> <message xml:lang="de">Entity set C_MKT_CAMPAIGNSUCCESSQParameters is not supported</message>

Has anyone already realized something like this or has an idea without errors? 🙂

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member226
Employee
Employee

Hello,

In my understanding, the reason for this error is that the system is unable to handle your API request due to missing implementation at the backend. The same can also be verified via launching a call within the following browser URL call:

C_MKT_CAMPAIGNSUCCESSQ_CDS/C_MKT_CAMPAIGNSUCCESSQ(P_StartDate=datetime'2018-09-01T10:26:00',P_EndDate=datetime'2020-09-15T10:26:00')?$format=json

You will see the same error.

Further, why the other URL works is, because you are there trying to reach "/results" endpoint or entityset which is how SAP might have designed the API hence when you omit this entity set then it doesnot work.

May be 1 question, why cannot you call the working URL from CPI with /Results endpoint? why you want to use $expand? is there any specific reason for that?

malte_suessmann
Discoverer
0 Likes

hey Saurabh Kabra,

i have tried. so take /Results as endpoint. But the CPI can't handle it, according to the SAP ticket. I have to use $expand=Results. which leads to the error said error.

Abd_Am_K
Active Participant
0 Likes

Hi malte.suessmann,

You can create an external api on top of existing released Data Sources.

Please check this help link for the process.

https://help.sap.com/viewer/0f69f8fb28ac4bf48d2b57b9637e81fa/2011.500/en-US/f4dcfd6e14b54177b98d6099...

malte_suessmann
Discoverer
0 Likes

Hey Abdullah Amer,

if I build a custom view as API on the same data cube as the standard CDS view, I have the same problem. I have to use again the parameter Start- and Endtime to restrict and Result to query the results. So it just shifts the problems 🙂 I already tried that.