Parameter | Reference | Type | Length | Default | Optional | Text |
---|---|---|---|---|---|---|
DOCUMENTDATA | BAPI_DOC_DRAW | u | 1364 | Document Data | ||
HOSTNAME | BAPI_DOC_AUX-HOSTNAME | C | 20 | SPACE | X | Name of Frontend |
Parameter | Reference | Type | Length | Text |
---|---|---|---|---|
DOCNUMBER | BAPI_DOC_AUX-DOCNUMBER | C | 25 | Document Number |
DOCPART | BAPI_DOC_AUX-DOCPART | C | 3 | Document Part |
DOCTYPE | BAPI_DOC_AUX-DOCTYPE | C | 3 | Document Type |
DOCVERSION | BAPI_DOC_AUX-DOCVERSION | C | 2 | Document Version |
RETURN | BAPIRET2 | u | 548 | BAPI Return |
Parameter | Reference | Length | Optional | Text |
---|---|---|---|---|
CHARACTERISTICVALUES | BAPI_CHARACTERISTIC_VALUES | 82 | X | Assigned Characteristic Values |
CLASSALLOCATIONS | BAPI_CLASS_ALLOCATION | 36 | X | Classifications |
DOCUMENTDESCRIPTIONS | BAPI_DOC_DRAT | 45 | X | Short texts |
DOCUMENTFILES | BAPI_DOC_FILES | 336 | X | Originals to Check In |
DOCUMENTSTRUCTURE | BAPI_DOC_STRUCTURE | 64 | X | Document-Based Structure |
LONGTEXTS | BAPI_DOC_TEXT | 136 | X | Long Texts |
OBJECTLINKS | BAPI_DOC_DRAD | 215 | X | Object Links |
Functionality
**..... Document data DATA: ls_doc LIKE bapi_doc_draw. **..... Bapi return structure ls_return LIKE bapiret2. **.... key fields of new document DATA: lf_doctype LIKE bapi_doc_draw-documenttype, lf_docnumber LIKE bapi_doc_draw-documentnumber, lf_docpart LIKE bapi_doc_draw-documenttype, lf_docversion LIKE bapi_doc_draw-documenttype. **.... Originals that are checked in at the same time DATA: lt_files LIKE bapi_doc_files OCCURS 0 WITH HEADER LINE, **.... Descriptions lt_drat LIKE bapi_doc_drat OCCURS 0 WITH HEADER LINE, **.... Object links lt_drad LIKE bapi_doc_drad OCCURS 0 WITH HEADER LINE. **---------------------------------------------------------------------- ** Allocate document data ls_doc-documenttype = 'DRW'. ls_doc-documentnumber = '4711'. ls_doc-documentversion = '000'. ls_doc-documentpart = '00'. ls_doc-description = 'Gear box'. ls_doc-statusextern = 'AF'. ls_doc-laboratory = '001'. ls_doc-wsapplication1 = 'DWG'. ** Check original 1 into the SAP data base at the same time REFRESH lt_files. CLEAR lt_files. lt_files-originaltype = '1'. lt_files-datacarrier = 'SAP-SYSTEM'. lt_files-docfile = 'c:\temp\drawing1.dwg'. APPEND lt_files. ** Description in english CLEAR lt_drat. REFRESH lt_drat. lt_drat-language = 'EN'. lt_drat-description = 'gear'. APPEND lt_drat. ** Object link to material master CLEAR lt_drad. REFRESH lt_drad. lt_drad-objecttype = 'MARA'. lt_drad-objectkey = 'M4711'. APPEND lt_drad. * --------------------------------------------------------------------- * Create document * --------------------------------------------------------------------- CALL FUNCTION 'BAPI_DOCUMENT_CREATE' EXPORTING: documentdata = ls_doc IMPORTING: documenttype = lf_doctype documentnumber = lf_docnumber documentpart = lf_docpart documentversion = lf_docversion return = ls_return TABLES: documentdescriptions = lt_drat objectlinks = lt_drad documentfiles = lt_files. ** Error occurred ?? IF ls_return-type CA 'EA'. ROLLBACK WORK. MESSAGE ID '26' TYPE 'I' NUMBER '000' WITH ls_return-message. ELSE. COMMIT WORK. ENDIF. Hints Description Description Description Description Description Description Description Description Description Description |