on 08-06-2009 10:57 AM
Hi,
In my report Im calling a smartform. . Normally what happens we use
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME' then call function "FM_NAME". This gives popup with print and print preview.
Now requirement is , I only have to show the print preview of that directly. Means no popup option , direct print preview of that .
I have searched the forum but cant get the desired code. So can you help me?
Regards,
Kaushik
HI Kaushik,
w_ctrlop-no_dialog = 'X'.
w_ctrlop-PREVIEW = 'X'.
w_compop-tddest = 'LOCL'.
CALL FUNCTION '/1BCDWB/SF00000273'
EXPORTING
control_parameters = w_ctrlop
output_options = w_compop
user_settings = space
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks all .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kaushik,
See the post exactly same as your requirement
Or
To make the Smartforms to display a print preview by default without displaying the popup for print parameters use he following code.
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.
It works,
Have agreat day ahead,
Pavan.
Edited by: PAVAN CHANDRASEKHAR GANTI on Aug 6, 2009 12:14 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Fill parameters control_parameters and output_options as follows
control_parameters-no_dialog = 'X' .
control_parameters-device = 'PRINTER' .
control_parameters-preview = 'X'
output_options-tdnoprint = 'X'
output_options-tddest = printer_name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
Thnaks for ur replies. But I am not getting any o/p. I m pasting my code, im unable to understand where is the problem
LF_FORMNAME = 'ZDEEP_R_SD_PRICE_LIST_O_QUOTN'.
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.
DATA : WA_CPARAM TYPE SSFCTRLOP,
WA_OUTPUT TYPE SSFCOMPOP.
WA_CPARAM-PREVIEW = SPACE.
WA_CPARAM-NO_OPEN = 'X'.
WA_CPARAM-NO_CLOSE = 'X'.
WA_CPARAM-NO_DIALOG = 'X'.
WA_CPARAM-DEVICE = 'PRINTER'.
WA_CPARAM-GETOTF = 'X'.
WA_OUTPUT-TDDEST = 'LOCL'.
WA_OUTPUT-TDNOPREV = 'X'.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
OUTPUT_OPTIONS = WA_OUTPUT
CONTROL_PARAMETERS = WA_CPARAM
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.
CALL FUNCTION LF_FM_NAME
EXPORTING
PR_VKORG = PR_VKORG
WA_NAME1 = WA_NAME1
WA_CON_NAME = WA_CON_NAME
W_OQ = W_OQ
WA_ADD0 = WA_ADD0
WA_ADD1 = WA_ADD1
WA_ADD2 = WA_ADD2
WA_ADD3 = WA_ADD3
WA_EMAIL = WA_EMAIL
WA_INCO_D = TINC-INCO1
WA_INCO = WA_INCO
WA_SH_AG = WA_SH_AG
WA_SHIP_PER = WA_SHIP_PER
W_ZTERM = W_ZTERM
W_ZTERM_TXT = W_ZTERM_TXT
W_OQDAT = VBRK-FKDAT
W_VALID = BKPF-BLDAT
WA_TEL = KNA1-TELF1
WA_FAX = KNA1-TELFX
CONTROL_PARAMETERS = WA_CPARAM
OUTPUT_OPTIONS = WA_OUTPUT
USER_SETTINGS = SPACE
TABLES
IT_OUTPUT = IT_FINAL1.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Have a look at the question#4
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.