# BAPI_DOCUMENT_CHECKIN2 — Check In Document Originals

> Checks original files into an existing document info record, storing them in the content repository or vault defined for the document type. It is used by upload programs that attach files to documents that were created earlier, and to optionally set a new document status at the same time. Pass the full document key and the files in DOCUMENTFILES; when no SAP GUI is available, the file must be reachable from the application server or through the given FTP/HTTP destination.

- 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-checkin2/

## 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 |
| HOSTNAME | BAPI_DOC_AUX-HOSTNAME | Front-end host name | - |
| STATUSINTERN | BAPI_DOC_DRAW-STATUSINTERN | Internal status | - |
| STATUSEXTERN | BAPI_DOC_DRAW-STATUSEXTERN | External status | - |
| STATUSLOG | BAPI_DOC_DRAW-STATUSLOG | Status log entry | - |
| REVLEVEL | BAPI_DOC_DRAW2-REVLEVEL | Revision level | - |
| AENNR | BAPI_DOC_DRAW2-ECNUMBER | Change number | - |
| 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 |
|---|---|---|---|
| DOCUMENTFILES | BAPI_DOC_FILES2 | Originals to check in | Yes |
| COMPONENTS | BAPI_DOC_COMP | Additional files for originals | - |
| DOCUMENTSTRUCTURE | BAPI_DOC_STRUCTURE | Document structure | - |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
  EXPORTING
    documenttype = lv_documenttype
    documentnumber = lv_documentnumber
    documentpart = lv_documentpart
    documentversion = lv_documentversion
  IMPORTING
    return = lv_return
  TABLES
    documentfiles = lt_documentfiles
    components = lt_components
    documentstructure = lt_documentstructure.
```

## Related tables

DRAW

