SAP BAPI_DOCUMENT_GETLIST Function Module for Find Document









BAPI_DOCUMENT_GETLIST is a standard bapi document getlist SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Find Document 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 document getlist FM, simply by entering the name BAPI_DOCUMENT_GETLIST into the relevant SAP transaction such as SE37 or SE38.

Function Group: CVBAPI
Program Name: SAPLCVBAPI
Main Program: SAPLCVBAPI
Appliation area: C
Release date: 03-Jun-1998
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_DOCUMENT_GETLIST 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_DOCUMENT_GETLIST'"Find Document
EXPORTING
* DOCUMENTTYPE = ' ' "Document Type
* LABORATORY = ' ' "Lab/Office
* DELETEINDICATOR = ' ' "Deletion Indicator
* DATACARRIER = ' ' "Data Carrier
* CADINDICATOR = '*' "CAD Indicator
* WSAPPLICATION = ' ' "Workstation Application
* STATUSEXTERN = ' ' "Status Abbreviation (External)
* STATUSINTERN = ' ' "Status (Internal)
* MAXROWS = 0 "Maximum Number of Data Records
* DOCUMENTPART = ' ' "Document Part
* DOCUMENTVERSION = ' ' "Document Version
* DESCRIPTION = ' ' "Short Text (Always in Logon Language)
* LANGUAGE = SY-LANGU "Language for Short Text Search
* LANGUAGEISO = ' ' "Language for Short Text Search
* USERNAME = ' ' "Agent
* AUTHORITYGROUP = ' ' "Authorization Group
* ECNUMBER = ' ' "Change Number

IMPORTING
RETURN = "BAPI Return
FOUNDROWS = "No. of Data Records Found

TABLES
* DOCNUMBERSELECTION = "Value Range for Document Number
DOCUMENTLIST = "List of Document Info Records
.



IMPORTING Parameters details for BAPI_DOCUMENT_GETLIST

DOCUMENTTYPE - Document Type

Data type: BAPI_DOC_AUX-DOCTYPE
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LABORATORY - Lab/Office

Data type: BAPI_DOC_DRAW-LABORATORY
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

DELETEINDICATOR - Deletion Indicator

Data type: BAPI_DOC_AUX-DELFLAG
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

DATACARRIER - Data Carrier

Data type: BAPI_DOC_DRAW-DATACARRIER1
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

CADINDICATOR - CAD Indicator

Data type: BAPI_DOC_DRAW-CADINDICATOR
Default: '*'
Optional: Yes
Call by Reference: No ( called with pass by value option)

WSAPPLICATION - Workstation Application

Data type: BAPI_DOC_AUX-WSAPPL
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

STATUSEXTERN - Status Abbreviation (External)

Data type: BAPI_DOC_DRAW-STATUSEXTERN
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

STATUSINTERN - Status (Internal)

Data type: BAPI_DOC_DRAW-STATUSINTERN
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

MAXROWS - Maximum Number of Data Records

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

DOCUMENTPART - Document Part

Data type: BAPI_DOC_AUX-DOCPART
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

DOCUMENTVERSION - Document Version

Data type: BAPI_DOC_AUX-DOCVERSION
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

DESCRIPTION - Short Text (Always in Logon Language)

Data type: BAPI_DOC_DRAW-DESCRIPTION
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

LANGUAGE - Language for Short Text Search

Data type: BAPI_DOC_DRAT-LANGUAGE
Default: SY-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

LANGUAGEISO - Language for Short Text Search

Data type: BAPI_DOC_DRAT-LANGUAGE_ISO
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

USERNAME - Agent

Data type: BAPI_DOC_DRAW-USERNAME
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

AUTHORITYGROUP - Authorization Group

Data type: BAPI_DOC_AUX-AUTHGR
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

ECNUMBER - Change Number

Data type: BAPI_DOC_DRAW-ECNUMBER
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BAPI_DOCUMENT_GETLIST

RETURN - BAPI Return

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

FOUNDROWS - No. of Data Records Found

Data type: BAPI_DOC_AUX-MAXROWS
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BAPI_DOCUMENT_GETLIST

DOCNUMBERSELECTION - Value Range for Document Number

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

DOCUMENTLIST - List of Document Info Records

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

