SAP Function Modules

BAPI_GLX_GETDOCITEMS SAP Function module - Line Item of Document for Ledger with Totals Table FAGLFLEXT







BAPI_GLX_GETDOCITEMS is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BAPI_GLX_GETDOCITEMS into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: 1028
Released Date: 19.05.1998
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_GLX_GETDOCITEMS - BAPI GLX GETDOCITEMS





CALL FUNCTION 'BAPI_GLX_GETDOCITEMS' "Line Item of Document for Ledger with Totals Table FAGLFLEXT
  EXPORTING
    ledger =                    " bapi1028_11-ledger  Ledger
    companycode =               " bapi1028_11-comp_code  Company code
    fiscalyear =                " bapi1028_11-fisc_year  Fiscal year
    docnumberfrom =             " bapi1028_11-doc_fromno  From document number
*   docnumberto =               " bapi1028_11-doc_tono  To document number
*   documenttype =              " bapi1028_11-type  Document Type
  IMPORTING
    return =                    " bapiret2      Return code
  TABLES
    itemslist =                 " bapi1028_12   Line items for documents (without customer fields)
*   extension1 =                " bapi1028ext_1  Addition to ITEMSLIST (for customer fields)
    .  "  BAPI_GLX_GETDOCITEMS

ABAP code example for Function Module BAPI_GLX_GETDOCITEMS





The ABAP code below is a full code listing to execute function module BAPI_GLX_GETDOCITEMS including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_return  TYPE BAPIRET2 ,
it_itemslist  TYPE STANDARD TABLE OF BAPI1028_12,"TABLES PARAM
wa_itemslist  LIKE LINE OF it_itemslist ,
it_extension1  TYPE STANDARD TABLE OF BAPI1028EXT_1,"TABLES PARAM
wa_extension1  LIKE LINE OF it_extension1 .


DATA(ld_ledger) = some text here

DATA(ld_companycode) = some text here

DATA(ld_fiscalyear) = Check type of data required

DATA(ld_docnumberfrom) = some text here

DATA(ld_docnumberto) = some text here

DATA(ld_documenttype) = some text here

"populate fields of struture and append to itab
append wa_itemslist to it_itemslist.

"populate fields of struture and append to itab
append wa_extension1 to it_extension1. . CALL FUNCTION 'BAPI_GLX_GETDOCITEMS' EXPORTING ledger = ld_ledger companycode = ld_companycode fiscalyear = ld_fiscalyear docnumberfrom = ld_docnumberfrom * docnumberto = ld_docnumberto * documenttype = ld_documenttype IMPORTING return = ld_return TABLES itemslist = it_itemslist * extension1 = it_extension1 . " BAPI_GLX_GETDOCITEMS
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_return  TYPE BAPIRET2 ,
ld_ledger  TYPE BAPI1028_11-LEDGER ,
it_itemslist  TYPE STANDARD TABLE OF BAPI1028_12 ,
wa_itemslist  LIKE LINE OF it_itemslist,
ld_companycode  TYPE BAPI1028_11-COMP_CODE ,
it_extension1  TYPE STANDARD TABLE OF BAPI1028EXT_1 ,
wa_extension1  LIKE LINE OF it_extension1,
ld_fiscalyear  TYPE BAPI1028_11-FISC_YEAR ,
ld_docnumberfrom  TYPE BAPI1028_11-DOC_FROMNO ,
ld_docnumberto  TYPE BAPI1028_11-DOC_TONO ,
ld_documenttype  TYPE BAPI1028_11-TYPE .


ld_ledger = some text here

"populate fields of struture and append to itab
append wa_itemslist to it_itemslist.

ld_companycode = some text here

"populate fields of struture and append to itab
append wa_extension1 to it_extension1.

ld_fiscalyear = Check type of data required

ld_docnumberfrom = some text here

ld_docnumberto = some text here

ld_documenttype = some text here

SAP Documentation for FM BAPI_GLX_GETDOCITEMS


With this procedure, you can call up line items for a ledger of the general ledger (prerequisite: totals table FAGLFLEXT or T881-GLFLEX = ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_GLX_GETDOCITEMS or its description.