CA
BAPI
RFC
Used the same way in S/4HANA
BAPI_DOCUMENT_GETDETAIL2 Get Document Info Record Details
Reads the data of a document info record and, depending on the GET… flags, also its descriptions, object links, originals, classification, long texts, structure and status log. It is used by reports and portals that display documents linked to materials or equipment and by programs that download originals. Set only the GET… flags you need to keep the call fast and check RETURN for errors.
- Function group
- CVBAPI
- Remote-enabled (RFC)
- Yes
- Type
- BAPI
Importing parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| DOCUMENTTYPE | BAPI_DOC_AUX-DOCTYPE | Document type | Yes |
| DOCUMENTNUMBER | BAPI_DOC_AUX-DOCNUMBER | Document number | Yes |
| DOCUMENTPART | BAPI_DOC_AUX-DOCPART | Document part | Yes |
| DOCUMENTVERSION | BAPI_DOC_AUX-DOCVERSION | Document version | Yes |
| GETOBJECTLINKS | BAPI_DOC_AUX-FLAG | Read object links | — |
| GETDOCDESCRIPTIONS | BAPI_DOC_AUX-FLAG | Read descriptions | — |
| GETDOCFILES | BAPI_DOC_AUX-FLAG | Read originals | — |
| GETCLASSIFICATION | BAPI_DOC_AUX-FLAG | Read classification | — |
| GETLONGTEXTS | BAPI_DOC_AUX-FLAG | Read long texts | — |
| GETSTATUSLOG | BAPI_DOC_AUX-FLAG | Read status log | — |
| GETSTRUCTURE | BAPI_DOC_AUX-FLAG | Read document structure | — |
| GETWHEREUSED | BAPI_DOC_AUX-FLAG | Read where-used list | — |
| GETACTIVEFILES | BAPI_DOC_AUX-FLAG | Read active originals | — |
| HOSTNAME | BAPI_DOC_AUX-HOSTNAME | Front-end host name | — |
Exporting parameters
| Parameter | Type | Description |
|---|---|---|
| DOCUMENTDATA | BAPI_DOC_DRAW2 | Document data |
| RETURN | BAPIRET2 | Return message |
Tables parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| OBJECTLINKS | BAPI_DOC_DRAD | Object links | — |
| DOCUMENTDESCRIPTIONS | BAPI_DOC_DRAT | Descriptions | — |
| DOCUMENTFILES | BAPI_DOC_FILES2 | Original files | — |
| CLASSALLOCATIONS | BAPI_CLASS_ALLOCATION | Class assignments | — |
| CHARACTERISTICVALUES | BAPI_CHARACTERISTIC_VALUES | Characteristic values | — |
| LONGTEXTS | BAPI_DOC_TEXT | Long texts | — |
| STATUSLOG | BAPI_DOC_DRAP | Status log | — |
| DOCUMENTSTRUCTURE | BAPI_DOC_STRUCTURE | Document structure | — |
| WHEREUSEDLIST | BAPI_DOC_STRUCTURE | Where-used list | — |
| COMPONENTS | BAPI_DOC_COMP | Additional files | — |
Call template (ABAP)
A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
documenttype = lv_documenttype
documentnumber = lv_documentnumber
documentpart = lv_documentpart
documentversion = lv_documentversion
IMPORTING
documentdata = lv_documentdata
return = lv_return
TABLES
objectlinks = lt_objectlinks
documentdescriptions = lt_documentdescriptions
documentfiles = lt_documentfiles
classallocations = lt_classallocations
characteristicvalues = lt_characteristicvalues
longtexts = lt_longtexts
statuslog = lt_statuslog
documentstructure = lt_documentstructure
whereusedlist = lt_whereusedlist
components = lt_components.Related tables
Can't find the report you need?
We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.