Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to disable print popup and print option in smartform

Former Member
0 Kudos

Dear friends,

when i execute my smartform driver program i get popup for prin and print priview, i want to disable that popup screen and when i get print preview i want to disable print option from there also. can you please suggest me how to do it?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try this

DATA: T_SSFCTRLOP TYPE SSFCTRLOP. "FOR SMART FORMS

DATA: LS_OUTPUT_OPTIONS TYPE SSFCOMPOP.

DATA: FNAME TYPE RS38L_FNAM.

DATA: L_DEVTYPE TYPE RSPOPTYPE.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'YTEST'

IMPORTING

FM_NAME = FNAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

T_SSFCTRLOP-NO_DIALOG = 'X'.

T_SSFCTRLOP-GETOTF = 'X'.

T_SSFCTRLOP-LANGU = 'E'.

CALL FUNCTION 'SSF_GET_DEVICE_TYPE'

EXPORTING

I_LANGUAGE = 'E'

IMPORTING

E_DEVTYPE = L_DEVTYPE

EXCEPTIONS

NO_LANGUAGE = 1

LANGUAGE_NOT_INSTALLED = 2

NO_DEVTYPE_FOUND = 3

SYSTEM_ERROR = 4

OTHERS = 5.

LS_OUTPUT_OPTIONS-TDPRINTER = L_DEVTYPE.

CALL FUNCTION FNAME

EXPORTING

CONTROL_PARAMETERS = T_SSFCTRLOP

OUTPUT_OPTIONS = LS_OUTPUT_OPTIONS

USER_SETTINGS = SPACE

IMPORTING

JOB_OUTPUT_INFO = OUTPUT_INFO

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

regards,

Shweta

7 REPLIES 7

Former Member
0 Kudos

Hi,

Please search SCN you would get a lot of threads

Regards,

Himanshu

Former Member
0 Kudos

Hi,

To disable the Print Preview Popup during your smartform execution pass the following parameters to the Function Module as follows:-

la_ctrl_form-no_dialog = 'X'.

la_ctrl_form-preview = space.

la_ctrl_form-getotf = 'X'.

la_ctrl_form-langu = nast-spras.

la_ctrl_form-device = 'PRINTER'.

CALL FUNCTION g_fmname

EXPORTING

control_parameters = la_ctrl_form

output_options = la_output_opt

IMPORTING

job_output_info = job_output_info

TABLES

pt_staffrequest = it_staffrequest[]

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

IF sy-subrc <> 0.

ENDIF.

Hope this resolves your issue.

kesavadas_thekkillath
Active Contributor
0 Kudos

hi vimarshbhardwaj ,

Its better to go for a SCN search

former_member198275
Active Contributor
0 Kudos
DATA :  LF_FORMNAME           TYPE TDSFNAME ,  " Smart Forms: Form Name
                        LF_FM_NAME            TYPE RS38L_FNAM. " Name of Function Module
          data :     WA_CPARAM TYPE SSFCTRLOP,
                        WA_OUTPUT TYPE SSFCOMPOP.


  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      FORMNAME           = LF_FORMNAME
    IMPORTING
      FM_NAME            = LF_FM_NAME.

  WA_CPARAM-PREVIEW = 'X'.
  WA_CPARAM-NO_DIALOG = 'X'.
  WA_CPARAM-DEVICE = 'PRINTER'.


  WA_OUTPUT-TDNOPRINT = 'X'.       "No printing from print preview
  WA_OUTPUT-TDDEST = 'LOCA'. "or 'LP01'.  "Spool: Output device


  CALL FUNCTION LF_FM_NAME
    EXPORTING
      CONTROL_PARAMETERS = WA_CPARAM
      OUTPUT_OPTIONS     = WA_OUTPUT
      USER_SETTINGS      = SPACE.

Former Member
0 Kudos

Hi,

Try this

DATA: T_SSFCTRLOP TYPE SSFCTRLOP. "FOR SMART FORMS

DATA: LS_OUTPUT_OPTIONS TYPE SSFCOMPOP.

DATA: FNAME TYPE RS38L_FNAM.

DATA: L_DEVTYPE TYPE RSPOPTYPE.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'YTEST'

IMPORTING

FM_NAME = FNAME

EXCEPTIONS

NO_FORM = 1

NO_FUNCTION_MODULE = 2

OTHERS = 3.

T_SSFCTRLOP-NO_DIALOG = 'X'.

T_SSFCTRLOP-GETOTF = 'X'.

T_SSFCTRLOP-LANGU = 'E'.

CALL FUNCTION 'SSF_GET_DEVICE_TYPE'

EXPORTING

I_LANGUAGE = 'E'

IMPORTING

E_DEVTYPE = L_DEVTYPE

EXCEPTIONS

NO_LANGUAGE = 1

LANGUAGE_NOT_INSTALLED = 2

NO_DEVTYPE_FOUND = 3

SYSTEM_ERROR = 4

OTHERS = 5.

LS_OUTPUT_OPTIONS-TDPRINTER = L_DEVTYPE.

CALL FUNCTION FNAME

EXPORTING

CONTROL_PARAMETERS = T_SSFCTRLOP

OUTPUT_OPTIONS = LS_OUTPUT_OPTIONS

USER_SETTINGS = SPACE

IMPORTING

JOB_OUTPUT_INFO = OUTPUT_INFO

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

regards,

Shweta

0 Kudos

Hi ,

Actually that is not a pop up window  its a modal dialog box as it calls a separate screen so in order to avoid the dialog box appearing all you need to do is set a flag to T_SSFCTRLOP-NO_DIALOG .

T_SSFCTRLOP-NO_DIALOG = 'X'. and pass the parameters to the function module.


    CALL FUNCTION FNAME

      EXPORTING

        CONTROL_PARAMETERS = T_SSFCTRLOP

        OUTPUT_OPTIONS     = LS_OUTPUT_OPTIONS

        USER_SETTINGS      = SPACE

      IMPORTING

        JOB_OUTPUT_INFO    = OUTPUT_INFO

      EXCEPTIONS

        FORMATTING_ERROR   = 1

        INTERNAL_ERROR     = 2

        SEND_ERROR         = 3

        USER_CANCELED      = 4

        OTHERS             = 5.

Dialog box will not appear now

former_member216215
Participant
0 Kudos

Thank You Worked for me too.

Regards Rasim.