CA BAPI RFC Used the same way in S/4HANA

BAPI_DOCUMENT_CREATE2 Create Document Info Record

Creates a document info record in Document Management (DMS) with descriptions, object links, classification and original files, like transaction CV01N. It is used to upload drawings, certificates or scanned files from external systems and link them to materials, equipment or other objects. Fill DOCUMENTDATA (type, number, part, version), add files in DOCUMENTFILES and links in OBJECTLINKS, check RETURN and call BAPI_TRANSACTION_COMMIT.

Function group
CVBAPI
Remote-enabled (RFC)
Yes
Type
BAPI

Importing parameters

ParameterTypeDescriptionRequired
DOCUMENTDATABAPI_DOC_DRAW2Document dataYes
HOSTNAMEBAPI_DOC_AUX-HOSTNAMEFront-end host name—
DOCBOMCHANGENUMBERBAPI_DOC_DRAW2-ECNUMBERChange number for document structure—
DOCBOMVALIDFROMBAPI_DOC_DRAW2-VALIDFROMDATEValid-from date of document structure—
DOCBOMREVISIONLEVELBAPI_DOC_DRAW2-REVLEVELRevision level—
CAD_MODECSDATA-XFELDCAD indicator for document structure—
PF_FTP_DESTRFCDES-RFCDESTFTP destination for file transfer—
PF_HTTP_DESTRFCDES-RFCDESTHTTP destination for file transfer—
DEFAULTCLASSBAPI_DOC_AUX-FLAGUse class from Customizing—

Exporting parameters

ParameterTypeDescription
DOCUMENTTYPEBAPI_DOC_AUX-DOCTYPEDocument type
DOCUMENTNUMBERBAPI_DOC_AUX-DOCNUMBERDocument number
DOCUMENTPARTBAPI_DOC_AUX-DOCPARTDocument part
DOCUMENTVERSIONBAPI_DOC_AUX-DOCVERSIONDocument version
RETURNBAPIRET2Return message

Tables parameters

ParameterTypeDescriptionRequired
CHARACTERISTICVALUESBAPI_CHARACTERISTIC_VALUESCharacteristic values—
CLASSALLOCATIONSBAPI_CLASS_ALLOCATIONClass assignments—
DOCUMENTDESCRIPTIONSBAPI_DOC_DRATDescriptions—
OBJECTLINKSBAPI_DOC_DRADObject links—
DOCUMENTSTRUCTUREBAPI_DOC_STRUCTUREDocument structure—
DOCUMENTFILESBAPI_DOC_FILES2Original files—
LONGTEXTSBAPI_DOC_TEXTLong texts—
COMPONENTSBAPI_DOC_COMPAdditional files for originals—

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_CREATE2'
  EXPORTING
    documentdata = lv_documentdata
  IMPORTING
    documenttype = lv_documenttype
    documentnumber = lv_documentnumber
    documentpart = lv_documentpart
    documentversion = lv_documentversion
    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

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.

Request a custom report