cancel
Showing results for 
Search instead for 
Did you mean: 

Direct Print preview.

former_member198275
Active Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

former_member198275
Active Contributor
0 Kudos

Thanks Sravanthi my prob solved.

Answers (4)

Answers (4)

former_member198275
Active Contributor
0 Kudos

Thanks all .

Former Member
0 Kudos

Welcome Koushik,

have agreat day ahead.

pavan.

Former Member
0 Kudos

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

Pawan_Kesari
Active Contributor
0 Kudos

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

former_member198275
Active Contributor
0 Kudos

Dear Pawan Kesari ,

Thanks for ur reply . How and where to use these control parameter?

Former Member
0 Kudos

Hi Kaushik,

I had provided you with the code for your requirement use it. I had used controll parameters in the code check it.

It will solve your problem.

Thank you,

Pavan.

former_member198275
Active Contributor
0 Kudos

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.

former_member181995
Active Contributor
0 Kudos
WA_CPARAM-PREVIEW = 'X'.
former_member198275
Active Contributor
0 Kudos

Hi,

its not working. its giving "No output request open. Document processing not possible."

former_member181995
Active Contributor
0 Kudos

http://sap.retty.net/?p=21

Have a look at the question#4