Ansicht
Dokumentation
/DSCSAG/DOC_CREATE2 - @PLM++ 4.0: Create Document
BAL_S_LOG - Application Log: Log header data TXBHW - Original Tax Base Amount in Local CurrencyThis documentation is copyright by SAP AG.
Functionality
You can use this function module to create documents and all data that belongs to it. You can create a document info record with the following data:
- Langauge dependent short and long texts
- Any number of originals
- Object links
- Classification characteristics
- Document structures
You can also check in the original application files into the R/3 Database, vault, or archive.
Restrictions:
- Additional files supported only as interface parameters COMPONENTS for future development.
- Valuations of object links are not supported.
Example
**..... Document data
DATA: ls_doc LIKE bapi_doc_draw2.
**..... Bapi-Returnstruktur
ls_return LIKE bapiret2.
**.... Key feilds of the document
DATA: lf_doctype LIKE bapi_doc_draw2-documenttype,
lf_docnumber LIKE bapi_doc_draw2-documentnumber,
lf_docpart LIKE bapi_doc_draw2-documenttype,
lf_docversion LIKE bapi_doc_draw2-documenttype.
**.... Originals that are checked in simultaneously
DATA: lt_files LIKE bapi_doc_files2 OCCURS 0 WITH HEADER LINE,
**.... Short texts
lt_drat LIKE bapi_doc_drat OCCURS 0 WITH HEADER LINE,
**.... Object links
lt_drad LIKE bapi_doc_drad OCCURS 0 WITH HEADER LINE.
**----------------------------------------------------------------------
** Allcoate document data
ls_doc-documenttype = 'DRW'.
ls_doc-documentnumber = '4711'.
ls_doc-documentversion = '00'.
ls_doc-documentpart = '000'.
ls_doc-statusextern = 'AF'.
ls_doc-laboratory = '001'.
** Check in original 1 simultaneously in the R/3 Database
REFRESH lt_files.
CLEAR lt_files.
lt_files-storagecategory = 'SAP-SYSTEM'.
lt_files-docfile = 'c:\temp\drawing.txt'.
lt_wsapplication = 'TXT'.
APPEND lt_files.
lt_files-storagecategory = 'VAULT'.
lt_files-docfile = 'c:\temp\drawing.dwg'.
lt_wsapplication = 'DWG'.
APPEND lt_files.
lt_files-storagecategory = 'SAP-SYSTEM'.
lt_files-docfile = 'c:\temp\drawing.ppt'.
lt_wsapplication = 'PPT'.
APPEND lt_files.
** Short texts
CLEAR lt_drat.
REFRESH lt_drat.
** German short text
lt_drat-language = 'DE'.
lt_drat-description = 'Getriebe'.
APPEND lt_drat.
** English short text
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_CREATE2'
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.
** Did an error occur ??
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.
ELSE.
COMMIT WORK.
ENDIF.
Notes
You can insert the following data in addition to document data:
- Object links
- Classifications and characteristic valuation
- Language dependent document descriptions
- Long text documents
- Document structure
- Originals
Parameters
CAD_MODECHANGE_TO_STATUS
CHANGE_TO_STATUS_LOG
CHARACTERISTICVALUES
CHECK_RESERVATION
CLASSALLOCATIONS
CLASSIFICATION
COMPONENTS
COMPONENTS_OUT
CREATE_WITH_GUI
DOCBOMCHANGENUMBER
DOCBOMREVISIONLEVEL
DOCBOMVALIDFROM
DOCUMENTDATA
DOCUMENTDATA_OUT
DOCUMENTDESCRIPTIONS
DOCUMENTDESCRIPTIONS_OUT
DOCUMENTFILES
DOCUMENTFILES_OUT
DOCUMENTFILES_RENAME
DOCUMENTSTRUCTURE
DOCUMENTSTRUCTURE_OUT
DOC_CLASSTYPE_IGNORE
DOC_RETURNS
EXTENSIONIN
FOLDER_RETURN
GETCLASSIFICATION
HOSTNAME
IN_CLASSGROUP
IN_CLASSNAME
IS_CAD_NBT
IV_CLIENT_VERSION
IV_INIT_CLS_BUFFER
LOG_RETURNS
LONGTEXTS
LONGTEXTS_OUT
OBJECTLINKS
OBJECTLINKS_OUT
OUT_DOCUMENT
PF_FTP_DEST
PF_HTTP_DEST
RESERVED_FOR_ECMS
RESERVED_RETURNS
RETURN
RUNTIME
STATUSLOG_OUT
TOPFOLDER
TOPFOLDER_RETURNS
VERSION_ID
WHEREUSEDLIST_OUT
Exceptions
Function Group
SAG/SAPLDOCUMENT2Fill RESBD Structure from EBP Component Structure RFUMSV00 - Advance Return for Tax on Sales/Purchases
This documentation is copyright by SAP AG.
Length: 6606 Date: 20240425 Time: 034347 sap01-206 ( 65 ms )