<?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: Call API on Presentation Server using CL_HTTP_CLIENT in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13738154#M2028652</link>
    <description>&lt;P&gt;In this articular scenario, the calls are made only from an end-user session (logged on life with SAPGUI). So there should be no collision possible here: if two end-users log on at the same time, one instance of the executable will be started on notebook A and the other one on notebook B, and they should not interfere.&lt;/P&gt;&lt;P&gt;(Only possibility is, if the same user opens two SAPGUI sessions on his notebook/desktop, and starts a call in both of them. And if this is a problem for the USB device, then what I said in the previous post applies: the executable needs to use an operating system level semaphore to protect the USB device against simultaneous access from two processes. The RFC protocol does not have any such protection mechanism and will happily execute both calls in parallel.)&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2024 15:50:43 GMT</pubDate>
    <dc:creator>Ulrich_Schmidt1</dc:creator>
    <dc:date>2024-06-20T15:50:43Z</dc:date>
    <item>
      <title>Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13736257#M2028608</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Is there the possibility of consuming an API exposed on my local machine (Presentation Server) using the CL_HTTP_CLIENT class (or another method if it exists)?&lt;BR /&gt;SAP is accessed using SAP Gui, and the connection can be made with SAP Router or not. Due to this, there is a possibility that my machine is not on the same network that Application Server, which I imagine rules out the possibility of direct access via IP.&lt;BR /&gt;The exposed API communicates with local devices (USB), which makes it impossible for the API to be placed on a server.&lt;BR /&gt;Each user will access SAP from their own machine, and the API will be exposed on each of them.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Miguel Motta&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 12:08:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13736257#M2028608</guid>
      <dc:creator>miguel_motta</dc:creator>
      <dc:date>2024-06-19T12:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13736274#M2028610</link>
      <description>&lt;P&gt;&lt;STRONG&gt;EDIT: I didn't test what I proposed, so it was just a guess&lt;/STRONG&gt;.&amp;nbsp;See the comment by&amp;nbsp;&lt;a href="https://community.sap.com/t5/user/viewprofilepage/user-id/15899"&gt;@Ulrich_Schmidt1&lt;/a&gt;&amp;nbsp;below about the restriction of CL_HTTP_CLIENT=&amp;gt;CREATE_BY_DESTINATION to work only with RFC destinations of type G/H.&lt;/P&gt;&lt;P&gt;Via CL_HTTP_CLIENT, if you use the RFC connection "SAPHTTP", it will access the Web through the HTTP interface on the user's laptop (through the SAP GUI "saphttp" program), as opposed to "SAPHTTPA" which corresponds to the HTTP interface on the ABAP server.&lt;/P&gt;&lt;P&gt;RFC connection "SAPHTTP" (SM59):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sandra_Rossi_1-1718799769686.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/125630i8130107005A04379/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sandra_Rossi_1-1718799769686.png" alt="Sandra_Rossi_1-1718799769686.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;SAPHTTPA:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sandra_Rossi_2-1718799888475.png" style="width: 400px;"&gt;&lt;img src="https://community.sap.com/t5/image/serverpage/image-id/125631iDFAB174F0920E39D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sandra_Rossi_2-1718799888475.png" alt="Sandra_Rossi_2-1718799888475.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 12:02:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13736274#M2028610</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-06-20T12:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13736455#M2028616</link>
      <description>&lt;P&gt;Thanks Rossi!&lt;/P&gt;&lt;P&gt;I hadn't thought about this possibility.&lt;/P&gt;&lt;P&gt;I have already used these RFCs with the HTTP_GET and HTTP_POST functions, but never with the CL_HTTP_CLIENT class.&lt;BR /&gt;I was a little confused on how I can create the object pointing to the SAPHTTP RFC (create_by_destination?) and set the API service URL.&lt;BR /&gt;Can you help me?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 14:23:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13736455#M2028616</guid>
      <dc:creator>miguel_motta</dc:creator>
      <dc:date>2024-06-19T14:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13736670#M2028619</link>
      <description>&lt;P&gt;&lt;SPAN&gt;create_by_destination&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;EDIT about indicating an exact URL via create_by_destination (you may find the answer in the forum too): the URL given in the RFC destination is only the root URL (so it can be empty = domain root), you may append any URL to it via either cl_http_utility=&amp;gt;SET_REQUEST_URI or set_header_field of pseudo header field&amp;nbsp;~request_uri.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 05:32:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13736670#M2028619</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-06-20T05:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737096#M2028628</link>
      <description>&lt;P&gt;CL_HTTP_CLIENT is a HTTP client. If you want to consume an API on the client computer via CL_HTTP_CLIENT you need a webserver there which is accessing the API.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 07:32:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737096#M2028628</guid>
      <dc:creator>thomas_mller13</dc:creator>
      <dc:date>2024-06-20T07:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737166#M2028629</link>
      <description>&lt;P&gt;Can destination SAPHTTP be accessed via CL_HTTP_CLIENT? I always thought, CL_HTTP_CLIENT communicates through HTTP-destinations of type G and H, but SAPHTTP is an RFC-destination (type T), which needs to be accessed via CALL FUNCTION. (The RFC call transfers the URL and other parameters to the saphttp.exe executable, which then makes the HTTP request.)&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 07:29:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737166#M2028629</guid>
      <dc:creator>Ulrich_Schmidt1</dc:creator>
      <dc:date>2024-06-20T07:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737237#M2028632</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;(or another method if it exists)?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Another option might be the following: as you are accessing a hardware connected to an USB slot, you have probably written a C/C++ component that accesses the USB device via the driver provided by the hardware vendor?&lt;/P&gt;&lt;P&gt;In that case, why not call the C/C++ component directly from ABAP (without detour via HTTP Client &amp;amp; HTTP Server on the frontend)? This is actually not so difficult. Basic outline:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create an SM59 destination of type T with "start on frontend", similar to how the SAPHTTP destination looks like, but instead of "saphttp.exe" you enter your own executable name.&lt;/LI&gt;&lt;LI&gt;Put the functionality, which access the USB device driver, into an executable and link it with the NW RFC Library (sapnwrfc.dll).&lt;/LI&gt;&lt;LI&gt;In order to be invocable from ABAP, that executable needs to fulfill two prerequisites:&lt;BR /&gt;- From main(), it needs to call the function RfcStartServer(), passing in the command line parameters it receives when being started. (SAPGUI will start the executable as a child process, passing in the details&amp;nbsp;necessary for connecting to the current ABAP user session.)&lt;BR /&gt;- It needs to define and implement the interface of one (or more) remote-enabled function module.&lt;BR /&gt;The details for this are described in the NW RFC SDK Programming Guide, chapter 5 (in particular section 5.3), which can be downloaded from &lt;A href="https://support.sap.com/nwrfcsdk" target="_blank" rel="noopener"&gt;https://support.sap.com/nwrfcsdk&lt;/A&gt;&lt;BR /&gt;The interface would define the inputs that the USB device needs and the outputs returned by the USB device. Can be simple strings, ints or floats, or even tables or binary blobs.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Then you would need to install that executable on the end-user frontends, for example together with the device driver DLL (which is needed in any case), and then your ABAP program on the Application Server can access the end-user's USB device with a simple&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;DATA: error_detail(120).

