07-12-2006 12:32 PM
Hi
I developed one smartform for the single/multiple Outbond deleviry. When I execute the query with same range then print window opened and after click print button Document priented. But when I try to execute the query with range suppose 0001 to 0003 then Print window opened and click the print the 0001 doc and again click print button for 0002 and so on.
I would like to , how we take a print on single click print button.
pls help me it's urget.
Thanks in advance
Tapovardhan
07-12-2006 12:36 PM
I think you must be calling the smartform function module inside a loop.
in the export parameters for the function module print parameters, ther ewill be an option for no dialog. Check that for sy-tabix <> 1 in the loop.
loop at itab.
if sy-tabix = 1.
print_params-no_dialog = space.
else.
print_params-no_dialog = 'X'.
endif.
call function '!@SGFCDHGFJHBK'
endloop.
P.S: Not sure of the field name it will be there in "options"
Regards,
ravi
07-12-2006 12:36 PM
I think you must be calling the smartform function module inside a loop.
in the export parameters for the function module print parameters, ther ewill be an option for no dialog. Check that for sy-tabix <> 1 in the loop.
loop at itab.
if sy-tabix = 1.
print_params-no_dialog = space.
else.
print_params-no_dialog = 'X'.
endif.
call function '!@SGFCDHGFJHBK'
endloop.
P.S: Not sure of the field name it will be there in "options"
Regards,
ravi
07-13-2006 5:18 AM
Thanks Ravi
But after adding code this error comes.
Field "PRINT_PARAMS-NO_DIALOG" is unknown. It is neither in one of the
specified tables nor defined by a "DATA" statement. "DATA" statement.
For define the PRINT_PARAMS what would be the type.
Our code is given below.
REPORT ZTESTPCLDI.
tables : likp.
select-options : s_vbeln for likp-vbeln.
data : itab_likp type standard table of likp with header line.
DATA : FORM_NAME TYPE RS38L_FNAM.
data : print_params type SSFCTRLOP.
start-of-selection.
select * from likp into table itab_likp
where vbeln in s_vbeln.
end-of-selection.
loop at itab_likp.
if sy-tabix <> 1.
print_params-no_dialog = space.
else.
print_params-no_dialog = 'X'.
endif.
CALL FUNCTION '/1BCDWB/SF00000045'
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
wa_likp = itab_likp
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
NEw-PAGE.
endloop.
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,
07-13-2006 5:24 AM
Try to do this.
DATA : CONTROL_PARAM LIKE SSFCTRLOP.
CLEAR CONTROL_PARAM-NO_DIALOG .
You should pass this to the smart form, you are not passing it anywhere
CALL FUNCTION '/1BCDWB/SF00000045'
<b> EXPORTING </b>
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
<b> CONTROL_PARAMETERS = CONTROL_PARAM </b>
Regards,
Ravi
Note : Please mark the helpful answers
07-13-2006 5:25 AM
Hi Tapovardhan,
I have copied the same code in my system.Its not giving any error.Please check once more where you are getting error.
Data : g_control TYPE ssfctrlop.
g_control-no_dialog = 'X'.
*Calling Smartform
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = g_form
IMPORTING
fm_name = g_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
CALL FUNCTION g_fm_name
EXPORTING
control_parameters = g_control
output_options = g_output
user_settings = ' '
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
Check it
Message was edited by: mukesh kumar
07-12-2006 12:40 PM
You will have to capture the values the user enters for the PRINTER DETAILS, NO. OF COPIES (if you are not passing them) and pass that to the smart form.
There is a parameter called DIALOG which set to X will throw the dialog and when set to X will not throw the dialog. So, once you have the parameters you will have to control that DIALOG parameter so that the popup does not happen.
Regards,
Ravi
Note : Please mark all the helpful answers
07-12-2006 1:28 PM
Thanks Ravi
But after adding code this error comes.
Field "PRINT_PARAMS-NO_DIALOG" is unknown. It is neither in one of the
specified tables nor defined by a "DATA" statement. "DATA" statement.
For define the PRINT_PARAMS what would be the type.
regards,
07-12-2006 2:30 PM
I believe that should be CONTROL_PARAMETERS of type SSFCTRLOP. CONTROL_PARAMETERS-NO_DIALOG
07-12-2006 12:51 PM
i understand it as
if u have three documetns to print its asking u print option thrice
well what u are doing is calling the smartfom in a loop
and passing one record each and prnting it
rather
pass an internal table of data and use table option inside the smartform
Harish