Variante 1 (JOIN)
* Dokumentart (TA DC10, Tabelle TDWA)
PARAMETERS: p_type TYPE draw-dokar OBLIGATORY DEFAULT 'XYZ'.
* Dokumentnummer, mit Suchhilfe auf Tabelle DRAW (Dokumentinformationssatz)
PARAMETERS: p_num TYPE draw-doknr OBLIGATORY DEFAULT '10000000001' MATCHCODE OBJECT /plmb/dir_elm.
* Dokumentversion
PARAMETERS: p_ver TYPE draw-dokvr OBLIGATORY DEFAULT '00'.
* Teildokument
PARAMETERS: p_part TYPE draw-doktl OBLIGATORY DEFAULT '000'.
START-OF-SELECTION.
SELECT FROM draw AS dw
INNER JOIN drad AS dd ON ( dw~dokar EQ dd~dokar AND dw~doknr EQ dd~doknr AND dw~dokvr EQ dd~dokvr AND dw~doktl EQ dd~doktl )
INNER JOIN drat AS dt ON ( dw~dokar EQ dt~dokar AND dw~doknr EQ dt~doknr AND dw~dokvr EQ dt~dokvr AND dw~doktl EQ dt~doktl )
LEFT OUTER JOIN dms_doc2loio AS l ON ( dw~dokar EQ l~dokar AND dw~doknr EQ l~doknr AND dw~dokvr EQ l~dokvr AND dw~doktl EQ l~doktl )
LEFT OUTER JOIN dms_doc_files AS f ON ( dw~dokar EQ f~dokar AND dw~doknr EQ f~doknr AND dw~dokvr EQ f~dokvr AND dw~doktl EQ f~doktl )
LEFT OUTER JOIN dms_ph_cd1 AS ph ON ( ph~loio_id EQ l~lo_objid )
LEFT OUTER JOIN dms_phf_cd1 AS pf ON ( pf~phio_id EQ ph~phio_id )
LEFT OUTER JOIN dms_phio2file AS o ON ( o~file_id EQ ph~prop08 )
FIELDS dw~dokar, " Dokumentart
dw~doknr, " Dokumentnummer
dw~dokvr, " Dokumentversion
dw~doktl, " Teildokument
dw~dwnam, " Name des zuständigen Sachbearbeiters
dw~adatum, " Ausgabedatum des Dokuments
dw~document_info_record_key, " Dokumentinfosatzschlüssel konkatenierter Form
dd~dokob, " Verknüpftes SAP-Objekt
dd~obzae, " Zähler Key
dd~objky, " Objektkey Dokumentenverwaltung
dt~dktxt, " Beschreibung
l~lo_objid, " Log.Dokument
f~dappl, " WS-Appl.
f~filename, " Dateiname
ph~phio_id, " Phys.Dokument
ph~stor_cat, " Kategorie
pf~mimetype, " MIME Typ
pf~file_size, " Größe
pf~file_name, " Komponentenname
pf~file_type, " Übertragungsart
o~file_id, " DMS: GUID für Zuordnung PHIO - Dateiname
o~filename AS file_path " Original zu Dokument
WHERE dw~dokar EQ @p_type
AND dw~doknr EQ @p_num
AND dw~dokvr EQ @p_ver
AND dw~doktl EQ @p_part
INTO TABLE @DATA(it_di).
cl_demo_output=>write_data( it_di ).
* 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 = 'DMS'
html_string = lv_html
container = cl_gui_container=>default_screen ).
* cl_gui_container=>default_screen erzwingen
WRITE: space.
Variante 2 (CDS-View P_DOCUMENTINFORECORDATTACHMENT)
* Dokumentart (TA DC10, Tabelle TDWA)
PARAMETERS: p_type TYPE draw-dokar OBLIGATORY DEFAULT 'XYZ'.
* Dokumentnummer, mit Suchhilfe auf Tabelle DRAW (Dokumentinformationssatz)
PARAMETERS: p_num TYPE draw-doknr OBLIGATORY DEFAULT '10000000001' MATCHCODE OBJECT /plmb/dir_elm.
* Dokumentversion
PARAMETERS: p_ver TYPE draw-dokvr OBLIGATORY DEFAULT '00'.
* Teildokument
PARAMETERS: p_part TYPE draw-doktl OBLIGATORY DEFAULT '000'.
START-OF-SELECTION.
SELECT FROM p_documentinforecordattachment
FIELDS *
WHERE documentinforecorddoctype EQ @p_type
AND documentinforecorddocnumber EQ @p_num
AND documentinforecorddocversion EQ @p_ver
AND documentinforecorddocpart EQ @p_part
INTO TABLE @DATA(it_di).
TRY.
* SALV-Table
DATA: o_salv TYPE REF TO cl_salv_table.
cl_salv_table=>factory( IMPORTING r_salv_table = o_salv
CHANGING t_table = it_di ).
* Grundeinstellungen
o_salv->get_functions( )->set_all( abap_true ).
o_salv->get_columns( )->set_optimize( abap_true ).
o_salv->get_display_settings( )->set_list_header( 'DMS' ).
o_salv->get_display_settings( )->set_striped_pattern( abap_true ).
o_salv->get_selections( )->set_selection_mode( if_salv_c_selection_mode=>row_column ).
* Spaltenüberschriften: technischer Name und Beschreibungstexte, Short Text und Medium Text leer lassen für Autosize
LOOP AT o_salv->get_columns( )->get( ) ASSIGNING FIELD-SYMBOL(<c>).
DATA(o_col) = <c>-r_column.
o_col->set_short_text( || ).
o_col->set_medium_text( || ).
o_col->set_long_text( |{ o_col->get_long_text( ) }| ).
ENDLOOP.
o_salv->display( ).
CATCH cx_root INTO DATA(e_txt).
WRITE: / e_txt->get_text( ).
ENDTRY.