[ABAP] MIME-Repository: Objekt-ID, Pfad, Attribute, Berechtigungen

DATA: lv_io    TYPE skwf_io.
DATA: lv_error TYPE skwf_error.

* Repository-Objekt (MIME) über Pfad suchen
CALL FUNCTION 'SKWF_NMSPC_IO_FIND_BY_ADDRESS'
  EXPORTING
    url   = '/SAP/PUBLIC/xyz.jpg'
    appl  = wbmr_c_skwf_appl_name " 'MIME'
  IMPORTING
    io    = lv_io
    error = lv_error.

IF lv_error-type = 'E'.
ELSE.
  WRITE: / lv_io-objid, lv_io-objtype, lv_io-object, lv_io-class.

* Objekttyp
  CASE lv_io-objtype.
    WHEN skwfc_obtype_folder.
      WRITE: / 'Folder'.
    WHEN skwfc_obtype_any.
      WRITE: / 'Any'.
    WHEN skwfc_obtype_loio.
      WRITE: / 'Logical object'.
    WHEN skwfc_obtype_phio.
      WRITE: / 'Physical object'.
    WHEN skwfc_obtype_rela.
      WRITE: / 'Relation'.
  ENDCASE.

  TRY.
* Zugriff prüfen
      cl_mime_services=>mime_check_authority( i_operation = 'SHOW' " Aktion ('INSERT','MODIFY','SHOW','DELETE')
                                              i_object_io = lv_io ).

      DATA: lv_url TYPE skwf_url.
      DATA: lv_relative_url TYPE skwf_descr.

      DATA: lv_error2 TYPE skwf_error.

* Pfad zum Repository-Objekt (MIME) suchen
      CALL FUNCTION 'SKWF_NMSPC_IO_ADDRESS_GET'
        EXPORTING
          io           = lv_io
        IMPORTING
          url          = lv_url
          relative_url = lv_relative_url
          error        = lv_error2.

      IF lv_error2-type = 'E'.
      ELSE.
        WRITE: / lv_url.
        WRITE: / lv_relative_url.
      ENDIF.

    CATCH cx_root INTO DATA(e).
  ENDTRY.
ENDIF.

[ABAP] MIME-Repository: logische Objekt-ID, physiche Object-ID, Berechtigungen

DATA: lv_loio	TYPE skwf_io.
DATA: lv_is_folder TYPE boole_d.

DATA(o_mime_rep) = cl_mime_repository_api=>get_api( ).

TRY.
* logische IO zu MIME-Objekt holen
    o_mime_rep->get_io_for_url( EXPORTING
                                  i_url       = '/SAP/PUBLIC/xyz.jpg'
                                IMPORTING
                                  e_is_folder = lv_is_folder
                                  e_loio      = lv_loio ).

    WRITE: / lv_is_folder.
    WRITE: / lv_loio.

    DATA: lv_error TYPE skwf_error.
    DATA: it_phios TYPE STANDARD TABLE OF skwf_io WITH DEFAULT KEY.

* physical IOs zu log. IO holen
    CALL FUNCTION 'SKWF_LOIO_ALL_PHIOS_GET'
      EXPORTING
        loio  = lv_loio
      IMPORTING
        error = lv_error
      TABLES
        phios = it_phios.

    LOOP AT it_phios ASSIGNING FIELD-SYMBOL(<p>).

      DATA: lv_err TYPE skwf_error.

* Berechtigungen zu physical IO prüfen
      CALL FUNCTION 'SKWF_AUTH_OBJECT_CHECK'
        EXPORTING
          activity = skwfa_c_act_read
          object   = <p>
        IMPORTING
          error    = lv_err.

      IF lv_err-type = 'E'.
      ELSE.
        WRITE: / <p>.
      ENDIF.

    ENDLOOP.

  CATCH cx_root INTO DATA(e).
    WRITE: / e->get_text( ).
ENDTRY.