Skip to Content
0

SAP REST Receiver - Access Response HTTP Header values

Mar 13 at 01:27 PM

79

avatar image

Hello,

I am developing an interface in ERP using SAP PI with REST adapter (Receiver). It is a synchronous call and I need to read the Response HTTP Header to get the location. I can see the http header attributes in DynamicConfiguration in sxmb_moni (ERP) but do not know how to access them in my program. Can you please suggest?

Thanks and Regards

Sathya

10 |10000 characters needed characters left characters exceeded

Dynamic Config(ERP) Screen Shot

fzycg.png (129.5 kB)
0

Hi Sathya,

In the response mapping, use a user-defined function to read the value of the dynamic configuration.

Regards,

Mark

1

Hi Mark,

Thank you. Can you please explain or provide any documents on how to do it?

Thanks

Sathya

0
Sathya Gunasekaran

HI Sathya,

Something like this

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/REST","Location");
String location = conf.get(key);

return location;
1

Thanks Mark. I am an ABAP developer learning PI :). Progressing slowly. But hoping to reach there! Thank you once again. Will update you once I am able to receive the http header in ERP!

Thanks again

Sathya

1
Sathya Gunasekaran

Best of luck in your journey to SAP PI learning! :)

1
* Please Login or Register to Answer, Follow or Comment.

0 Answers