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

SAP PO 7.5 - No option to pass headers in ODATA receiver channel with CREATE/QUERY operation

sajith_p
Participant
0 Kudos
761

Hello Exports,

I am trying to call SAP ODATA API (V2.0) using the ODATA receiver channel (Connectivity Add-on 2.0) in SAP PO 7.5 SP20.

I am using the CREATE operation to post an Order record in SAP ECC via ODATA service.

Here have to pass the headers parameters like

X-CSRF-Token, SAP Client, Country & some more parameters.

But in the ODATA adapter there is no option to pass the header parameters like in REST channel.

Is this a product bug? Any other way to pass header parameters. In CPI I see the option to pass Header Parameters.

I tried using the REST receiver channel, but it is not creating the record in ECC even though server returns 200 status code. I think this is because ODATA V2.0 will not support by REST channel, correct if this understanding is wrong,

Is anyone face this issue?, and any solutions.?

Thank you.

SAJITH PITTAN

Accepted Solutions (0)

Answers (1)

Answers (1)

anupam_ghosh2
Active Contributor
0 Kudos

Hi Sajith,

Raise this with SAP if you want to continue with standard approach.

Other way round is to use apache library in adapter module/java mapping. In custom coding you can add headers as per below sample.

ODataClient client = ODataClientFactory.getClient(); 
// client.addHeader("Header","123456789"); // <---- this code is what I am seeking
URI customersUri = client.newURIBuilder("uri/northwindmodel.svc")
        .appendEntitySetSegment("Customers").build();

ODataEntitySetIteratorRequest<ClientEntitySet, ClientEntity> entitySetIteratorRequest =
        client.getRetrieveRequestFactory().getEntitySetIteratorRequest(qryUri);

entitySetIteratorRequest.addCustomHeader("Custom-Header-key", "Custom-Header-Value");

ODataRetrieveResponse<ClientEntitySetIterator<ClientEntitySet, ClientEntity>> response = entitySetIteratorRequest.execute();

Regards

Anupam

Kesha2
Discoverer
0 Kudos

Hi Sajith,

Did you get anything from SAP on this? Or any blogs that can be helpful as I have similar requirement in SAP PO 7.5.

 

#Odata#customHTTPHeader#SAPPO7.5