CALL FUNCTION 'MY_FUNCTION' DESTINATION 'DEST_FROM_STEP1'
  EXPORTING
    "...inputs needed by USB device
  IMPORTING
    "...results from USB device
  TABLES
    "...if any
  EXCEPTIONS
    SYSTEM_FAILURE = 1 MESSAGE error_detail
    COMMUNICATION_FAILURE = 2 MESSAGE error_detail.

IF sy-subrc EQ 1.
  "e.g. USB device not plugged in etc.
ELSEIF sy-subrc EQ 2.
  "network connection between app server and frontend broke down
ENDIF.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 08:12:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737237#M2028632</guid>
      <dc:creator>Ulrich_Schmidt1</dc:creator>
      <dc:date>2024-06-20T08:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737246#M2028633</link>
      <description>&lt;P&gt;What happens if you run that call several times in parallel?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 08:12:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737246#M2028633</guid>
      <dc:creator>thomas_mller13</dc:creator>
      <dc:date>2024-06-20T08:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737326#M2028635</link>
      <description>&lt;P&gt;That depends on your executable: every locking/synchronization that the USB device might need, needs to be implemented in the executable (e.g. using OS level semaphores etc.).&lt;/P&gt;&lt;P&gt;But I think it is very hard to run the call several times in parallel from within the same user session (SAPGUI session). You would need to use the ABAP parallelization mechanism via "STARTING NEW TASK" etc.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 08:37:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737326#M2028635</guid>
      <dc:creator>Ulrich_Schmidt1</dc:creator>
      <dc:date>2024-06-20T08:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737332#M2028636</link>
      <description>&lt;P&gt;I just checked with the developer: destination SAPHTTP can &lt;STRONG&gt;&lt;EM&gt;not&lt;/EM&gt; &lt;/STRONG&gt;be used with CL_HTTP_CLIENT. One needs to access it via CALL FUNCTION to certain function modules.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 08:40:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737332#M2028636</guid>
      <dc:creator>Ulrich_Schmidt1</dc:creator>
      <dc:date>2024-06-20T08:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737605#M2028640</link>
      <description>&lt;P&gt;Hi Schmidt,&lt;/P&gt;&lt;P&gt;Accessing the service via calls to DLL functions is an option and I will analyze whether it is the best way. The DLLs already exist and perhaps this is the shortest way.&lt;BR /&gt;Alternatively, I can use the HTTP_POST function with the SAPHTTP RFC, since all API services in question work with the POST method. In this case, I will only need to configure SSL.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I am very grateful for the attention and clarifications of all my colleagues.&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 11:45:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737605#M2028640</guid>
      <dc:creator>miguel_motta</dc:creator>
      <dc:date>2024-06-20T11:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737608#M2028641</link>
      <description>&lt;P&gt;Such tasks are typically done in batch. In this case collisions happen very often. The question is: what happens if 2 or more RFC clients use the same destination? Even if they start a new instance of server program.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 12:54:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737608#M2028641</guid>
      <dc:creator>thomas_mller13</dc:creator>
      <dc:date>2024-06-20T12:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737629#M2028643</link>
      <description>&lt;P&gt;Good point, I didn't test. Answer edited.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 12:00:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13737629#M2028643</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2024-06-20T12:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Call API on Presentation Server using CL_HTTP_CLIENT</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13738154#M2028652</link>
      <description>&lt;P&gt;In this articular scenario, the calls are made only from an end-user session (logged on life with SAPGUI). So there should be no collision possible here: if two end-users log on at the same time, one instance of the executable will be started on notebook A and the other one on notebook B, and they should not interfere.&lt;/P&gt;&lt;P&gt;(Only possibility is, if the same user opens two SAPGUI sessions on his notebook/desktop, and starts a call in both of them. And if this is a problem for the USB device, then what I said in the previous post applies: the executable needs to use an operating system level semaphore to protect the USB device against simultaneous access from two processes. The RFC protocol does not have any such protection mechanism and will happily execute both calls in parallel.)&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 15:50:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-api-on-presentation-server-using-cl-http-client/m-p/13738154#M2028652</guid>
      <dc:creator>Ulrich_Schmidt1</dc:creator>
      <dc:date>2024-06-20T15:50:43Z</dc:date>
    </item>
  </channel>
</rss>

