‎2006 Jul 21 3:45 PM
Hi all,
I have the following situation: I need to print a form several times depending on the quantity of customers the user selects, being each customer a different form. Now, I have implemented this correctly, how ever, each time the smart form function is called within the loop the system displays the printing popup window (the one which asks for print preview, print, etc). The user doesn't want this window to be displayed every pass of the loop but up to the end of the loop, so the window is displayed just once for the set of forms. Also they want to be able to preview all the smart forms at once.
Is this possible? Your help on this will be very appreciated.
A very simplified version of the case would be the following:
DO 100 TIMES.
PERFORM display_cust_ar.
ENDDO.
FORM display_cust_ar.
DATA: cf_retcode LIKE sy-subrc.
DATA: lf_fm_name TYPE rs38l_fnam.
DATA: lf_formname TYPE tdsfname.
lf_formname = 'NAME.
SORT t_line BY kunnr.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = lf_formname
IMPORTING
fm_name = lf_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
error handling
cf_retcode = sy-subrc.
ENDIF.
CALL FUNCTION lf_fm_name
EXPORTING
p_multiple_lines = i_multiple_clients
TABLES
p_header = t_header
p_lines = t_line_final2
p_total = t_total_final
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
‎2006 Jul 21 4:28 PM
Hi Alejandro,
<b>Is your problem solved....?</b>
Since you want to display the pop-up only once for entire set, you can do like this.
<b>declare a variable called count.
declare another variable for user settings (say set).</b>
<u>Outside the loop</u>
ctrl_param-preview = space.
out_option-tddest = 'LP01'.
Within the loop, check if the count is equal to 1.
Then
put
<b>ctrl_param-no_dialog = space.
set = 'X'</b>.
Else
<b>ctrl_param-no_dialog = 'X'.
set = space</b>.
Now call the FM SSF_FUNCTION_MODULE_NAME and the generated Function Module
<b>with user_settings = set</b>
I think this should solve your problem.
<b>Close the thread once the problem is solved.</b>
Regards,
SP.
‎2006 Jul 21 3:48 PM
You need to set and send the control parameters to your form.
CONTROL_PARAMETERS TYPE SSFCTRLOP.
set the No_Dialog to 'X' and Preview to space.
‎2006 Jul 21 3:51 PM
Hi Alejandro,
The pop up window can be suppressed like this.
data: ctrl_param type ssfctrlop,
out_option type ssfcompop,
fm_name type rs38l_fnam.
<b>ctrl_param-preview = <i>space</i>.
out_option-tddest = 'LP01'. "name of the printer
ctrl_param-no_dialog = 'X'.</b>
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = gv_form
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
fm_name = 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.
call function fm_name
exporting
<b>control_parameters = ctrl_param
output_options = out_option
user_settings = space</b>
tables
itab = itab[]
exceptions
.
.
.
This will work.
<b>Close the thread once the problem is resolved.</b>
Regards,
SP.
‎2006 Jul 21 3:55 PM
Hi,
data: ls_composer_param type ssfcompop.
if count > 99
ls_composer_param-TDNOPREV = 'X' .
endif .
call function lf_fm_name
exporting
output_options = ls_composer_param
... ...
....
.
try this, I guess this should work .
Regards,
Varun
‎2006 Jul 21 4:28 PM
Hi Alejandro,
<b>Is your problem solved....?</b>
Since you want to display the pop-up only once for entire set, you can do like this.
<b>declare a variable called count.
declare another variable for user settings (say set).</b>
<u>Outside the loop</u>
ctrl_param-preview = space.
out_option-tddest = 'LP01'.
Within the loop, check if the count is equal to 1.
Then
put
<b>ctrl_param-no_dialog = space.
set = 'X'</b>.
Else
<b>ctrl_param-no_dialog = 'X'.
set = space</b>.
Now call the FM SSF_FUNCTION_MODULE_NAME and the generated Function Module
<b>with user_settings = set</b>
I think this should solve your problem.
<b>Close the thread once the problem is solved.</b>
Regards,
SP.