SAP HTTP_GET Function Module for HTTP Get
HTTP_GET is a standard http get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for HTTP Get processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for http get FM, simply by entering the name HTTP_GET into the relevant SAP transaction such as SE37 or SE38.
Function Group: SFTP
Program Name: SAPLSFTP
Main Program: SAPLSFTP
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function HTTP_GET pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'HTTP_GET'"HTTP Get.
EXPORTING
ABSOLUTE_URI = "
* TIMEOUT = "
* REQUEST_ENTITY_BODY_LENGTH = "
* RFC_DESTINATION = "RFC Destination
* PROXY = "
* PROXY_USER = "
* PROXY_PASSWORD = "
* USER = "
* PASSWORD = "
* BLANKSTOCRLF = "
IMPORTING
STATUS_CODE = "
STATUS_TEXT = "Text for status code
RESPONSE_ENTITY_BODY_LENGTH = "
TABLES
* REQUEST_ENTITY_BODY = "
* RESPONSE_ENTITY_BODY = "
RESPONSE_HEADERS = "
* REQUEST_HEADERS = "
EXCEPTIONS
CONNECT_FAILED = 1 TIMEOUT = 2 INTERNAL_ERROR = 3 TCPIP_ERROR = 4 DATA_ERROR = 5 SYSTEM_FAILURE = 6 COMMUNICATION_FAILURE = 7
IMPORTING Parameters details for HTTP_GET
ABSOLUTE_URI -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
TIMEOUT -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
REQUEST_ENTITY_BODY_LENGTH -
Data type: IOptional: Yes
Call by Reference: No ( called with pass by value option)
RFC_DESTINATION - RFC Destination
Data type: RFCDES-RFCDESTOptional: Yes
Call by Reference: No ( called with pass by value option)
PROXY -
Data type: THTTP-PROXYOptional: Yes
Call by Reference: No ( called with pass by value option)
PROXY_USER -
Data type: THTTP-PUSEROptional: Yes
Call by Reference: No ( called with pass by value option)
PROXY_PASSWORD -
Data type: THTTP-PPASSWORDOptional: Yes
Call by Reference: No ( called with pass by value option)
USER -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
PASSWORD -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
BLANKSTOCRLF -
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for HTTP_GET
STATUS_CODE -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
STATUS_TEXT - Text for status code
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
RESPONSE_ENTITY_BODY_LENGTH -
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for HTTP_GET
REQUEST_ENTITY_BODY -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
RESPONSE_ENTITY_BODY -
Data type:Optional: Yes
Call by Reference: Yes
RESPONSE_HEADERS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
REQUEST_HEADERS -
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
CONNECT_FAILED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TIMEOUT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TCPIP_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DATA_ERROR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SYSTEM_FAILURE -
Data type:Optional: No
Call by Reference: Yes
COMMUNICATION_FAILURE -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for HTTP_GET Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.| DATA: | ||||
| lv_status_code | TYPE C, " | |||
| lv_absolute_uri | TYPE C, " | |||
| lv_connect_failed | TYPE C, " | |||
| lt_request_entity_body | TYPE STANDARD TABLE OF C, " | |||
| lv_timeout | TYPE I, " | |||
| lv_timeout | TYPE I, " | |||
| lv_status_text | TYPE C, " | |||
| lt_response_entity_body | TYPE STANDARD TABLE OF C, " | |||
| lv_request_entity_body_length | TYPE I, " | |||
| lv_internal_error | TYPE I, " | |||
| lv_rfc_destination | TYPE RFCDES-RFCDEST, " | |||
| lt_response_headers | TYPE STANDARD TABLE OF RFCDES, " | |||
| lv_response_entity_body_length | TYPE I, " | |||
| lv_proxy | TYPE THTTP-PROXY, " | |||
| lv_tcpip_error | TYPE THTTP, " | |||
| lt_request_headers | TYPE STANDARD TABLE OF THTTP, " | |||
| lv_data_error | TYPE THTTP, " | |||
| lv_proxy_user | TYPE THTTP-PUSER, " | |||
| lv_proxy_password | TYPE THTTP-PPASSWORD, " | |||
| lv_system_failure | TYPE THTTP, " | |||
| lv_user | TYPE C, " | |||
| lv_communication_failure | TYPE C, " | |||
| lv_password | TYPE C, " | |||
| lv_blankstocrlf | TYPE C. " |
|   CALL FUNCTION 'HTTP_GET' "HTTP Get |
| EXPORTING | ||
| ABSOLUTE_URI | = lv_absolute_uri | |
| TIMEOUT | = lv_timeout | |
| REQUEST_ENTITY_BODY_LENGTH | = lv_request_entity_body_length | |
| RFC_DESTINATION | = lv_rfc_destination | |
| PROXY | = lv_proxy | |
| PROXY_USER | = lv_proxy_user | |
| PROXY_PASSWORD | = lv_proxy_password | |
| USER | = lv_user | |
| PASSWORD | = lv_password | |
| BLANKSTOCRLF | = lv_blankstocrlf | |
| IMPORTING | ||
| STATUS_CODE | = lv_status_code | |
| STATUS_TEXT | = lv_status_text | |
| RESPONSE_ENTITY_BODY_LENGTH | = lv_response_entity_body_length | |
| TABLES | ||
| REQUEST_ENTITY_BODY | = lt_request_entity_body | |
| RESPONSE_ENTITY_BODY | = lt_response_entity_body | |
| RESPONSE_HEADERS | = lt_response_headers | |
| REQUEST_HEADERS | = lt_request_headers | |
| EXCEPTIONS | ||
| CONNECT_FAILED = 1 | ||
| TIMEOUT = 2 | ||
| INTERNAL_ERROR = 3 | ||
| TCPIP_ERROR = 4 | ||
| DATA_ERROR = 5 | ||
| SYSTEM_FAILURE = 6 | ||
| COMMUNICATION_FAILURE = 7 | ||
| . " HTTP_GET | ||
ABAP code using 7.40 inline data declarations to call FM HTTP_GET
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.| "SELECT single RFCDEST FROM RFCDES INTO @DATA(ld_rfc_destination). | ||||
| "SELECT single PROXY FROM THTTP INTO @DATA(ld_proxy). | ||||
| "SELECT single PUSER FROM THTTP INTO @DATA(ld_proxy_user). | ||||
| "SELECT single PPASSWORD FROM THTTP INTO @DATA(ld_proxy_password). | ||||
Search for further information about these or an SAP related objects