<?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>topic Re: Get Data from https://smard.api.bund.dev/ not working (complete ABAP-Code is in post) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14063610#M2041507</link>
    <description>&lt;P&gt;The data you get from get_cdata is binary data. You have to translate it into your program internal data.&lt;/P&gt;&lt;P&gt;First you can translate it into readable data to see that you have the right data, for instance using method CL_BINARY_CONVERT=&amp;gt;XSTRING_UTF8_TO_STRING.&lt;/P&gt;&lt;P&gt;You can map the binary data using "CALL TRANSFORMATION" to program internal data. Maybe a "Simple Transformation" does the job for you (&lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenabap_st.htm" target="_blank"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenabap_st.htm&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;Or use the sXML library to analyze the data (&lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenabap_sxml_lib.htm" target="_blank"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenabap_sxml_lib.htm&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;There may be other ways to analyze the json data.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Apr 2025 20:30:35 GMT</pubDate>
    <dc:creator>ulrich_mhrke</dc:creator>
    <dc:date>2025-04-01T20:30:35Z</dc:date>
    <item>
      <title>Get Data from https://smard.api.bund.dev/ not working (complete ABAP-Code is in post)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14039865#M2041348</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;I have to code some ABAP to receive data from &lt;A href="https://smard.api.bund.dev/" target="_blank" rel="noopener"&gt;https://smard.api.bund.dev/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For my first attemped I used the URL "&lt;A href="https://smard.api.proxy.bund.dev/app/chart_data/1223/DE/index_hour.json&amp;quot;" target="_blank" rel="noopener"&gt;https://smard.api.proxy.bund.dev/app/chart_data/1223/DE/index_hour.json"&lt;/A&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;When I use this URL in the browser I see/get&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariomueller68_1-1741669507050.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/235358i335A7A2B59291EFC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mariomueller68_1-1741669507050.png" alt="mariomueller68_1-1741669507050.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;I created a SM59 connection:&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariomueller68_0-1741669374189.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/235356iD2BBEB27F3DADB0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mariomueller68_0-1741669374189.png" alt="mariomueller68_0-1741669374189.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;  DATA: lo_http_client TYPE REF TO if_http_client,
        lv_url         TYPE        string.


  cl_http_client=&amp;gt;create_by_destination(
      EXPORTING
          destination = 'BUNDESNETZAGENTURSTROMMARKTDATEN'
      IMPORTING
          client = lo_http_client " HTTP Client object
      EXCEPTIONS
           argument_not_found = 1
           destination_not_found = 2
           destination_no_authority = 3
           plugin_not_active = 4
           internal_error = 5
           OTHERS = 6 ).

  lo_http_client-&amp;gt;request-&amp;gt;set_method( if_http_request=&amp;gt;co_request_method_post ).
  lo_http_client-&amp;gt;request-&amp;gt;set_version( if_http_request=&amp;gt;co_protocol_version_1_1 ).
  lv_url =
  '/app/chart_data/1223/DE/index_hour.json'.

  CALL METHOD cl_http_utility=&amp;gt;set_request_uri
    EXPORTING
      request = lo_http_client-&amp;gt;request
      uri     = lv_url.


  lo_http_client-&amp;gt;request-&amp;gt;set_content_type( 'application/json' ).
  CALL METHOD lo_http_client-&amp;gt;send "sending request to api
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2.

  CALL METHOD lo_http_client-&amp;gt;receive "receiving response from api
    EXCEPTIONS
      http_communication_failure = 1
      http_invalid_state         = 2
      http_processing_failed     = 3.

  DATA:
*        http_status TYPE string,
        reason      TYPE string,
        response    TYPE string.

  CALL METHOD lo_http_client-&amp;gt;response-&amp;gt;get_status
    IMPORTING
      code   = data(http_status)
      reason = reason.

  response = lo_http_client-&amp;gt;response-&amp;gt;get_cdata( ).
*  cl_demo_output=&amp;gt;display_json( json = json_response ).
  cl_demo_output=&amp;gt;display_text( text =  response ).&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;But my ABAP Code displays only:&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariomueller68_2-1741669569203.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/235359i36F9F7653D00B7BD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mariomueller68_2-1741669569203.png" alt="mariomueller68_2-1741669569203.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;What I am doing wrong&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Mar 2025 05:08:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14039865#M2041348</guid>
      <dc:creator>mariomueller68</dc:creator>
      <dc:date>2025-03-11T05:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get Data from https://smard.api.bund.dev/ not working (complete ABAP-Code is in post)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14047344#M2041419</link>
      <description>&lt;P&gt;Hi, check the HTTP Method (use GET instead of POST in ABAP).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Mar 2025 15:33:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14047344#M2041419</guid>
      <dc:creator>M-K</dc:creator>
      <dc:date>2025-03-17T15:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get Data from https://smard.api.bund.dev/ not working (complete ABAP-Code is in post)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14049114#M2041424</link>
      <description>&lt;P&gt;Hi M-K,&lt;BR /&gt;&lt;BR /&gt;thx for the reply. But this did not solve the issue &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;thanks regards,&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 05:57:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14049114#M2041424</guid>
      <dc:creator>mariomueller68</dc:creator>
      <dc:date>2025-03-19T05:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Get Data from https://smard.api.bund.dev/ not working (complete ABAP-Code is in post)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14054884#M2041465</link>
      <description>&lt;P&gt;I would try to use method get_data instead of get_cdata on line 51.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 14:30:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14054884#M2041465</guid>
      <dc:creator>ulrich_mhrke</dc:creator>
      <dc:date>2025-03-24T14:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get Data from https://smard.api.bund.dev/ not working (complete ABAP-Code is in post)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14062638#M2041503</link>
      <description>&lt;P&gt;Hi Ulrich,&lt;/P&gt;&lt;P&gt;many thanks. Looks much better but not 100% &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariomueller68_0-1743479923956.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/245161i329DB128D1846829/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mariomueller68_0-1743479923956.png" alt="mariomueller68_0-1743479923956.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But when I put the URL&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://smard.api.proxy.bund.dev/app/chart_data/1223/DE/index_hour.json" target="_blank"&gt;https://smard.api.proxy.bund.dev/app/chart_data/1223/DE/index_hour.json&lt;/A&gt;&lt;/P&gt;&lt;P&gt;in the Browser I get:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mariomueller68_1-1743479965551.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/245162i187634AA4BB85EDD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mariomueller68_1-1743479965551.png" alt="mariomueller68_1-1743479965551.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;BR /&gt;&lt;BR /&gt;thanks regards,&lt;/P&gt;&lt;P&gt;Mario&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 04:00:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14062638#M2041503</guid>
      <dc:creator>mariomueller68</dc:creator>
      <dc:date>2025-04-01T04:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get Data from https://smard.api.bund.dev/ not working (complete ABAP-Code is in post)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14063610#M2041507</link>
      <description>&lt;P&gt;The data you get from get_cdata is binary data. You have to translate it into your program internal data.&lt;/P&gt;&lt;P&gt;First you can translate it into readable data to see that you have the right data, for instance using method CL_BINARY_CONVERT=&amp;gt;XSTRING_UTF8_TO_STRING.&lt;/P&gt;&lt;P&gt;You can map the binary data using "CALL TRANSFORMATION" to program internal data. Maybe a "Simple Transformation" does the job for you (&lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenabap_st.htm" target="_blank"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenabap_st.htm&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;Or use the sXML library to analyze the data (&lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenabap_sxml_lib.htm" target="_blank"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenabap_sxml_lib.htm&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;There may be other ways to analyze the json data.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Apr 2025 20:30:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14063610#M2041507</guid>
      <dc:creator>ulrich_mhrke</dc:creator>
      <dc:date>2025-04-01T20:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Get Data from https://smard.api.bund.dev/ not working (complete ABAP-Code is in post)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14085358#M2041689</link>
      <description>&lt;P&gt;Solved.&lt;BR /&gt;I had to import a certificate.&lt;BR /&gt;Also I made a typo when entering the URL in SM59&lt;BR /&gt;&lt;BR /&gt;Thank you all for the support!&lt;/P&gt;</description>
      <pubDate>Thu, 24 Apr 2025 09:38:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-data-from-https-smard-api-bund-dev-not-working-complete-abap-code-is-in/m-p/14085358#M2041689</guid>
      <dc:creator>mariomueller68</dc:creator>
      <dc:date>2025-04-24T09:38:50Z</dc:date>
    </item>
  </channel>
</rss>

