on 2023 Dec 13 9:30 PM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 17 | |
| 8 | |
| 7 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.