[ABAP] Einkaufsbelege anzeigen

PARAMETERS: p_ebeln TYPE ebeln.

* ME23N / ME22N anzeigen
CALL FUNCTION 'ME_DISPLAY_PURCHASE_DOCUMENT'
  EXPORTING
    i_ebeln              = p_ebeln
*   i_preview            = abap_true " Druckvorschau anzeigen
*   i_edit               = abap_true " ME22N für Änderungen
  EXCEPTIONS
    not_found            = 1
    no_authority         = 2
    invalid_call         = 3
    preview_not_possible = 4
    OTHERS               = 5.

IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.