Skip to Content
0
Former Member
Dec 30, 2011 at 09:45 AM

lf_fm_name error if default printer space

110 Views

hı all

l want send smartform like pdf with mail but if default printer name space send_error or INTERNAL_ERROR in lf_fm_name function and ı dont write default printer . how can ı solved no write default printer name . you can see my code below .

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSEFER_DETAY'

  • VARIANT = ' '"

  • DIRECT_CALL = ' '"

IMPORTING

fm_name = lf_fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

*W_CTRLOP-no_open = 'X'.

**W_CTRLOP-no_close = 'X'.

W_CTRLOP-device = 'LP01'.

W_CTRLOP-GETOTF = 'X'.

W_CTRLOP-NO_DIALOG = 'X'.

W_COMPOP-TDNOPREV = 'X'.

CALL FUNCTION lf_fm_name

EXPORTING

CONTROL_PARAMETERS = W_CTRLOP

OUTPUT_OPTIONS = W_COMPOP

USER_SETTINGS = 'X'

gt_1003 = zsd_st09_01

IMPORTING

JOB_OUTPUT_INFO = W_RETURN

TABLES

GT_1002 = GT_102

GT_1001 = gt_1001

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 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.