SAP BAPI_GLX_GETDOCITEMS Function Module for Line Item of Document for Ledger with Totals Table FAGLFLEXT
BAPI_GLX_GETDOCITEMS is a standard bapi glx getdocitems SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Line Item of Document for Ledger with Totals Table FAGLFLEXT 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 bapi glx getdocitems FM, simply by entering the name BAPI_GLX_GETDOCITEMS into the relevant SAP transaction such as SE37 or SE38.
Function Group: 1028
Program Name: SAPL1028
Main Program: SAPL1028
Appliation area: G
Release date: 19-May-1998
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_GLX_GETDOCITEMS 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 'BAPI_GLX_GETDOCITEMS'"Line Item of Document for Ledger with Totals Table FAGLFLEXT.
EXPORTING
LEDGER = "Ledger
COMPANYCODE = "Company code
FISCALYEAR = "Fiscal year
DOCNUMBERFROM = "From document number
* DOCNUMBERTO = "To document number
* DOCUMENTTYPE = "Document Type
IMPORTING
RETURN = "Return code
TABLES
ITEMSLIST = "Line items for documents (without customer fields)
* EXTENSION1 = "Addition to ITEMSLIST (for customer fields)
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPL1028_001 Exit for BAPI_GLX_GetDocItems
IMPORTING Parameters details for BAPI_GLX_GETDOCITEMS
LEDGER - Ledger
Data type: BAPI1028_11-LEDGEROptional: No
Call by Reference: No ( called with pass by value option)
COMPANYCODE - Company code
Data type: BAPI1028_11-COMP_CODEOptional: No
Call by Reference: No ( called with pass by value option)
FISCALYEAR - Fiscal year
Data type: BAPI1028_11-FISC_YEAROptional: No
Call by Reference: No ( called with pass by value option)
DOCNUMBERFROM - From document number
Data type: BAPI1028_11-DOC_FROMNOOptional: No
Call by Reference: No ( called with pass by value option)
DOCNUMBERTO - To document number
Data type: BAPI1028_11-DOC_TONOOptional: Yes
Call by Reference: No ( called with pass by value option)
DOCUMENTTYPE - Document Type
Data type: BAPI1028_11-TYPEOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_GLX_GETDOCITEMS
RETURN - Return code
Data type: BAPIRET2Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_GLX_GETDOCITEMS
ITEMSLIST - Line items for documents (without customer fields)
Data type: BAPI1028_12Optional: No
Call by Reference: No ( called with pass by value option)
EXTENSION1 - Addition to ITEMSLIST (for customer fields)
Data type: BAPI1028EXT_1Optional: Yes
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_GLX_GETDOCITEMS 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_ledger | TYPE BAPI1028_11-LEDGER, " | |||
| lv_return | TYPE BAPIRET2, " | |||
| lt_itemslist | TYPE STANDARD TABLE OF BAPI1028_12, " | |||
| lt_extension1 | TYPE STANDARD TABLE OF BAPI1028EXT_1, " | |||
| lv_companycode | TYPE BAPI1028_11-COMP_CODE, " | |||
| lv_fiscalyear | TYPE BAPI1028_11-FISC_YEAR, " | |||
| lv_docnumberfrom | TYPE BAPI1028_11-DOC_FROMNO, " | |||
| lv_docnumberto | TYPE BAPI1028_11-DOC_TONO, " | |||
| lv_documenttype | TYPE BAPI1028_11-TYPE. " |
|   CALL FUNCTION 'BAPI_GLX_GETDOCITEMS' "Line Item of Document for Ledger with Totals Table FAGLFLEXT |
| EXPORTING | ||
| LEDGER | = lv_ledger | |
| COMPANYCODE | = lv_companycode | |
| FISCALYEAR | = lv_fiscalyear | |
| DOCNUMBERFROM | = lv_docnumberfrom | |
| DOCNUMBERTO | = lv_docnumberto | |
| DOCUMENTTYPE | = lv_documenttype | |
| IMPORTING | ||
| RETURN | = lv_return | |
| TABLES | ||
| ITEMSLIST | = lt_itemslist | |
| EXTENSION1 | = lt_extension1 | |
| . " BAPI_GLX_GETDOCITEMS | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_GLX_GETDOCITEMS
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 LEDGER FROM BAPI1028_11 INTO @DATA(ld_ledger). | ||||
| "SELECT single COMP_CODE FROM BAPI1028_11 INTO @DATA(ld_companycode). | ||||
| "SELECT single FISC_YEAR FROM BAPI1028_11 INTO @DATA(ld_fiscalyear). | ||||
| "SELECT single DOC_FROMNO FROM BAPI1028_11 INTO @DATA(ld_docnumberfrom). | ||||
| "SELECT single DOC_TONO FROM BAPI1028_11 INTO @DATA(ld_docnumberto). | ||||
| "SELECT single TYPE FROM BAPI1028_11 INTO @DATA(ld_documenttype). | ||||
Search for further information about these or an SAP related objects