[ABAP] Spoolauftrag auf einem Drucker ausgeben

* Spoolauftrag
PARAMETERS: p_spool TYPE tsp01-rqident DEFAULT '12345' OBLIGATORY.
* Drucker
PARAMETERS: p_dest TYPE tsp03-padest OBLIGATORY.

START-OF-SELECTION.

* Prio
* 0 - default
* 1 = sehr hoch
* 2 = hoch
* 3 = hoch
* 4 = mittel
* 5 = mittel
* 6 = mittel
* 7 = niedrig
* 8 = niedrig
* 9 = sehr niedrig
  CALL FUNCTION 'RSPO_OUTPUT_SPOOL_REQUEST'
    EXPORTING
*     copies                   = 0
      device                   = p_dest
*     division                 = '*'
*     endpage                  = 0
*     prio                     = 0
*     receiver                 = '*'
*     reqest_title             = '*'
      spool_request_id         = p_spool
*     startpage                = 0
*     telelan                  = '*'
*     telenum                  = '*'
*     posname                  =
*     acttime                  =
*    TABLES
*     attributes               =
    EXCEPTIONS
      archive_dest_invalid     = 1
      archive_dest_not_found   = 2
      archive_dest_no_right    = 3
      cannot_archive           = 4
      change_archdest_no_right = 5
      change_copies_no_right   = 6
      change_dest_no_right     = 7
      change_devtype_no_right  = 8
      change_prio_no_right     = 9
      change_telenum_no_right  = 10
      change_title_no_right    = 11
      dest_invalid             = 12
      dest_not_found           = 13
      dest_no_right            = 14
      internal_problem         = 15
      invalid_fax_attribute    = 16
      invalid_parameters       = 17
      non_owner_no_right       = 18
      no_layout                = 19
      no_spool_request         = 20
      out_again_no_right       = 21
      spooler_problem          = 22
      in_process               = 23
      OTHERS                   = 24.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    WRITE: / 'Druck fertig.'.
  ENDIF.