cancel
Showing results for 
Search instead for 
Did you mean: 

lf_fm_name error if default printer space

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Add this field in structure of output option and check now.

W_COMPOP-TDDEST = 'LP01' or (W_COMPOP-TDDEST = 'LOCA' )

and W_CTRLOP-device = 'MAIL' or ( W_CTRLOP-device = 'PRINTER').

Regards,

Renuka

Answers (1)

Answers (1)

madhu_vadlamani
Active Contributor
0 Kudos

Hi Sinan,

Happy New year.Please pass the parameter OUTPUT_OPTIONS in fm lf_fm_name .

Regards,

Madhu.

Former Member
0 Kudos

hı madruha

W_CTRLOP-device = 'LP01'.

W_CTRLOP-GETOTF = 'X'.

W_CTRLOP-NO_DIALOG = 'X'.

W_COMPOP-TDNOPREV = 'X'.

*W_COMPOP-tdprinter = 'LP01'.

W_COMPOP-tdnewid = 'X'.

*W_COMPOP-TDNOARCH = 'X'.

*W_COMPOP-tddest = 'LP01'.

  • comm_val-adsmtp-smtp_addr = ismtp-smtp .

  • call function 'CONVERT_COMM_TYPE_DATA'

  • exporting

  • pi_comm_type = 'INT'

  • pi_comm_values = comm_val

  • importing

  • pe_device = w_ctrlop-device

  • pe_mail_recipient = mail_recipient.

CALL FUNCTION lf_fm_name

EXPORTING

CONTROL_PARAMETERS = W_CTRLOP

*OUTPUT_OPTIONS = W_COMPOP

USER_SETTINGS = 'X'

*mail_recipient = mail_recipient

gt_1003 = zsd_st09_01

yukleyen = yukle

sofor1 = sofor1

not1 = not1

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.

okey applaying your solving but error sy-subrc 3 .

regard sinan .