* Dokumentart (TA DC10, Tabelle TDWA)
PARAMETERS: p_type TYPE bapi_doc_aux-doctype OBLIGATORY.
* Dokumentnummer, mit Suchhilfe auf Tabelle DRAW (Dokumentinformationssatz)
PARAMETERS: p_num TYPE bapi_doc_aux-docnumber OBLIGATORY DEFAULT '10000000001' MATCHCODE OBJECT /plmb/dir_elm.
* Teildokument
PARAMETERS: p_part TYPE bapi_doc_aux-docpart OBLIGATORY DEFAULT '000'.
* Dokumentversion
PARAMETERS: p_ver TYPE bapi_doc_aux-docversion OBLIGATORY DEFAULT '00'.
START-OF-SELECTION.
DATA: lv_bapi_doc_draw2 TYPE bapi_doc_draw2.
DATA: lv_bapiret2 TYPE bapiret2.
DATA: it_documentfiles TYPE STANDARD TABLE OF bapi_doc_files2 WITH DEFAULT KEY.
* Determine Detail Data for a Document
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
documenttype = p_type
documentnumber = p_num
documentpart = p_part
documentversion = p_ver
getactivefiles = abap_true
getdocdescriptions = abap_true
getdocfiles = abap_true
IMPORTING
documentdata = lv_bapi_doc_draw2
return = lv_bapiret2
TABLES
documentfiles = it_documentfiles.
cl_demo_output=>write_data( p_type ).
cl_demo_output=>write_data( p_num ).
cl_demo_output=>write_data( p_part ).
cl_demo_output=>write_data( p_ver ).
cl_demo_output=>write_data( lv_bapiret2 ).
cl_demo_output=>write_data( lv_bapi_doc_draw2 ).
cl_demo_output=>write_data( it_documentfiles ).
IF lv_bapiret2-type CA 'EA'.
ELSE.
IF lines( it_documentfiles ) > 0.
DATA: it_access_info TYPE STANDARD TABLE OF scms_acinf WITH DEFAULT KEY.
DATA: it_content_txt TYPE STANDARD TABLE OF sdokcntasc WITH DEFAULT KEY.
DATA: it_content_bin TYPE STANDARD TABLE OF sdokcntbin WITH DEFAULT KEY.
* CMS: Dokument lesen
CALL FUNCTION 'SCMS_DOC_READ'
EXPORTING
stor_cat = it_documentfiles[ 1 ]-storagecategory
doc_id = it_documentfiles[ 1 ]-file_id
no_cache = abap_true
TABLES
access_info = it_access_info
content_txt = it_content_txt
content_bin = it_content_bin
EXCEPTIONS
bad_storage_type = 1
bad_request = 2
unauthorized = 3
comp_not_found = 4
not_found = 5
forbidden = 6
conflict = 7
internal_server_error = 8
error_http = 9
error_signature = 10
error_config = 11
error_format = 12
error_parameter = 13
error = 14
OTHERS = 15.
IF sy-subrc = 0.
cl_demo_output=>write_data( it_access_info ).
cl_demo_output=>write_data( it_content_txt ).
* Binärdaten für weitere Verarbeitung (Speichern, Anzeigen ...)
cl_demo_output=>write_data( it_content_bin ).
ENDIF.
ENDIF.
* HTML-Code vom Demo-Output holen
DATA(lv_html) = cl_demo_output=>get( ).
* Daten im Inline-Browser im SAP-Fenster anzeigen
cl_abap_browser=>show_html( EXPORTING title = 'SCMS_DOC_READ'
html_string = lv_html
container = cl_gui_container=>default_screen ).
* cl_gui_container=>default_screen erzwingen
WRITE: space.
ENDIF.
Schlagwort: BAPI_DOCUMENT_GETDETAIL2
[ABAP] DMS: Dokumenteninfosätze lesen (BAPI_DOCUMENT_GETDETAIL2)
* Dokumentart (TA DC10, Tabelle TDWA)
PARAMETERS: p_type TYPE bapi_doc_aux-doctype OBLIGATORY.
* Dokumentnummer, mit Suchhilfe auf Tabelle DRAW (Dokumentinformationssatz)
PARAMETERS: p_num TYPE bapi_doc_aux-docnumber MATCHCODE OBJECT /plmb/dir_elm.
* Teildokument
PARAMETERS: p_part TYPE bapi_doc_aux-docpart OBLIGATORY.
* Dokumentversion
PARAMETERS: p_ver TYPE bapi_doc_aux-docversion OBLIGATORY.
START-OF-SELECTION.
DATA: lv_bapi_doc_draw2 TYPE bapi_doc_draw2.
DATA: lv_bapiret2 TYPE bapiret2.
DATA: it_objectlinks TYPE STANDARD TABLE OF bapi_doc_drad WITH DEFAULT KEY.
DATA: it_documentdescriptions TYPE STANDARD TABLE OF bapi_doc_drat WITH DEFAULT KEY.
DATA: it_longtexts TYPE STANDARD TABLE OF bapi_doc_text WITH DEFAULT KEY.
DATA: it_statuslog TYPE STANDARD TABLE OF bapi_doc_drap WITH DEFAULT KEY.
DATA: it_documentfiles TYPE STANDARD TABLE OF bapi_doc_files2 WITH DEFAULT KEY.
DATA: it_components TYPE STANDARD TABLE OF bapi_doc_comp WITH DEFAULT KEY.
DATA: it_characteristicvalues TYPE STANDARD TABLE OF bapi_characteristic_values WITH DEFAULT KEY.
DATA: it_classallocations TYPE STANDARD TABLE OF bapi_class_allocation WITH DEFAULT KEY.
DATA: it_documentstructure TYPE STANDARD TABLE OF bapi_doc_structure WITH DEFAULT KEY.
DATA: it_whereusedlist TYPE STANDARD TABLE OF bapi_doc_structure WITH DEFAULT KEY.
* Determine Detail Data for a Document
CALL FUNCTION 'BAPI_DOCUMENT_GETDETAIL2'
EXPORTING
documenttype = p_type
documentnumber = p_num
documentpart = p_part
documentversion = p_ver
getobjectlinks = abap_true
getcomponents = abap_true
getstatuslog = abap_true
getlongtexts = abap_true
getactivefiles = abap_true
getdocdescriptions = abap_true
getdocfiles = abap_true
getclassification = abap_true
getstructure = abap_true
getwhereused = abap_true
* hostname = ''
inherited = abap_true
* PF_BAPI_CALL =
IMPORTING
documentdata = lv_bapi_doc_draw2
return = lv_bapiret2
TABLES
objectlinks = it_objectlinks
documentdescriptions = it_documentdescriptions
longtexts = it_longtexts
statuslog = it_statuslog
documentfiles = it_documentfiles
components = it_components
characteristicvalues = it_characteristicvalues
classallocations = it_classallocations
documentstructure = it_documentstructure
whereusedlist = it_whereusedlist.
cl_demo_output=>write_data( p_type ).
cl_demo_output=>write_data( p_num ).
cl_demo_output=>write_data( p_part ).
cl_demo_output=>write_data( p_ver ).
cl_demo_output=>write_data( lv_bapiret2 ).
cl_demo_output=>write_data( lv_bapi_doc_draw2 ).
cl_demo_output=>write_data( it_objectlinks ).
cl_demo_output=>write_data( it_documentdescriptions ).
cl_demo_output=>write_data( it_longtexts ).
cl_demo_output=>write_data( it_statuslog ).
cl_demo_output=>write_data( it_documentfiles ).
cl_demo_output=>write_data( it_components ).
cl_demo_output=>write_data( it_characteristicvalues ).
cl_demo_output=>write_data( it_classallocations ).
cl_demo_output=>write_data( it_documentstructure ).
cl_demo_output=>write_data( it_whereusedlist ).
* HTML-Code vom Demo-Output holen
DATA(lv_html) = cl_demo_output=>get( ).
* Daten im Inline-Browser im SAP-Fenster anzeigen
cl_abap_browser=>show_html( EXPORTING title = 'Infos'
html_string = lv_html
container = cl_gui_container=>default_screen ).
* cl_gui_container=>default_screen erzwingen
WRITE: space.
[SAP] Dokumentenmanagement (DMS)
Transaktionen
CV01N (Dokument anlegen)
CV02N (Dokument ändern)
CV03N (Dokument anzeigen)
CV04N (Dokument suchen)
CV90 (Nummernkreise Dokumente)
DC10 (Dokumentarten definieren)
OACT (Pflege Kategorien)
S_ALR_87008829 (IMG-Aktivität: SIMG_VC_DVS30)
CC04 (Anzeigen Produktstruktur)
OAC0 (CMS Customizing Content Repositories)
CSADMIN (Content-Server-Administration)
SLG1 (Application-Log anzeigen)
- Objekte: SDOK und SCMS
Tabellen
DRAW (Dokumentinformationssatz)
DRAD (Verknüpfung Dokument-Objekt)
DRAO (Originale für Dokumente)
DRAT (Kurztexte für Dokuinfosätze)
DRAP (Protokolldatei Dokument)
DMS_PH_CD1 (DVS: PHIOS der Hauptoriginale)
DMS_PHF_CD1 (DVS: PHIOS-Komponenten der Hauptoriginale (conv. document))
DMS_PH_HD1 (DVS: PHIOS der Zusatzoriginale)
DMS_PHF_HD1 (DVS: PHIOS-Komponenten der Zusatzdateien (help document))
DMS_DOC2LOIO (DVS: Verknüpfungstabelle DVS-Key <-> LOIO-ID)
DMS_DOC_FILES (DMS: Dateinamen für Dokumente)
DMS_PHIO2FILE (DMS: Dateinamen zu Phios)
SDOKSTCAE (SDOK: Kategorie)
TDWA (Dokumentarten)
TDWAT (Beschreibungen für Dokumentart)
TDWO (Objektverknüpfung Dokumentenverwaltung)
TDWOT (Texte Objektverknüpfung Dokumentenverwaltung)
TDWP (Workstation-Applikationen)
TDWS (Dokumentstatus)
TDWST (Text für Dokumentstatus)
Views
ESD_DRAW (Sicht der Tabelle DRAW (DVS))
V_SDOKSTCA (Generated Table for View V_SDOKSTCA)
M_CV01O (Generierter View für Matchcode ID CV01 -O)
CDS-Views
shsm_drad_draw (Value help for search help CV01O)
P_DocumentInfoRecordAttachment (Document Info Record Attachment)
A_DocumentInfoRecordAttch (Attachments for Document Info Record)
Suchhilfen
/PLMB/DIR_ELM (Dokumentenverwaltung)
CBGLWB_REPORT_STATUS (EHS: Suchhilfe für Berichtsstatus)
Paket
CV (Dokumentenverwaltung)
Programme
DMS_KPRO_READ (Originaldaten aus KPRO für ein Dokument ermitteln)
RSHTTP80 (Content Server Performance)
RSCMST (CMS: Test programs)
Business-Objekttypen
DRAW (Dokument)
Funktionsbausteine
CVAPI_DOC_GETDETAIL (DVS: Detaildaten eines Dokuments ermitteln)
CVAPI_DOC_CREATE (DVS: Dokument anlegen)
DOCUMENT_ASSIGNMENT (Allocate documents to object from application)
BAPIs
BAPI_DOCUMENT_CREATE
BAPI_DOCUMENT_CREATE2 (Create Document)
BAPI_DOCUMENT_CHANGE
BAPI_DOCUMENT_CHANGE2
BAPI_DOCUMENT_DELETE
BAPI_DOCUMENT_DELETE_DIRECT (Delete document or set deletion indicator)
BAPI_DOCUMENT_ENQUEUE
BAPI_DOCUMENT_DEQUEUE
BAPI_DOCUMENT_EXISTENCECHECK
BAPI_DOCUMENT_GETAPPLICATION
BAPI_DOCUMENT_GETDETAIL2 (Determine Detail Data for a Document)
BAPI_DOCUMENT_GETLIST
BAPI_DOCUMENT_GETOBJECTDOCS (Determine Documents for an Object)
BAPI_DOCUMENT_GETSTATUS
BAPI_DOCUMENT_SETSTATUS
Fiori App
Dokumente verwalten (F2733)
OData-Services
API_DMS_PROCESS_SRV (API für DMS)
API_CV_ATTACHMENT_SRV (Gateway: API für Anlagenservice)
Links
- https://www.slideshare.net/verbella/sap-document-management-system-integration-with-content-servers
- https://mind-forms.de/archivierung/sap-dokumentenmanagement-ein-kurzes-beispiel/
- https://mind-forms.de/archivierung/sap-dokumentenmanagement-dokumentenarten-anlegen/
- https://mind-forms.de/archivierung/sap-dokumentenmanagement-anzeige-der-dokumente/
- https://mind-forms.de/archivierung/sap-dokumentenmanagement-verknuepfung-mit-objekten/
- https://download.consolut.com/direct/SAP_PrintDoku/en/CADMS/CADMS.PDF
- SAP Note 766277 – Documentation for the BAPIs in document management
- https://www.saptechnicalguru.com/sap-content-server/
- https://blogs.sap.com/2014/07/07/configuring-http-content-server-1-creation-of-the-content-repository/
- https://api.sap.com/api/OP_API_DMS_PROCESS_SRV_0001/resource/Document_Info_Record
- https://api.sap.com/api/API_CV_ATTACHMENT_SRV/resource/Document_Management
- https://blogs.sap.com/2022/07/15/odata-api-attachments-service-in-sap-s-4hana-cloud/
- https://blogs.sap.com/2023/10/31/maintain-assignment-of-document-info-record-to-maintenance-task-lists-via-api-oauth-and-postman/
- https://community.sap.com/t5/enterprise-resource-planning-blog-posts-by-members/dms-linking-material-document-in-dir-and-displaying-the-attachments-in-migo/ba-p/12964138
- https://community.sap.com/t5/enterprise-resource-planning-blog-posts-by-members/custom-dms-objects/ba-p/13785900