cancel
Showing results for 
Search instead for 
Did you mean: 

Consume HCP OData from within SAP Cloud Application Studio

Former Member
0 Kudos

Hello Experts,

I have a requirement that states a need to consume (read, etc) data via OData provided by an application running SAP Hana Cloud Platform from within SAP Cloud for Customer.

The data should be displayed on C4C UI screen.

Any idea how to implement this? would a mashup work here or there is a better way to do that?

Looking forward for you answers.

Best regards

Mohammed

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mohammed,

Basically, you can do the following:

1) Create an external webservice integration in studio.
2) Set to use REST webservice.

3) Generate and configure communications systems and arrangements.

4) Perform the request by absl code and parse (you have to parse it by yourself =\) the response into your fields.

You can read about "external webservice integration" in the studio documentation.

Regards,

Alexandre.

Former Member
0 Kudos

Hi Alexandre,

Thanks for the answer.

Is there any example of how to perform step 4, is it a normal request parsing or does it need additional consideration?

Best regards

Mohammed

Former Member
0 Kudos

Hi Mohammed,

The request is something like:

var communicationScenarioName = "Blah";
var serviceName = "BlahBlah";
var httpMethod = "POST";
var resourceName = "";
var contentType = "application/json";
var urlParameters : collectionof NameAndValue;
var headerParameters : collectionof NameAndValue;
var body = "{\"value\":{\"key\":\"" + params.WSKeyExterna + "\",\"secret\":\"" + params.WSSecretExterno + "\"}}";

var response = WebServiceUtilities.ExecuteRESTService(communicationScenarioName,serviceName, httpMethod, resourceName, urlParameters,headerParameters,contentType, body);

There are posts here in scn with more examples.

To parse the response, you can create a library that uses the following code:

Then, you search/loop for the fields u want and set in you BO fields.

Best regards,

Alexandre.

Answers (0)