# BAPI_DOCUMENT_CHANGE2 — Change Document Info Record

> Changes an existing document info record, for example its status, descriptions, object links, classification or originals, like transaction CV02N. It is used in interfaces that update document status from an approval workflow or add links to new objects. Mark changed header fields in DOCUMENTDATAX; for the tables, check the DELETEVALUE/UPDATE flags of their structures to control whether entries are added or removed, then check RETURN and call BAPI_TRANSACTION_COMMIT.

- Modules: CA
- Type: BAPI
- Function group: CVBAPI
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-document-change2/

## 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 |
| DOCUMENTDATA | BAPI_DOC_DRAW2 | Document data | Yes |
| DOCUMENTDATAX | BAPI_DOC_DRAWX2 | Change flags for document data | Yes |
| HOSTNAME | BAPI_DOC_AUX-HOSTNAME | Front-end host name | - |
| DOCBOMCHANGENUMBER | BAPI_DOC_DRAW2-ECNUMBER | Change number for document structure | - |
| DOCBOMVALIDFROM | BAPI_DOC_DRAW2-VALIDFROMDATE | Valid-from date of document structure | - |
| DOCBOMREVISIONLEVEL | BAPI_DOC_DRAW2-REVLEVEL | Revision level | - |
| SENDCOMPLETEBOM | BAPI_DOC_AUX-FLAG | Complete document structure is sent | - |
| ACCEPT_EMPTY_BOM | BAPI_DOC_AUX-FLAG | Accept empty document structure | - |
| CAD_MODE | CSDATA-XFELD | CAD indicator for document structure | - |
| PF_FTP_DEST | RFCDES-RFCDEST | FTP destination for file transfer | - |
| PF_HTTP_DEST | RFCDES-RFCDEST | HTTP destination for file transfer | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| RETURN | BAPIRET2 | Return message |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| CHARACTERISTICVALUES | BAPI_CHARACTERISTIC_VALUES | Characteristic values | - |
| CLASSALLOCATIONS | BAPI_CLASS_ALLOCATION | Class assignments | - |
| DOCUMENTDESCRIPTIONS | BAPI_DOC_DRAT | Descriptions | - |
| OBJECTLINKS | BAPI_DOC_DRAD | Object links | - |
| DOCUMENTSTRUCTURE | BAPI_DOC_STRUCTURE | Document structure | - |
| DOCUMENTFILES | BAPI_DOC_FILES2 | Original files | - |
| LONGTEXTS | BAPI_DOC_TEXT | Long texts | - |
| COMPONENTS | BAPI_DOC_COMP | Additional files for originals | - |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
  EXPORTING
    documenttype = lv_documenttype
    documentnumber = lv_documentnumber
    documentpart = lv_documentpart
    documentversion = lv_documentversion
    documentdata = lv_documentdata
    documentdatax = lv_documentdatax
  IMPORTING
    return = lv_return
  TABLES
    characteristicvalues = lt_characteristicvalues
    classallocations = lt_classallocations
    documentdescriptions = lt_documentdescriptions
    objectlinks = lt_objectlinks
    documentstructure = lt_documentstructure
    documentfiles = lt_documentfiles
    longtexts = lt_longtexts
    components = lt_components.
```

## Related tables

DRAD, DRAT, DRAW

