SAP HTTP2_GET_FILE Function Module for HTTP Get File









HTTP2_GET_FILE is a standard http2 get file 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 File 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 http2 get file FM, simply by entering the name HTTP2_GET_FILE into the relevant SAP transaction such as SE37 or SE38.

Function Group: SCMS_HTTP2
Program Name: SAPLSCMS_HTTP2
Main Program: SAPLSCMS_HTTP2
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function HTTP2_GET_FILE 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 'HTTP2_GET_FILE'"HTTP Get File
EXPORTING
ABSOLUTE_URI = "
* RFC_DESTINATION = 'SAPHTTP' "RFC Destination
* USER = "
* PASSWORD = "
DOCUMENT_PATH = "
* NO_LOGON = 'X' "
* TIMEOUT = "

IMPORTING
STATUS_CODE = "
STATUS_TEXT = "Text for status code

TABLES
* RESPONSE_HEADERS = "

EXCEPTIONS
CONNECT_FAILED = 1 TIMEOUT = 2 INTERNAL_ERROR = 3 DOCUMENT_ERROR = 4 TCPIP_ERROR = 5 SYSTEM_FAILURE = 6 COMMUNICATION_FAILURE = 7
.



IMPORTING Parameters details for HTTP2_GET_FILE

ABSOLUTE_URI -

Data type: C
Optional: No
Call by Reference: No ( called with pass by value option)

RFC_DESTINATION - RFC Destination

Data type: RFCDES-RFCDEST
Default: 'SAPHTTP'
Optional: Yes
Call by Reference: No ( called with pass by value option)

USER -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

PASSWORD -

Data type: C
Optional: Yes
Call by Reference: No ( called with pass by value option)

DOCUMENT_PATH -

Data type: C
Optional: No
Call by Reference: No ( called with pass by value option)

NO_LOGON -

Data type: C
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

TIMEOUT -

Data type: I
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for HTTP2_GET_FILE

STATUS_CODE -

Data type: C
Optional: No
Call by Reference: No ( called with pass by value option)

STATUS_TEXT - Text for status code

Data type: C
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for HTTP2_GET_FILE

RESPONSE_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)

DOCUMENT_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)

SYSTEM_FAILURE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

COMMUNICATION_FAILURE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for HTTP2_GET_FILE 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_response_headers  TYPE STANDARD TABLE OF C, "   
lv_timeout  TYPE C, "   
lv_status_text  TYPE C, "   
lv_rfc_destination  TYPE RFCDES-RFCDEST, "   'SAPHTTP'
lv_user  TYPE C, "   
lv_internal_error  TYPE C, "   
lv_password  TYPE C, "   
lv_document_error  TYPE C, "   
lv_tcpip_error  TYPE C, "   
lv_document_path  TYPE C, "   
lv_no_logon  TYPE C, "   'X'
lv_system_failure  TYPE C, "   
lv_timeout  TYPE I, "   
lv_communication_failure  TYPE I. "   

  CALL FUNCTION 'HTTP2_GET_FILE'  "HTTP Get File
    EXPORTING
         ABSOLUTE_URI = lv_absolute_uri
         RFC_DESTINATION = lv_rfc_destination
         USER = lv_user
         PASSWORD = lv_password
         DOCUMENT_PATH = lv_document_path
         NO_LOGON = lv_no_logon
         TIMEOUT = lv_timeout
    IMPORTING
         STATUS_CODE = lv_status_code
         STATUS_TEXT = lv_status_text
    TABLES
         RESPONSE_HEADERS = lt_response_headers
    EXCEPTIONS
        CONNECT_FAILED = 1
        TIMEOUT = 2
        INTERNAL_ERROR = 3
        DOCUMENT_ERROR = 4
        TCPIP_ERROR = 5
        SYSTEM_FAILURE = 6
        COMMUNICATION_FAILURE = 7
. " HTTP2_GET_FILE




ABAP code using 7.40 inline data declarations to call FM HTTP2_GET_FILE

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).
DATA(ld_rfc_destination) = 'SAPHTTP'.
 
 
 
 
 
 
 
DATA(ld_no_logon) = 'X'.
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!