Barkod Çıktısı otomatik gönderme
TDPRINTER , TDDEST ,rqposname kullanımı
form f_barkod_yazdir using prt_selected type tty_master .
DATA : FORMNAME TYPE TDSFNAME.
DATA : NAME TYPE RS38L_FNAM.
data : ls_CPARAM TYPE SSFCTRLOP,
ls_OUTPUT TYPE SSFCOMPOP.
FORMNAME = `ZSF_NUMUNE_BARKOD`.
CHECK prt_selected[] is not INITIAL.
CALL FUNCTION `SSF_FUNCTION_MODULE_NAME`
EXPORTING
FORMNAME = FORMNAME
* VARIANT = ` `
* DIRECT_CALL = ` `
IMPORTING
FM_NAME = NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ls_CPARAM-PREVIEW = space.
ls_CPARAM-NO_DIALOG = `X`.
ls_CPARAM-DEVICE = `PRINTER`.
data: ls_sh_prin type SH_PRIN.
SELECT SINGLE * into ls_sh_prin from sh_prin where lname = `ZEBRA_NUMUNE`.
ls_OUTPUT-TDPRINTER = ls_sh_prin-patype. "`ZLB_ZEB2`. " PATYPE Kuyruk: Aygıt tipi adı
ls_OUTPUT-TDDEST = ls_sh_prin-padest. "`Z020`. " PADEST or Kuyruk: Yazıcı
ls_OUTPUT-rqposname = ls_sh_prin-lname. "or `LP01`. "Spool: Output device
ls_OUTPUT-tdimmed = `X`.
ls_OUTPUT-tdcopies = 1.
ls_OUTPUT-tddelete = space.
CALL FUNCTION NAME
EXPORTING
CONTROL_PARAMETERS = ls_CPARAM
OUTPUT_OPTIONS = ls_OUTPUT
USER_SETTINGS = space
IT_KP_LIST = prt_selected
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
ENDform.