cancel
Showing results for 
Search instead for 
Did you mean: 

How should I consume Odata Service from abap client?

0 Kudos

Hi,

Actually I have an requirement to invoke Odata service(Successfactor) from ABAP client. I have the URL. I need to execute the service and get the data in my ABAP report and after that i need to do some mapping in order to get the desired result.

I have tried to create client proxy in order to call the web service, but always getting an error message while configuring the client proxy.

I have tried another option to use CL_ODL_API to execute the Web Service. But I am not sure how do i configure the authentication process. Because without the authentication we cannot get the data.

can any one help me?

regards,

Rimi

Accepted Solutions (1)

Accepted Solutions (1)

stefan_schreck
Participant
0 Kudos

Hello Rimi,
If you want to use CL_ODL_API, you have to follow the instructions at saphelp for the SAP UI Add-On:

User Interface Add-On for SAP NetWeaver - SAP Library

Here you can find a section "Social Media Integration"; the subfolder ""Information for Administrators" described the configuration, the section "Information for developers" describes how to consume the OData API that is represented by CL_ODL_API.

Answers (4)

Answers (4)

0 Kudos

Hi Rimi,

You need to call cl_http_client class methods to achieve this requirement.

First i would recommend you to execute the Success Factor URL in Postman Client with basic Authentication and if it is successful there then you can directly consume that in your ABAP Program.

i am in the process of Writing an Excellent Blog for this Request. will keep you guys updated once it is ready.

In the mean while i would request you to follow the below Link to go through.

https://blogs.sap.com/2016/06/21/consume-odata-service-in-abap-clhttpclient-createbydestination-http...

Regards

Ram

kammaje_cis
Active Contributor
0 Kudos

Please note that OSCI is mainly for creating a new SAP OData service out of an external/other OData service. So it would not suit your requirement if your aim is consumption alone.

I would start the process by creating an RFC destination of type External http. You have the options to mention SSL and any authentication options there. You also need to maintain client side certificates in Tcode STRUST for SSL connections. Using "Test Connection" option, start testing the connectivity. Once this works, you can start using CL_REST_HTTP_CLIENT. (Create the instance using the RFC destination created).

Former Member
0 Kudos

This caind of data Services no matter the caind always needs to specify the identity and just need to translate the script acord the rules of program in ABAP between comunication ports indeed, isually  use ETL notes script and can leter validate a format, above the topic of needs.

Att.

Regards

AshwinDutt
Active Contributor
0 Kudos

Hello Rimi,

U can check the below things once:


This Should help u if u have all necessary components:

Refer

Please refer the below as well:


Here an external rest service is being consumed in GW level.

The complete URL of an external rest service is fired from the GW methods and the response is captured and hence this intern it will become a GW service only.


Since GW Services are also fired through URL & Payload, I think the way external rest service is consumed as shown in above blog the same way u can consume GW service as well by just giving the complete URL.


Should be possible i guess.

Please try and check once

Regards,

Ashwin

Former Member
0 Kudos

I would try OSCI first as it is specifically designed for OData.

General RESTful service consumption is not governed by any protocol and therefore needs to be written on a case by case basis.

Regards

Ron.

0 Kudos

Hi Ashwin,

I have tried the second approach and it is similar to my requirement. But everytime I am getting a 'HTTP Communication Failure' message. Do you have how do I correct this?

lo_http_client->receive(
  EXCEPTIONS
    http_communication_failure = 1
    http_invalid_state         = 2
    http_processing_failed     = 3 ).

Regards,

Rimi

AshwinDutt
Active Contributor
0 Kudos

Hello Rimi,

No not sure. I think u need n debug and check why u r getting that exception.

Did u debug ? any idea where exactly its failing ?

In which format u r getting data ? XML ?

Regards,

Ashwin