Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Download smartform as PDF, suppress Print/Preview dialog

Former Member
0 Kudos

Hi Experts,

Facing some issues in downloading PDF converted from Smartform.

In the program I am trying directly download a smartform converted into PDF format and save it in local system.

When ever I am trying to execute the program it shows up the Print/Preview dialog before showing the Save As dialog.

I have passed control_parameters-getotf = 'X' to the smartform runtime FM, which ideally should have suppressed the Print/Preview dialog and return the otfdata.

Here the entire code is...

Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code

The program other wise works absolutly fine .

Please advise.

Thanks

Jahan

Edited by: Rob Burbank on Apr 8, 2010 11:10 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Jaif,

Try this code:-

DATA: T_SSFCTRLOP TYPE SSFCTRLOP.   "FOR SMART FORMS
DATA: FNAME(30).
DATA: T_SSFCRESCL TYPE SSFCRESCL.   "FOR SMART FORMS AFTER PRINTING DATA TO CONVERT IN PDF FORMAT

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME = 'YFF_INVOICE' 
      IMPORTING
        FM_NAME  = FNAME.

****Pass this three parameters
  T_SSFCTRLOP-NO_DIALOG = 'X'.
  T_SSFCTRLOP-GETOTF = 'X'.
  T_SSFCTRLOP-LANGU = 'E'.

  CALL FUNCTION FNAME
    EXPORTING
      CONTROL_PARAMETERS = T_SSFCTRLOP
    IMPORTING
      JOB_OUTPUT_INFO    = T_SSFCRESCL
    TABLES
      T_FORMDATA         = T_FORMDATA.


  CALL FUNCTION 'HR_EFI_SHOW_PDF_FORM'
    EXPORTING
      TOP_EDGE  = 0
      LEFT_EDGE = 0
    TABLES
      OTF_TABLE = T_SSFCRESCL-OTFDATA.

Thanks,

Rahul Ghosh

11 REPLIES 11

Former Member
0 Kudos

Hi Jaif,

Try this code:-

DATA: T_SSFCTRLOP TYPE SSFCTRLOP.   "FOR SMART FORMS
DATA: FNAME(30).
DATA: T_SSFCRESCL TYPE SSFCRESCL.   "FOR SMART FORMS AFTER PRINTING DATA TO CONVERT IN PDF FORMAT

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME = 'YFF_INVOICE' 
      IMPORTING
        FM_NAME  = FNAME.

****Pass this three parameters
  T_SSFCTRLOP-NO_DIALOG = 'X'.
  T_SSFCTRLOP-GETOTF = 'X'.
  T_SSFCTRLOP-LANGU = 'E'.

  CALL FUNCTION FNAME
    EXPORTING
      CONTROL_PARAMETERS = T_SSFCTRLOP
    IMPORTING
      JOB_OUTPUT_INFO    = T_SSFCRESCL
    TABLES
      T_FORMDATA         = T_FORMDATA.


  CALL FUNCTION 'HR_EFI_SHOW_PDF_FORM'
    EXPORTING
      TOP_EDGE  = 0
      LEFT_EDGE = 0
    TABLES
      OTF_TABLE = T_SSFCRESCL-OTFDATA.

Thanks,

Rahul Ghosh

0 Kudos

Thanks Rahul...

This solution worked I coud directly save in PDF format from previw.

Former Member
0 Kudos

Hai

To convert Smartforms output To PDF format , we can use the SAP Program "RSTXPDFT4"

satyajit_mohapatra
Active Contributor
0 Kudos

I think the problem is the print preview is not supressed. Pass the NO_DIALOG field in CONTROL_PARAMETERS of the FM as 'X'. This will supress the print preview dialog.

Former Member
0 Kudos

Hi JAIF ,

For the below control parameter pass value as X.

CONTROL_PARAMETERS-getotf

CONTROL_PARAMETERS-no_dialog

CONTROL_PARAMETERS-PREVIEW

0 Kudos

Helloo Guyz...

I am exactly trying the same, but the Print Dialog is still coming ...

See here is my code ..

cont_param-getotf = 'X'.

cont_param-no_dialog = 'X'.

cont_param-preview = 'X' .

CALL FUNCTION fm_name

EXPORTING

control_parameters = cont_param

IMPORTING

job_output_info = otfdata

TABLES

s_bukrs = s_bukrs[]

s_gjahr = s_gjahr[]

s_rebzg = s_rebzg[]

s_kunnr = s_kunnr[]

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

even after this ..during execution the the Print Dialog is coming..

I have no idea what esle I am missing..

Thanks

0 Kudos

set

cont_param-preview = ' ' .

0 Kudos

set:

cont_param-getotf = 'X'.

cont_param-device = 'PRINTER'.

cont_param-preview = ''.

cont_param-no_dialog = 'X'.

cont_param-tddest = 'LP01'.

0 Kudos

Hello Guyz ..

It really didnt work ..after all these parameters..

I tried using same parameters and run the standalone smartform FM,

But its still showing the print dialog

Some thing we all are missing ..

0 Kudos

pass parameter TDNOPREV = 'X' in OUTPUT_OPTIONS PARAMETER and try. It should work now.

satyajit_mohapatra
Active Contributor
0 Kudos

Yes....I missed it in earlier post.....The PREVIEW parameter should be set to blank as well as told by abapuser.