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

Function FKK_DOCUMENT_READ 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 'FKK_DOCUMENT_READ'".
EXPORTING
* I_OPBEL = "Document Number
* I_AWTYP = "Reference Transaction
* I_AWKEY = "Reference Key
* I_XMBEL = "
* I_FKKDOCC = "Control Data
IMPORTING
E_FKKKO = "Document header
TABLES
* T_FKKOP = "Business Partner Items
* T_FKKOPK = "G/L Account Items
* T_FKKOPW = "Repetition Items
EXCEPTIONS
DOCUMENT_NOT_FOUND = 1 INVALID_INPUT_PARAMETERS = 2 SEVERAL_DOCUMENTS_FOUND = 3
IMPORTING Parameters details for FKK_DOCUMENT_READ
I_OPBEL - Document Number
Data type: FKKKO-OPBELOptional: Yes
Call by Reference: No ( called with pass by value option)
I_AWTYP - Reference Transaction
Data type: FKKKO-AWTYPOptional: Yes
Call by Reference: No ( called with pass by value option)
I_AWKEY - Reference Key
Data type: FKKKO-AWKEYOptional: Yes
Call by Reference: No ( called with pass by value option)
I_XMBEL -
Data type: FKKKO-XMBELOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FKKDOCC - Control Data
Data type: FKKDOCCOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for FKK_DOCUMENT_READ
E_FKKKO - Document header
Data type: FKKKOOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for FKK_DOCUMENT_READ
T_FKKOP - Business Partner Items
Data type: FKKOPOptional: Yes
Call by Reference: No ( called with pass by value option)
T_FKKOPK - G/L Account Items
Data type: FKKOPKOptional: Yes
Call by Reference: No ( called with pass by value option)
T_FKKOPW - Repetition Items
Data type: FKKOPWOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
DOCUMENT_NOT_FOUND - Document not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INVALID_INPUT_PARAMETERS -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SEVERAL_DOCUMENTS_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for FKK_DOCUMENT_READ 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_fkkko | TYPE FKKKO, " | |||
| lv_i_opbel | TYPE FKKKO-OPBEL, " | |||
| lt_t_fkkop | TYPE STANDARD TABLE OF FKKOP, " | |||
| lv_document_not_found | TYPE FKKOP, " | |||
| lv_i_awtyp | TYPE FKKKO-AWTYP, " | |||
| lt_t_fkkopk | TYPE STANDARD TABLE OF FKKOPK, " | |||
| lv_invalid_input_parameters | TYPE FKKOPK, " | |||
| lv_i_awkey | TYPE FKKKO-AWKEY, " | |||
| lt_t_fkkopw | TYPE STANDARD TABLE OF FKKOPW, " | |||
| lv_several_documents_found | TYPE FKKOPW, " | |||
| lv_i_xmbel | TYPE FKKKO-XMBEL, " | |||
| lv_i_fkkdocc | TYPE FKKDOCC. " |
|   CALL FUNCTION 'FKK_DOCUMENT_READ' " |
| EXPORTING | ||
| I_OPBEL | = lv_i_opbel | |
| I_AWTYP | = lv_i_awtyp | |
| I_AWKEY | = lv_i_awkey | |
| I_XMBEL | = lv_i_xmbel | |
| I_FKKDOCC | = lv_i_fkkdocc | |
| IMPORTING | ||
| E_FKKKO | = lv_e_fkkko | |
| TABLES | ||
| T_FKKOP | = lt_t_fkkop | |
| T_FKKOPK | = lt_t_fkkopk | |
| T_FKKOPW | = lt_t_fkkopw | |
| EXCEPTIONS | ||
| DOCUMENT_NOT_FOUND = 1 | ||
| INVALID_INPUT_PARAMETERS = 2 | ||
| SEVERAL_DOCUMENTS_FOUND = 3 | ||
| . " FKK_DOCUMENT_READ | ||
ABAP code using 7.40 inline data declarations to call FM FKK_DOCUMENT_READ
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 OPBEL FROM FKKKO INTO @DATA(ld_i_opbel). | ||||
| "SELECT single AWTYP FROM FKKKO INTO @DATA(ld_i_awtyp). | ||||
| "SELECT single AWKEY FROM FKKKO INTO @DATA(ld_i_awkey). | ||||
| "SELECT single XMBEL FROM FKKKO INTO @DATA(ld_i_xmbel). | ||||
Search for further information about these or an SAP related objects