cancel
Showing results for 
Search instead for 
Did you mean: 

multiple documents in smartform without going thru Print option screen

Former Member
0 Kudos

Hi Gurus,

I am printing a form with 3 pages using Smartforms. The requirement is to print these document for each customer. I have the customer numbers and their info stored in it_tax. I loop through it and call the functions within the loop. But the problem is it brings out the print option pop up window for every customer. How do I get rid of this? I wanted to have it to click Print or Print Preview just one time and all the customer documents will be printed

this is how i code it

LOOP AT it_tax.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZIDWTCERT_PH_1606'

IMPORTING

fm_name = fm_name

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

ENDIF.

CALL FUNCTION fm_name

EXPORTING

gv_rate = lv_rate

gv_hkont = lv_hkont

  • IMPORTING

  • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO =

  • JOB_OUTPUT_OPTIONS =

TABLES

gt_tax = it_tax

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

endloop.

I hope you can help me with my problem

Thanks!

Edited by: Jill Chou on Aug 19, 2008 12:09 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

based on selection screen fields customer no and info stored, retrive the data into it_tax.

in the main window create loop in that create alternate node in that you need to mention condition

under condition node it will come true and false statements

under TRUE NODE create COMMAND node

in command node check the box go to new page

in condition tab mention condition.

regards

bhupal

Answers (4)

Answers (4)

former_member206454
Participant
0 Kudos

Hi 

Jill chou
   I was also facing the same problem and I resolved it.
   In control_parameters there are two parameter
   no_option and no_close

Note:-NO_OPEN
AND NO_CLOSE parameter of CONTROL_PARAMETERS are used to include
several forms into one print request. When calling the generated
functions modules, set the parameters as follows:

•1st call:
     NO_OPEN = SPACE.
     NO_CLOSE = 'X'.
•nth call:
     NO_OPEN = 'X'.
     NO_CLOSE = 'X'.
•last call:
     NO_OPEN = 'X'.
     NO_CLOSE = SPACE .

Do like following sample coding it will be done...

data:
  control_parameters  type ssfctrlop,
     w_cnt type I,
     w_cnt2 type I.

call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
      formname           = 'ZCUSTOMER_LEDGER'     
    importing
      fm_name            = fname
    exceptions
      no_form            = 1
      no_function_module = 2
      others             = 3.


  if sy-subrc <> 0.
    message 'Wrong Smartform Name' type 'E'.
  endif.
************************** CHANGE FROM HERE
  describe table it_tab lines w_cnt.

  loop at it_tab into st_tab.
    w_cnt2 = sy-tabix .
    case w_cnt2.
      when 1.
        control_parameters-no_open   = space .
        control_parameters-no_close  = 'X' .
      when w_cnt .
        control_parameters-no_open   = 'X' .
        control_parameters-no_close  = space .
      when others.
        control_parameters-no_open   = 'X' .
        control_parameters-no_close  = 'X' .
    endcase.

    call function fname
      exporting
        control_parameters         = control_parameters
        w_kunnr                    = st_tab-kunnr
        w_bukrs                    = p_bukrs
        w_bdat_l                   = s_budat-low
        w_bdat_h                   = s_budat-high

Former Member
0 Kudos

Hi jill,

In the SSF_OPEN function module,

Set the OUTPUT OPTIONS paramter TDDEST to your printer name.

Set the CONTROL PARAMETERS and control parameters as shown below,

control-preview = 'X'.

control-no_open = 'X'.

control-no_close = 'X'.

control-no_dialog = 'X'.

control-device = 'PRINTER'.

control_parameters-no_dialog = 'X'.

control_parameters-no_open = 'X'.

control_parameters-no_close = 'X'.

OUTPUT_OPTIONS-TDDEST = 'PRINTER NAME'.

OUTPUT_OPTIONS-TDNOPRINT = 'X'.

CALL FUNCTION 'SSF_OPEN'

EXPORTING

output_options = output_options

control_parameters = control

user_settings = ' '

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.

Regards,

Sravanthi

Former Member
0 Kudos

i agree. ^^

you can use a flag such that in your loop, the print dialog will only show once (first loop), and then supress the succeedding dialog to pop.

Former Member
0 Kudos

thanks everyone for your answers... i just made a condition on the nodes in smartform ^^

Former Member
0 Kudos

look into the output options or in the control options so as to suppress the dialog.

parameter some thing like DIALOG or NO_DIALOG.

Former Member
0 Kudos

Hi,

I guess that would be difficult... but you can try this

populate the structure OUTPUT_OPTIONS of type SSFCTRLOP and pass it to the function module generated by smartform.

regards

padma