SAP GET_DOCUMENTS Function Module for
GET_DOCUMENTS is a standard get documents 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 get documents FM, simply by entering the name GET_DOCUMENTS into the relevant SAP transaction such as SE37 or SE38.
Function Group: F110
Program Name: SAPLF110
Main Program: SAPLF110
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function GET_DOCUMENTS 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 'GET_DOCUMENTS'".
EXPORTING
* I_BELEGE = 'X' "With ' ' no reading documents
I_REFNO = "Reference number for finding documents
* I_REGUT = 'X' "With ' ' no reading REGUT data
* I_UBHKT = ' ' "
* I_VALIDATE_DOC = ' ' "
IMPORTING
E_REGUT = "Structure for REGUT data for I_REFNO
TABLES
* TAB_BELEGE = "Table of read documents
EXCEPTIONS
NO_DOCUMENTS = 1 NO_REGUT = 2 WRONG_NUMBER = 3 MISSING_UBHKT = 4
IMPORTING Parameters details for GET_DOCUMENTS
I_BELEGE - With ' ' no reading documents
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_REFNO - Reference number for finding documents
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
I_REGUT - With ' ' no reading REGUT data
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_UBHKT -
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_VALIDATE_DOC -
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for GET_DOCUMENTS
E_REGUT - Structure for REGUT data for I_REFNO
Data type: REGUTOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for GET_DOCUMENTS
TAB_BELEGE - Table of read documents
Data type: DTA_BELEGEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_DOCUMENTS - No documents for Ref-Nummer I_REFNO
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_REGUT - No REGUT data for Ref-Nummer I_REFNO
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_NUMBER - Transferred value is not a ref-number
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
MISSING_UBHKT -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for GET_DOCUMENTS 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_e_regut | TYPE REGUT, " | |||
| lv_i_belege | TYPE REGUT, " 'X' | |||
| lt_tab_belege | TYPE STANDARD TABLE OF DTA_BELEGE, " | |||
| lv_no_documents | TYPE DTA_BELEGE, " | |||
| lv_i_refno | TYPE DTA_BELEGE, " | |||
| lv_no_regut | TYPE DTA_BELEGE, " | |||
| lv_i_regut | TYPE DTA_BELEGE, " 'X' | |||
| lv_wrong_number | TYPE DTA_BELEGE, " | |||
| lv_i_ubhkt | TYPE DTA_BELEGE, " ' ' | |||
| lv_missing_ubhkt | TYPE DTA_BELEGE, " | |||
| lv_i_validate_doc | TYPE DTA_BELEGE. " ' ' |
|   CALL FUNCTION 'GET_DOCUMENTS' " |
| EXPORTING | ||
| I_BELEGE | = lv_i_belege | |
| I_REFNO | = lv_i_refno | |
| I_REGUT | = lv_i_regut | |
| I_UBHKT | = lv_i_ubhkt | |
| I_VALIDATE_DOC | = lv_i_validate_doc | |
| IMPORTING | ||
| E_REGUT | = lv_e_regut | |
| TABLES | ||
| TAB_BELEGE | = lt_tab_belege | |
| EXCEPTIONS | ||
| NO_DOCUMENTS = 1 | ||
| NO_REGUT = 2 | ||
| WRONG_NUMBER = 3 | ||
| MISSING_UBHKT = 4 | ||
| . " GET_DOCUMENTS | ||
ABAP code using 7.40 inline data declarations to call FM GET_DOCUMENTS
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.| DATA(ld_i_belege) | = 'X'. | |||
| DATA(ld_i_regut) | = 'X'. | |||
| DATA(ld_i_ubhkt) | = ' '. | |||
| DATA(ld_i_validate_doc) | = ' '. | |||
Search for further information about these or an SAP related objects