cancel
Showing results for 
Search instead for 
Did you mean: 

Print SMARTFORMS

Former Member
0 Kudos

Hi,

i have a smartform which i want to print for different values,but on the selection screen if i give one value it prints fine when i give it a range it gives me the print preview screen for every value i want to supress that screen.For eg. I want to print Pay slip for 20 employees at one time it would ask to click on the print button for all the employees which i dont want...any help would be appriciated

Accepted Solutions (0)

Answers (3)

Answers (3)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

This code will suppress the dialog.Kindly reward points if it is helpful.

&----


*& Report ZZZ_JAYTEST1 *

&----


REPORT zzz_jaytest1 NO STANDARD PAGE HEADING MESSAGE-ID zhrt.

  • Variable Declaration

DATA : v_form_name TYPE rs38l_fnam,

itab TYPE STANDARD TABLE OF pa0001,

w_ctrlop TYPE ssfctrlop,

w_compop TYPE ssfcompop,

w_return TYPE ssfcrescl.

SELECT * FROM pa0001 INTO TABLE itab UP TO 5 ROWS.

SORT itab BY pernr.

DELETE ADJACENT DUPLICATES FROM itab COMPARING pernr.

DATA: control TYPE ssfctrlop,

control_parameters TYPE ssfctrlop,

output_options type SSFCOMPOP.

control-preview = 'X'.

control-no_open = 'X'.

control-no_close = 'X'.

control-no_dialog = 'X'.

control-device = 'PRINTER'.

output_options-tddest = 'LOCL'.

OUTPUT_OPTIONS-TDNOPRINT = 'X'.

OUTPUT_OPTIONS-BCS_LANGU = SY-LANGU.

CALL FUNCTION 'SSF_OPEN'

EXPORTING

USER_SETTINGS = ' '

OUTPUT_OPTIONS = output_options

CONTROL_PARAMETERS = control

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.

output_options-tddest = 'LOCL'.

OUTPUT_OPTIONS-TDNOPRINT = 'X'.

OUTPUT_OPTIONS-BCS_LANGU = SY-LANGU.

CALL FUNCTION '/1BCDWB/SF00000066'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = control

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

OUTPUT_OPTIONS = output_options

USER_SETTINGS = ' '

  • IMPORTING

    • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO = w_return

    • JOB_OUTPUT_OPTIONS =

TABLES

itab = itab

  • 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.

CALL FUNCTION 'SSF_CLOSE'.

Former Member
0 Kudos

As mentioned above you could do something like this:


* For first document (code before smart form call)
    IF v_first_print IS INITIAL.
      v_first_print = 'X'.
    ELSE.
     control_parameters-no_dialog = 'X'.
     control_parameters-preview = ''.
    ENDIF.

* Call Smart Form

* After Smart Form call
   MOVE-CORRESPONDING sd_job_output_options TO output_options.

Former Member
0 Kudos

Hi,

The problem is because the print parameters (printer name) are not being passed to the smart form.

What you need to do is to call the smart form outside the loop once, capture the print parameters that the user is entering, and then default those values for the subsequent calls of the smart form.

Regards,

Ravi

Note - Please mark all the helpful answers