Code Snippet to Call Inbound Delivery’s ‘Issue Delivery Output’

In VL33N Display Inbound Delivery screen you can issue output from menu option Inbound Delivery->Issue Delivery Output. For some reason if you want to trigger this option from your program you can use this code.

Code Snippet Call Inbound Delivery Issue Delivery Output sap abap vl33n

*&---------------------------------------------------------------------*
*&      Form  DISPLAY_DELIVERY_OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM display_delivery_output  USING    inbound_delivery TYPE likp-vbeln.

  DATA : lv_kappl  TYPE na_kappl VALUE 'E1'   ,
         lv_objky  TYPE na_objkey             ,
         da_message_printed TYPE char01       .

  lv_objky = inbound_delivery .

  CALL FUNCTION 'RV_MESSAGE_DIALOG'
    EXPORTING
      pi_kappl              = lv_kappl
      pi_objky              = lv_objky
    IMPORTING
      message_printed       = da_message_printed
    EXCEPTIONS
      cancel                = 1
      message_not_printable = 2
      no_message            = 3
      print_error           = 4
      preview_error         = 5
      invalid_preview_mode  = 6
      OTHERS                = 7.

  CASE sy-subrc .
    WHEN 0.
      IF da_message_printed EQ 'X'.
        MESSAGE s084(vl).
        COMMIT WORK.
      ENDIF.
    WHEN 1.
    WHEN 2.
      MESSAGE s085(vl).
      LEAVE.
    WHEN 3.
      MESSAGE s086(vl).
      IF da_message_printed EQ 'X'.
        COMMIT WORK.
      ENDIF.
    WHEN OTHERS.
      MESSAGE s086(vl).
  ENDCASE.

ENDFORM.                    " DISPLAY_DELIVERY_OUTPUT

Leave a Reply