Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Download smartform as PDF, suppress Print/Preview dialog

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

Former Member
Former Member replied

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

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question