[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.