on 03-03-2010 2:29 AM
Hi all,
As above, I am having problem print and preview at the same time.
I can only print immediately without the preview screen, or preview screen with without print immediately (need to press the printer button to trigger print).
I have an alternative way, but it seems writing the code in not proper way, however it is working.
LS_OUTPUT_PARAM-TDNOPREV = 'X'.
LS_OUTPUT_PARAM-TDNOPRINT = SPACE.
LS_OUTPUT_PARAM-tdimmed = 'X'.
LS_OUTPUT_PARAM-tdcopies = 1.
LS_OUTPUT_PARAM-tddelete = SPACE.
LS_OUTPUT_PARAM-tdnewid = 'X'.
LS_OUTPUT_PARAM-tddest = 'LOCL'.
LS_OUTPUT_PARAM-tdFINAL = 'X'.
LS_CONTROL_PARAM-device = 'PRINTER'.
LS_CONTROL_PARAM-getotf = SPACE.
LS_CONTROL_PARAM-no_dialog = 'X'.
LS_CONTROL_PARAM-preview = ''.
call function fm_name
exporting
control_parameters = LS_CONTROL_PARAM
output_options = LS_OUTPUT_PARAM
user_settings = SPACE
customer = customer
bookings = bookings
connections = connections
importing
job_output_info = ls_job_info
exceptions formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
*Call the PRINT function again to enable preview screen display*
LS_OUTPUT_PARAM-TDNOPRINT = 'X'.
LS_CONTROL_PARAM-preview = 'X'.
call function fm_name
exporting
control_parameters = LS_CONTROL_PARAM
output_options = LS_OUTPUT_PARAM
user_settings = SPACE
customer = customer
bookings = bookings
connections = connections
importing
job_output_info = ls_job_info
exceptions formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
Is there a way to do both at the same time?
ssfctrlop-no_dialog = 'X'. "Just set this one. It gives what you want.
ssfctrlop-preview = 'X'.
ssfcompop-tdimmed = 'X'.
After set these three parameters,you can do it.
I have tested it,worked normally.
LS_OUTPUT_PARAM-TDNOPRINT = 'X'.
do not set this one.
Regard
Edited by: yang Aiolos on Mar 4, 2010 8:03 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try these code.
LS_OUTPUT_PARAM-tdimmed = 'X'.
LS_OUTPUT_PARAM-tddest = 'LOCL'.
LS_CONTROL_PARAM-no_dialog = 'X'.
LS_CONTROL_PARAM-preview = 'X'.
call function fm_name
exporting
control_parameters = LS_CONTROL_PARAM
output_options = LS_OUTPUT_PARAM
user_settings = SPACE
customer = customer
bookings = bookings
connections = connections
importing
job_output_info = ls_job_info
exceptions formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if still don't work,i have no idea.
in my system,it is working.
It works like that. Why do you want to preview as it is already printed? In applications, you always have to either print without previewing, or preview before printing, but not print then preview.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> however this is the user requirement
Ask twice the user why would you develop something different from all the other printouts, is there a good reason...
Now, if there is a good reason to do so, your "alternative way" is fine (print then preview), it works as if it was done at the same time (by the way, I wouldn't hardcode the output device name, but that's my only remark)
Solution seems to be this only (you have already mention it as well)
ls_control-no_dialog = 'X'.
*ls_control-preview = 'X'.
ls_output-tdimmed = 'X'.
Then again call the FM with following parameters for output and control data to preview the smartform
ls_control-no_dialog = 'X'.
ls_control-preview = 'X'.
*ls_output-tdimmed = 'X'.
Edited by: KULWINDER SINGH on Mar 5, 2010 8:02 AM
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.