Skip to Content

Preventing specific field in target structure from being passed to target system

Hello Experts,

I have an RFC to REST scenario where I need to generate a token to include in HTTP header so as to authenticate while consuming the REST service. I am planning to do this using a UDF so the output could be stored in a field and then the value from that field could be utilized in the HTTP header while sending xml to REST service.

But, I dont want to include the token value in the payload when it reaches the target REST service.

Please help me to achieve this.

Regards,

Faisal

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 25, 2018 at 03:47 AM

    Hi Faisal,

    You can create a local variable in mapping and pass the UDF value there. It won't appear in the payload.

    https://blogs.sap.com/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable/

    Regards,

    Mark

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 25, 2018 at 07:06 AM

    use dynamic configuration in UDF. and access the values from adapter configuraiton.

    https://answers.sap.com/questions/84202/how-configure-dynamic-http-header-in-rest-receiver.html

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 25, 2018 at 06:06 AM

    There are some inbuilt features in the REST adapter for OAuth 2.0 and grant type authentication.

    So, based on the type of token service your target system supports, you can explore that as well.

    Add comment
    10|10000 characters needed characters exceeded

    • Hello APU,

      The authentication is NOT oAuth based. Basically, the system expects an SHA1 encode of a combination of user+secret(static)+current date time stamp. And I am currently planning to create a udf for this. Please advise.