Copy and paste ABAP code example for BAPI_DOCUMENT_GETLIST 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_return  TYPE BAPIRET2, "   
lv_documenttype  TYPE BAPI_DOC_AUX-DOCTYPE, "   SPACE
lt_docnumberselection  TYPE STANDARD TABLE OF BAPI_DOC_SELNR, "   
lv_laboratory  TYPE BAPI_DOC_DRAW-LABORATORY, "   SPACE
lv_deleteindicator  TYPE BAPI_DOC_AUX-DELFLAG, "   SPACE
lv_datacarrier  TYPE BAPI_DOC_DRAW-DATACARRIER1, "   SPACE
lv_cadindicator  TYPE BAPI_DOC_DRAW-CADINDICATOR, "   '*'
lv_wsapplication  TYPE BAPI_DOC_AUX-WSAPPL, "   SPACE
lv_statusextern  TYPE BAPI_DOC_DRAW-STATUSEXTERN, "   SPACE
lv_statusintern  TYPE BAPI_DOC_DRAW-STATUSINTERN, "   SPACE
lv_maxrows  TYPE BAPI_DOC_AUX-MAXROWS, "   0
lv_foundrows  TYPE BAPI_DOC_AUX-MAXROWS, "   
lt_documentlist  TYPE STANDARD TABLE OF BAPI_DOC_DRAW, "   
lv_documentpart  TYPE BAPI_DOC_AUX-DOCPART, "   SPACE
lv_documentversion  TYPE BAPI_DOC_AUX-DOCVERSION, "   SPACE
lv_description  TYPE BAPI_DOC_DRAW-DESCRIPTION, "   SPACE
lv_language  TYPE BAPI_DOC_DRAT-LANGUAGE, "   SY-LANGU
lv_languageiso  TYPE BAPI_DOC_DRAT-LANGUAGE_ISO, "   SPACE
lv_username  TYPE BAPI_DOC_DRAW-USERNAME, "   SPACE
lv_authoritygroup  TYPE BAPI_DOC_AUX-AUTHGR, "   SPACE
lv_ecnumber  TYPE BAPI_DOC_DRAW-ECNUMBER. "   SPACE

  CALL FUNCTION 'BAPI_DOCUMENT_GETLIST'  "Find Document
    EXPORTING
         DOCUMENTTYPE = lv_documenttype
         LABORATORY = lv_laboratory
         DELETEINDICATOR = lv_deleteindicator
         DATACARRIER = lv_datacarrier
         CADINDICATOR = lv_cadindicator
         WSAPPLICATION = lv_wsapplication
         STATUSEXTERN = lv_statusextern
         STATUSINTERN = lv_statusintern
         MAXROWS = lv_maxrows
         DOCUMENTPART = lv_documentpart
         DOCUMENTVERSION = lv_documentversion
         DESCRIPTION = lv_description
         LANGUAGE = lv_language
         LANGUAGEISO = lv_languageiso
         USERNAME = lv_username
         AUTHORITYGROUP = lv_authoritygroup
         ECNUMBER = lv_ecnumber
    IMPORTING
         RETURN = lv_return
         FOUNDROWS = lv_foundrows
    TABLES
         DOCNUMBERSELECTION = lt_docnumberselection
         DOCUMENTLIST = lt_documentlist
. " BAPI_DOCUMENT_GETLIST




ABAP code using 7.40 inline data declarations to call FM BAPI_DOCUMENT_GETLIST

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 DOCTYPE FROM BAPI_DOC_AUX INTO @DATA(ld_documenttype).
DATA(ld_documenttype) = ' '.
 
 
"SELECT single LABORATORY FROM BAPI_DOC_DRAW INTO @DATA(ld_laboratory).
DATA(ld_laboratory) = ' '.
 
"SELECT single DELFLAG FROM BAPI_DOC_AUX INTO @DATA(ld_deleteindicator).
DATA(ld_deleteindicator) = ' '.
 
"SELECT single DATACARRIER1 FROM BAPI_DOC_DRAW INTO @DATA(ld_datacarrier).
DATA(ld_datacarrier) = ' '.
 
"SELECT single CADINDICATOR FROM BAPI_DOC_DRAW INTO @DATA(ld_cadindicator).
DATA(ld_cadindicator) = '*'.
 
"SELECT single WSAPPL FROM BAPI_DOC_AUX INTO @DATA(ld_wsapplication).
DATA(ld_wsapplication) = ' '.
 
"SELECT single STATUSEXTERN FROM BAPI_DOC_DRAW INTO @DATA(ld_statusextern).
DATA(ld_statusextern) = ' '.
 
"SELECT single STATUSINTERN FROM BAPI_DOC_DRAW INTO @DATA(ld_statusintern).
DATA(ld_statusintern) = ' '.
 
"SELECT single MAXROWS FROM BAPI_DOC_AUX INTO @DATA(ld_maxrows).
 
"SELECT single MAXROWS FROM BAPI_DOC_AUX INTO @DATA(ld_foundrows).
 
 
"SELECT single DOCPART FROM BAPI_DOC_AUX INTO @DATA(ld_documentpart).
DATA(ld_documentpart) = ' '.
 
"SELECT single DOCVERSION FROM BAPI_DOC_AUX INTO @DATA(ld_documentversion).
DATA(ld_documentversion) = ' '.
 
"SELECT single DESCRIPTION FROM BAPI_DOC_DRAW INTO @DATA(ld_description).
DATA(ld_description) = ' '.
 
"SELECT single LANGUAGE FROM BAPI_DOC_DRAT INTO @DATA(ld_language).
DATA(ld_language) = SY-LANGU.
 
"SELECT single LANGUAGE_ISO FROM BAPI_DOC_DRAT INTO @DATA(ld_languageiso).
DATA(ld_languageiso) = ' '.
 
"SELECT single USERNAME FROM BAPI_DOC_DRAW INTO @DATA(ld_username).
DATA(ld_username) = ' '.
 
"SELECT single AUTHGR FROM BAPI_DOC_AUX INTO @DATA(ld_authoritygroup).
DATA(ld_authoritygroup) = ' '.
 
"SELECT single ECNUMBER FROM BAPI_DOC_DRAW INTO @DATA(ld_ecnumber).
DATA(ld_ecnumber) = ' '.
 


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!