[ABAP] DMS: Verknüpfte Dokumenteninfosätze zu einem Objekt lesen (BAPI_DOCUMENT_GETOBJECTDOCS)

* Objekttyp (Material -> MARA)
PARAMETERS: p_otype TYPE bapi_doc_drad-objecttype OBLIGATORY DEFAULT 'MARA'.
* Objektkey (Material -> MATNR)
PARAMETERS: p_okey TYPE bapi_doc_drad-objectkey OBLIGATORY DEFAULT '000000001122334455'.

START-OF-SELECTION.

  DATA: it_doc_keys TYPE STANDARD TABLE OF bapi_doc_keys WITH DEFAULT KEY.
  DATA: lv_return   TYPE bapiret2.

* Determine Documents for an Object
  CALL FUNCTION 'BAPI_DOCUMENT_GETOBJECTDOCS'
    EXPORTING
      objecttype          = p_otype
      objectkey           = p_okey
      currentversionsonly = abap_false " alle Versionen lesen
      date                = sy-datum
    IMPORTING
      return              = lv_return
    TABLES
      documentlist        = it_doc_keys.

  cl_demo_output=>write_data( lv_return ).
  cl_demo_output=>write_data( it_doc_keys ).

* 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       = 'BAPI_DOCUMENT_GETOBJECTDOCS'
                                        html_string = lv_html
                                        container   = cl_gui_container=>default_screen ).

* cl_gui_container=>default_screen erzwingen
  WRITE: space.