Code: Alles auswählen.
** Dokumentendaten zuweisen
ls_doc-documentnumber = 'TEST'
ls_doc-documenttype = 'ZSO'.
ls_doc-documentversion = '00'.
ls_doc-documentpart = '000'.
ls_doc-statusextern = 'IK'.
ls_doc-laboratory = '001'.
** Originale in die SAP-Datenbank und einen Tresor einchecken
REFRESH lt_files.
CLEAR lt_files.
lt_files-storagecategory = 'SAP-SYSTEM'.
lt_files-docfile = 'C:\TEMP\export.txt'.
lt_files-wsapplication = 'TXT'.
APPEND lt_files.
** Kurztexte
CLEAR lt_drat.
REFRESH lt_drat.
lt_drat-language = 'DE'.
lt_drat-description = 'Test'.
APPEND lt_drat.
** Objektverknüpfung
CLEAR lt_drad.
REFRESH lt_drad.
lt_drad-objecttype = 'VBAP'.
lt_drad-objectkey = g_objky.
APPEND lt_drad.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = ls_doc
* HOSTNAME =
* DOCBOMCHANGENUMBER =
* DOCBOMVALIDFROM =
* DOCBOMREVISIONLEVEL =
* CAD_MODE = ' '
* PF_FTP_DEST = ' '
* PF_HTTP_DEST = ' '
IMPORTING
DOCUMENTTYPE = lf_doctype
DOCUMENTNUMBER = lf_docnumber
DOCUMENTPART = lf_docpart
DOCUMENTVERSION = lf_docversion
RETURN = ls_return
TABLES
* CHARACTERISTICVALUES =
* CLASSALLOCATIONS =
DOCUMENTDESCRIPTIONS = lt_drat
OBJECTLINKS = lt_drad
* DOCUMENTSTRUCTURE =
DOCUMENTFILES = lt_files
* LONGTEXTS =
* COMPONENTS =
.
Code: Alles auswählen.
* Fehler aufgetreten ??
IF ls_return-type CA 'EA'.
ROLLBACK WORK.
MESSAGE ID '26' TYPE 'I' NUMBER '000'
WITH ls_return-message.
ELSE.
COMMIT WORK.
ENDIF.
ENDFORM.
Code: Alles auswählen.
** Dokumentendaten zuweisen
ls_doc-documentnumber = 'TEST'
ls_doc-documenttype = 'ZSO'.
ls_doc-documentversion = '00'.
ls_doc-documentpart = '000'.
ls_doc-statusextern = 'IK'.
ls_doc-laboratory = '001'.
lt_files-CHECKEDIN = 'X'.
** Originale in die SAP-Datenbank und einen Tresor einchecken
REFRESH lt_files.
CLEAR lt_files.
lt_files-storagecategory = 'SAP-SYSTEM'.
lt_files-docfile = 'C:\TEMP\export.txt'.
lt_files-wsapplication = 'TXT'.