Show TOC

Submitting a RequestLocate this document in the navigation structure

When you build your request object as described in Building an OData Request, it is not sent automatically to the collaboration platform. Therefore, you need to call the submit method for the request object to send the request.

The submit method has the following parameters:

Method Description
iv_http_method

(optional)

This parameter represents the HTTP method for the request (POST, GET, PUT, PATCH, DELETE). The default value is GET.
iv_access_operation

(obsolete, optional)

This parameter represents the access method for the request (CREATE, READ, UPDATE, DELETE). Its value is mapped to a corresponding HTTP method (POST, GET, PATCH, DELETE). Since this parameter is obsolete, use the iv_http_method parameter instead.
it_header

(optional)

This parameter represents the header fields for the request. The type of this parameter is a table of name/value string pairs.
io_entity

(optional)

This parameter represents the request body in the form of an input entity object. The input object is transformed into an XML representation and put into the request body. You typically define a request body for POST or PUT/PATCH requests.
iv_content

(optional)

This parameter represents the request body in the form of an xstring. You typically define a request body for POST or PUT/PATCH requests..
iv_read_from_buffer

(optional)

  • If this parameter is abap_true, the submit method first checks an internal buffer for the requested object prior to calling the service provider.
  • If this parameter is abap_false, the call is sent directly to the service provider without checking the buffer.
Caution
  • For the obsolete iv_access_operation parameter, use the iv_http_method parameter instead. If you supply both parameters, the submit method raises an CX_ODL_PROCESS_DYNAMIC exception since you cannot define more than one HTTP method for a request.
  • Do not use both the io_entity and iv_content parameters. If you supply both parameters, the submit method raises a CX_ODL_PROCESS_DYNAMIC exception since you cannot define more than one request body
Note The submit method does not fetch and evaluate the result of the call. This only happens when you collect the result by calling one of the methods described in Collecting the Results. The separation of sending and synchronizing enables asynchronous execution. For more information, see Asynchronous Execution.
Examples

Here are some examples of how to submit a request. We assume that your request is assigned to the variable lo_request.

  • Submit a GET request

    lo_request->submit( ).
  • Submit a DELETE request

    lo_request->submit(
      iv_http_method = if_clb2_constants=>gc_request_method-delete
    ).					
  • Submit a PATCH request with an lo_input_entity entity in the request body

    lo_request->submit(
      iv_http_method = if_clb2_constants=>gc_request_method-patch
      io_entity = lo_input_entity
    ).					
  • Submit a POST request with an lv_xstring xstring request body and an lt_header header field table

    lo_request->submit(
      iv_http_method = if_clb2_constants=>gc_request_method-post
      iv_content = lt_content
      it_header = lt_header
    ).