Customize HTTP requests to Amazon - Amazon SDK for SAP ABAP
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Customize HTTP requests to Amazon

The Amazon SDK for SAP ABAP handles the process of creating an HTTP request, sending a payload, and receiving a response. You can customize the behavior or content of the HTTP request to meet your own IT requirements. The SDK defines enhancement spot /AWS1/RT_EHN_HTTP_CLIENT as a central place to enhance the HTTP communication. The enhancement spot supports adding HTTP headers to the request made to Amazon.

Implement an enhancement

SAP provides the following instructions for implementing an enhancement spot:

Filter the enhancement

The enhancement spot supports multiple implementations that can be active simultaneously. You can filter the execution of the BAdi based on the following attributes, if you need to ensure that your enhancement runs only on calls to a specific Amazon service or API action:

  • TLA - The three-letter abbreviation of the service, in uppercase letters.

  • OPERATION - The API action name. For example, the operation to get an object from an S3 bucket is GetObject. The action name is case-sensitive and might not exactly match the ABAP method name.

Code the enhancement

The enhancement provides the following method.

MODIFY_REQ_HEADERS

CHANGING CT_HEADERS TYPE /AWS1/RT_STRINGMAP_TT

You can append and modify headers in the CT_HEADERS internal table. We do not recommend modifying headers, as this alters data that the Amazon service uses. Any headers that you add are ignored by the Amazon service, but can be processed by your IT infrastructure, such as proxy servers or other middleware.

The enhancement spot is called before the calculation of authentication and telemetry headers, so these can't be modified by the enhancement.

The following is an example implementation.

METHOD /aws1/if_rt_badi_http_client~modify_req_headers. APPEND VALUE /aws1/rt_stringpair_ts( name = 'x-test-example' value = 'value' ) TO ct_headers. ENDMETHOD.