Entering content frameBackground documentation Interaction Model Locate the document in its SAP Library structure

In this section, the data and control flows for the client role are described using an illustration similar to that in section Interaktionsmodell.

When an ABAP application program in the SAP System sends a HTTP request to the Internet, the steps shown in the illustration are taken (see also the explanatory notes under the illustration).

This graphic is explained in the accompanying text

 

  1. An object in the class CL_HTTP_CLIENT is created. This object is referred to here as the client control block (similarly to the server control block). The structure is described under Interface IF_HTTP_CLIENT.

To do this, the method CL_HTTP_CLIENT=>CREATE and/or CL_HTTP_CLIENT=>CREATE_BY_DESTINATION is called. The ABAP application program that sends the request calls the method.

Note

Note that the activities in points 2, 3, 5, 7, 8 and 9 must also be triggered by the ABAP application program, that is, by calling the appropriate methods. The ABAP application program, therefore, uses the components of the class CL_HTTP_CLIENT so that it can process the request and response data.

  1. Filling the client control block you have created:
    the attribute
    REQUEST is filled with the required request data.
  2. The method SEND is called and the request is sent.
    The connection is opened and the request is converted to a HTTP data stream (serialized).
  3. The request is sent to the HTTP server in question via task handlers and the Internet Communication Manager.
  4. If the HTTP server requires authentication (for example, if the server is also an SAP System), the client must log on at this point.
    If the server is also an SAP System, the client logs on via an SAP logon popup. Otherwise, the client logs on via the HTTP standard popup. This query whether the SAP logon popup or the HTTP standard popup should be used is executed within the method
    RECEIVE (see 7).
  5. This authentication is carried out in dialog processes, not in batch processes.

  6. The HTTP server generates a response and sends it back.
  7. The method RECEIVE is called and the response data is read in and the attribute RESPONSE of the control block is filled.
  8. The data is processed or output by means of accessing the response attribute.
  9. Note It is also possible to transfer the output to the HTML control. In this case, the response is displayed as it would be in a browser.

  10. The method CLOSE is called and the connection is thus closed.

Example

The following ABAP Sample Program executes a HTTP request. The request is sent to the same SAP instance (as SAP Web Application Server can function as both server and client).

Leaving content frame