<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: CSRF token retrieval fails when making calls from the... in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/csrf-token-retrieval-fails-when-making-calls-from-the-sap-btp-abap/qaa-p/13790241#M4840985</link>
    <description>&lt;P&gt;&lt;A href="https://community.sap.com/t5/technology-blogs-by-sap/how-to-execute-actions-or-function-imports-in-remote-odata-services-from/ba-p/13536051" target="_blank"&gt;https://community.sap.com/t5/technology-blogs-by-sap/how-to-execute-actions-or-function-imports-in-remote-odata-services-from/ba-p/13536051&lt;/A&gt;&lt;/P&gt;&lt;P&gt;there are some code to get csrf token and send for post call.&lt;/P&gt;&lt;P&gt;check if you can incorporate the code .&lt;/P&gt;</description>
    <pubDate>Sat, 10 Aug 2024 16:17:38 GMT</pubDate>
    <dc:creator>junwu</dc:creator>
    <dc:date>2024-08-10T16:17:38Z</dc:date>
    <item>
      <title>CSRF token retrieval fails when making calls from the SAP BTP ABAP environment to an S/4 HANA on-pre</title>
      <link>https://community.sap.com/t5/technology-q-a/csrf-token-retrieval-fails-when-making-calls-from-the-sap-btp-abap/qaq-p/13789830</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;&lt;P&gt;I am trying to call the S/4 HANA on premise system from ABAP Environment via Destinations.&lt;/P&gt;&lt;P&gt;GET Call is working as expected.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the code. I am trying to do the post call based on some input parameter&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;DATA(&lt;/SPAN&gt;&lt;SPAN&gt;http_destination&lt;/SPAN&gt;&lt;SPAN&gt;) = &lt;/SPAN&gt;&lt;SPAN&gt;cl_http_destination_provider&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;create_by_cloud_destination&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i_name&lt;/SPAN&gt;&lt;SPAN&gt; = CONV #( &lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;fs_sap_systems&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;destination_name&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i_authn_mode&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;if_a4c_cp_service&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;service_specific&lt;/SPAN&gt;&lt;SPAN&gt; ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;lo_http_client&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;cl_web_http_client_manager&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;create_by_http_destination&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;http_destination&lt;/SPAN&gt;&lt;SPAN&gt; ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;lo_client_proxy&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;/iwbep/cl_cp_factory_remote&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;create_v2_remote_proxy&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;is_proxy_model_key&lt;/SPAN&gt;&lt;SPAN&gt; = VALUE #( &lt;/SPAN&gt;&lt;SPAN&gt;repository_id&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;'DEFAULT'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proxy_model_id&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;'ZSCM_USER_LOCKED'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proxy_model_version&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;'0001'&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;io_http_client&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;lo_http_client&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;iv_relative_service_root&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;'/sap/opu/odata/sap/ZS_USER_LOCKS_SRV1111/'&lt;/SPAN&gt;&lt;SPAN&gt; ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;" Prepare business data&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ls_business_data&lt;/SPAN&gt;&lt;SPAN&gt; = VALUE #( &lt;/SPAN&gt;&lt;SPAN&gt;uname&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;is_user_locked_st&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;uname&lt;/SPAN&gt;&lt;SPAN&gt; ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;" Navigate to the resource and create a request for the create operation&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;lo_request&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;lo_client_proxy&lt;/SPAN&gt;&lt;SPAN&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;create_resource_for_entity_set&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;'USER_LIST_LOCK_SET'&lt;/SPAN&gt;&lt;SPAN&gt; )-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;create_request_for_create&lt;/SPAN&gt;&lt;SPAN&gt;( ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;" Set the business data for the created entity&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;lo_request&lt;/SPAN&gt;&lt;SPAN&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;set_business_data&lt;/SPAN&gt;&lt;SPAN&gt;( &lt;/SPAN&gt;&lt;SPAN&gt;ls_business_data&lt;/SPAN&gt;&lt;SPAN&gt; ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;lo_response = lo_request-&amp;gt;execute( ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;After executing the statement, I encounter a CSRF token failed exception. Is there a need to upload any certificate on the S/4 HANA side?&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 09 Aug 2024 20:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/csrf-token-retrieval-fails-when-making-calls-from-the-sap-btp-abap/qaq-p/13789830</guid>
      <dc:creator>nishantbansal91</dc:creator>
      <dc:date>2024-08-09T20:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF token retrieval fails when making calls from the...</title>
      <link>https://community.sap.com/t5/technology-q-a/csrf-token-retrieval-fails-when-making-calls-from-the-sap-btp-abap/qaa-p/13790241#M4840985</link>
      <description>&lt;P&gt;&lt;A href="https://community.sap.com/t5/technology-blogs-by-sap/how-to-execute-actions-or-function-imports-in-remote-odata-services-from/ba-p/13536051" target="_blank"&gt;https://community.sap.com/t5/technology-blogs-by-sap/how-to-execute-actions-or-function-imports-in-remote-odata-services-from/ba-p/13536051&lt;/A&gt;&lt;/P&gt;&lt;P&gt;there are some code to get csrf token and send for post call.&lt;/P&gt;&lt;P&gt;check if you can incorporate the code .&lt;/P&gt;</description>
      <pubDate>Sat, 10 Aug 2024 16:17:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/csrf-token-retrieval-fails-when-making-calls-from-the-sap-btp-abap/qaa-p/13790241#M4840985</guid>
      <dc:creator>junwu</dc:creator>
      <dc:date>2024-08-10T16:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF token retrieval fails when making calls from the...</title>
      <link>https://community.sap.com/t5/technology-q-a/csrf-token-retrieval-fails-when-making-calls-from-the-sap-btp-abap/qaa-p/13793080#M4841373</link>
      <description>Hello Junwu, I am able to fetch the CSRF token via this code. Thank you for your help</description>
      <pubDate>Tue, 13 Aug 2024 11:34:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/csrf-token-retrieval-fails-when-making-calls-from-the-sap-btp-abap/qaa-p/13793080#M4841373</guid>
      <dc:creator>nishantbansal91</dc:creator>
      <dc:date>2024-08-13T11:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: CSRF token retrieval fails when making calls from the...</title>
      <link>https://community.sap.com/t5/technology-q-a/csrf-token-retrieval-fails-when-making-calls-from-the-sap-btp-abap/qaa-p/13793397#M4841415</link>
      <description>good to know it works, please close the topic if your question is answered.</description>
      <pubDate>Tue, 13 Aug 2024 16:27:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/csrf-token-retrieval-fails-when-making-calls-from-the-sap-btp-abap/qaa-p/13793397#M4841415</guid>
      <dc:creator>junwu</dc:creator>
      <dc:date>2024-08-13T16:27:04Z</dc:date>
    </item>
  </channel>
</rss>

