SAP HTTP_POST_DOCUMENT Function Module for









HTTP_POST_DOCUMENT is a standard http post document SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 post document FM, simply by entering the name HTTP_POST_DOCUMENT 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_POST_DOCUMENT 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_POST_DOCUMENT'"
EXPORTING
ABSOLUTE_URI = "
* 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
COMPONENTS = "
COMPONENT_DATA = "
* REQUEST_HEADERS = "
* RESPONSE_HEADERS = "
* RESPONSE_ENTITY_BODY = "

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



IMPORTING Parameters details for HTTP_POST_DOCUMENT

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
Optional: Yes
Call by Reference: No ( called with pass by value option)

PROXY -

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

PROXY_USER -

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

PROXY_PASSWORD -

Data type: THTTP-PPASSWORD
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)

BLANKSTOCRLF -

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

EXPORTING Parameters details for HTTP_POST_DOCUMENT

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)

RESPONSE_ENTITY_BODY_LENGTH -

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

TABLES Parameters details for HTTP_POST_DOCUMENT

COMPONENTS -

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

COMPONENT_DATA -

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)

RESPONSE_HEADERS -

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

RESPONSE_ENTITY_BODY -

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)

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_POST_DOCUMENT 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:
lt_components  TYPE STANDARD TABLE OF HTTP_COMP, "   
lv_status_code  TYPE C, "   
lv_absolute_uri  TYPE C, "   
lv_connect_failed  TYPE C, "   
lv_timeout  TYPE C, "   
lv_status_text  TYPE C, "   
lt_component_data  TYPE STANDARD TABLE OF C, "   
lv_rfc_destination  TYPE RFCDES-RFCDEST, "   
lv_proxy  TYPE THTTP-PROXY, "   
lv_internal_error  TYPE THTTP, "   
lt_request_headers  TYPE STANDARD TABLE OF THTTP, "   
lv_response_entity_body_length  TYPE I, "   
lv_proxy_user  TYPE THTTP-PUSER, "   
lv_tcpip_error  TYPE THTTP, "   
lt_response_headers  TYPE STANDARD TABLE OF THTTP, "   
lv_proxy_password  TYPE THTTP-PPASSWORD, "   
lv_system_failure  TYPE THTTP, "   
lt_response_entity_body  TYPE STANDARD TABLE OF THTTP, "   
lv_user  TYPE C, "   
lv_communication_failure  TYPE C, "   
lv_password  TYPE C, "   
lv_blankstocrlf  TYPE C. "   

  CALL FUNCTION 'HTTP_POST_DOCUMENT'  "
    EXPORTING
         ABSOLUTE_URI = lv_absolute_uri
         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
         COMPONENTS = lt_components
         COMPONENT_DATA = lt_component_data
         REQUEST_HEADERS = lt_request_headers
         RESPONSE_HEADERS = lt_response_headers
         RESPONSE_ENTITY_BODY = lt_response_entity_body
    EXCEPTIONS
        CONNECT_FAILED = 1
        TIMEOUT = 2
        INTERNAL_ERROR = 3
        TCPIP_ERROR = 4
        SYSTEM_FAILURE = 5
        COMMUNICATION_FAILURE = 6
. " HTTP_POST_DOCUMENT




ABAP code using 7.40 inline data declarations to call FM HTTP_POST_DOCUMENT

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



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!