Smart Form Download in PDF

Hello All ,
               I have created one smart form and provided option to download the same in PDF. My Problem is that is  downloaded in PDF but at the same time my end user want to see the print preview and take the print from there itself also.
I am using the following code can some one suggest me the what need to do the change after both option will work at  the same time.
Please Note I have also made the use of property
SSFCOMPOP-TDNOPREV
But after this also issue not resolve. Some one Please suggest me the how to resolve the issue.
DATA :
      WA_FMNM        TYPE  TDSFNAME,      " Smart Forms: Form Name
      WA_CNTL        TYPE  SSFCTRLOP,     " FOR PDF PRINT
      WA_POP         TYPE  SSFCOMPOP,     " printer name
      T_OTF_FROM_FM  TYPE  SSFCRESCL,
      T_PDF_TAB      LIKE  TLINE OCCURS 0 WITH HEADER LINE,
      T_OTF          TYPE  SSFCRESCL-OTFDATA,
      W_BIN_FILESIZE TYPE  I, " BINARY FILE SIZE
      W_FILE_NAME    TYPE  STRING,
      WA_FNMD        TYPE  RS38L_FNAM.    " Name of Function Module
DATA:
      W_FORM_NAME    TYPE TDSFNAME,
      W_FMODULE      TYPE RS38L_FNAM,
      W_CPARAM       TYPE SSFCTRLOP,
      W_OUTOPTIONS   TYPE SSFCOMPOP,
      W_FILE_PATH    TYPE STRING,
      W_FULL_PATH    TYPE STRING.
SMART FORM FUNCTION MODULE
WA_FMNM  =  TEXT-113.
W_FORM_NAME  =  TEXT-113.
  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      FORMNAME                 = WA_FMNM
   IMPORTING
      FM_NAME                  = WA_FNMD
   EXCEPTIONS
     NO_FORM                  = 1
     NO_FUNCTION_MODULE       = 2
     OTHERS                   = 3
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
END FORM
WA_CNTL-GETOTF     =  'X'.
WA_CNTL-NO_DIALOG  =  'X'.
WA_CNTL-PREVIEW    =  SPACE .
WA_POP-TDDEST      = 'LP01'.
CALL FUNCTION WA_FNMD
EXPORTING
    CONTROL_PARAMETERS         =  WA_CNTL
   OUTPUT_OPTIONS             = WA_POP
    V_APPLN_OB                 = V_APPLN_OB
    V_KUNNR_OB                 = V_KUNNR_OB
    V_EBELN                    = V_EBELN
    V_CAT_NAME                 = V_CAT_NAME
    V_VAR_NAME                 = V_VAR_NAME
IMPORTING
  JOB_OUTPUT_INFO              = T_OTF_FROM_FM
  TABLES
    T_ZCNC18                   =  T_ZCNC18
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.
T_OTF[] = T_OTF_FROM_FM-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
   FORMAT                      = 'PDF'
   MAX_LINEWIDTH               = 132
IMPORTING
   BIN_FILESIZE                 = W_BIN_FILESIZE
  TABLES
    OTF                         = T_OTF
    LINES                       = T_PDF_TAB
EXCEPTIONS
   ERR_MAX_LINEWIDTH           = 1
   ERR_FORMAT                  = 2
   ERR_CONV_NOT_POSSIBLE       = 3
   ERR_BAD_OTF                 = 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 METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
EXPORTING
    PROMPT_ON_OVERWRITE = 'X'
CHANGING
    FILENAME    = W_FILE_NAME
    PATH        = W_FILE_PATH
    FULLPATH    = W_FULL_PATH
EXCEPTIONS
    CNTL_ERROR           = 1
    ERROR_NO_GUI         = 2
    NOT_SUPPORTED_BY_GUI = 3
    OTHERS = 4 .
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 'GUI_DOWNLOAD'
EXPORTING
  BIN_FILESIZE  = W_BIN_FILESIZE
  FILENAME      = W_FULL_PATH
  FILETYPE      = 'BIN'
  APPEND        = ' '
  WRITE_FIELD_SEPARATOR = ''
  HEADER                = '00'
  TRUNC_TRAILING_BLANKS = ''
  WRITE_LF              = 'X'
  COL_SELECT            = ''
  COL_SELECT_MASK       = ''
  DAT_MODE              = ''
  CONFIRM_OVERWRITE     = ''
  NO_AUTH_CHECK         = ''
  CODEPAGE              = ''
  IGNORE_CERR           = ABAP_TRUE
  REPLACEMENT           = '#'
  WRITE_BOM             = ''
  TRUNC_TRAILING_BLANKS_EOL = 'X'
TABLES
  DATA_TAB              = T_PDF_TAB
EXCEPTIONS
  FILE_WRITE_ERROR        = 1
  NO_BATCH                = 2
  GUI_REFUSE_FILETRANSFER = 3
  INVALID_TYPE            = 4
  NO_AUTHORITY            = 5
  UNKNOWN_ERROR           = 6
  HEADER_NOT_ALLOWED      = 7
  SEPARATOR_NOT_ALLOWED   = 8
  FILESIZE_NOT_ALLOWED    = 9
  HEADER_TOO_LONG         = 10
  DP_ERROR_CREATE         = 11
  DP_ERROR_SEND           = 12
  DP_ERROR_WRITE          = 13
  UNKNOWN_DP_ERROR        = 14
  ACCESS_DENIED = 15
  DP_OUT_OF_MEMORY = 16
  DISK_FULL = 17
  DP_TIMEOUT = 18
  FILE_NOT_FOUND = 19
  DATAPROVIDER_EXCEPTION = 20
  CONTROL_FLUSH_ERROR = 21
  OTHERS = 22   .
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
Swati Namdev

Hi Swati,
Pls refer the below code:
TABLES: ekko.
DATA: int_itab TYPE TABLE OF ekko WITH HEADER LINE.
DATA: wf_name TYPE rs38l_fnam.
DATA: wf_so1.
*For PDf Conversions
DATA: int_tab_otf_data TYPE ssfcrescl,
      int_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE,
      int_tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE,
      file_size TYPE i,
      bin_filesize TYPE i,
      file_name TYPE string,
      file_path TYPE string,
      full_path TYPE string,
      cparam TYPE ssfctrlop,
      outop TYPE ssfcompop.
**Preview not allowed.
outop-tddest = 'LP01'.
cparam-no_dialog = 'X'.
cparam-preview = ' '.
cparam-getotf = 'X'.
GET PARAMETER ID 'EBLEN' FIELD wf_so1.
SELECT mandt ebeln bukrs bsart ernam ekorg bedat FROM ekko INTO TABLE
int_itab WHERE ebeln = wf_so1.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname           = 'Z_SMARTFORM_FINAL2'
  IMPORTING
    fm_name            = wf_name
  EXCEPTIONS
    no_form            = 1
    no_function_module = 2
    OTHERS             = 3.
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 wf_name
  EXPORTING
    control_parameters = cparam
    output_options     = outop
    user_settings      = space
  IMPORTING
    job_output_info    = int_tab_otf_data
  TABLES
    int_itab           = int_itab.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
int_tab_otf_final[] = int_tab_otf_data-otfdata[].
CALL FUNCTION 'CONVERT_OTF'
  EXPORTING
    format        = 'PDF'
    max_linewidth = 132
  IMPORTING
    bin_filesize  = bin_filesize
  TABLES
    otf           = int_tab_otf_final
    lines         = int_pdf_tab.
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 METHOD cl_gui_frontend_services=>file_save_dialog
  CHANGING
    filename = file_name
    path     = file_path
    fullpath = full_path.
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 'GUI_DOWNLOAD'
  EXPORTING
    bin_filesize = bin_filesize
    filename     = full_path
    filetype     = 'BIN'
  IMPORTING
    filelength   = file_size
  TABLES
    data_tab     = int_pdf_tab.
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,
Ramneet Ahuja

Similar Messages

  • To convert Smart Form output to PDF format and send it via email.

    Hi Friends,
    Could any one please tell me, how to convert the Smart Forms output to PDF format and send it via email to customer. If any one have the code, kindly mail me to [email protected]
    Thanks & Regards,
    John

    Refer the links -
    how to convert smartform into pdf and send through mail
    Smartform as PDF attachment to a mail.
    smartform pdf and mail
    smartform to pdf to mail
    Regrads,
    Amit
    Reward all helpful replies.

  • Sandard Smart Form output into PDF format.

    Hi to all,
    Any one please guide me, how  to convert  sandard Smart Form output into PDF format.
    Regards,
    Thanesh

    hi thanesh,
    the below code may help you.
    data: FM_NAME TYPE RS38L_FNAM.
    DATA:       W_BIN_FILESIZE TYPE I,
          T_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
          T_PDF_TAB TYPE TLINE OCCURS 0 WITH HEADER LINE,
          W_FILESIZE TYPE I,
          WA_CTRLOP TYPE SSFCTRLOP,
          WA_OUTOPT TYPE SSFCOMPOP,
          T_OTFDATA TYPE SSFCRESCL.
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = <ur form name>
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    IMPORTING
       FM_NAME                  = FM_NAME
    EXCEPTIONS
       NO_FORM                  = 1
       NO_FUNCTION_MODULE       = 2
       OTHERS                   = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    WA_CTRLOP-GETOTF = 'X'.
    WA_CTRLOP-NO_DIALOG = 'X'.
    WA_OUTOPT-TDNOPREV = 'X'.
    call function <function module generated for ur form>
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = WA_CTRLOP
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS             = WA_OUTOPT
       USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = T_OTFDATA
      JOB_OUTPUT_OPTIONS         =
    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.
    T_OTF[] = T_OTFDATA-OTFDATA[].
    call function 'CONVERT_OTF'
    EXPORTING
       FORMAT                      = 'PDF'
       MAX_LINEWIDTH               = 132
      ARCHIVE_INDEX               = ' '
      COPYNUMBER                  = 0
    IMPORTING
       BIN_FILESIZE                = W_BIN_FILESIZE
      BIN_FILE                    =
      tables
       OTF                         = T_OTF
        LINES                       = T_PDF_TAB
    EXCEPTIONS
       ERR_MAX_LINEWIDTH           = 1
       ERR_FORMAT                  = 2
       ERR_CONV_NOT_POSSIBLE       = 3
       ERR_BAD_OTF                 = 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 'WS_DOWNLOAD'
    EXPORTING
       BIN_FILESIZE                  = W_BIN_FILESIZE
      CODEPAGE                      = ' '
       FILENAME                      = 'D:\TEST11.PDF'
       FILETYPE                      = 'BIN'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
       FILELENGTH                    = W_FILESIZE
      tables
        data_tab                      = T_PDF_TAB
      FIELDNAMES                    =
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_WRITE_ERROR              = 2
       INVALID_FILESIZE              = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 10
       OTHERS                        = 11
    if sy-subrc = 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    WRITE: / 'SUCCESSFULLY CONVERTED'.
    endif.

  • How To Get The Smart Form Into The PDF File

    Hello Friends,
    Can Any One Tell How To Get Smart Form in PDF.
    I used this RSTXPDFT4 Program.
    It is asking The Spool Number.
    How to get the Spool Number.

    the steps are
    SmartForms Output to PDF
    There is a way to download smartform in PDF format.
    Please do the following:
    1. Print the smartform to the spool.
    2. Note the spool number.
    3. Download a PDF file (Acrobat Reader) version of the spool by running Program RSTXPDFT4 and entering the
    noted spool number.
    how  to get spool number
    The simplest method is to read the spool table directly, table TSP01
    example code
    REPORT zsuresh_test.
    * Variable declarations
    DATA:
    w_form_name TYPE tdsfname VALUE 'ZSURESH_TEST',
    w_fmodule TYPE rs38l_fnam,
    w_cparam TYPE ssfctrlop,
    w_outoptions TYPE ssfcompop,
    W_bin_filesize TYPE i, " Binary File Size
    w_FILE_NAME type string,
    w_File_path type string,
    w_FULL_PATH type string.
    * Internal tables declaration
    * Internal table to hold the OTF data
    DATA:
    t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    * Internal table to hold OTF data recd from the SMARTFORM
    t_otf_from_fm TYPE ssfcrescl,
    * Internal table to hold the data from the FM CONVERT_OTF
    T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    * This function module call is used to retrieve the name of the Function
    * module generated when the SMARTFORM is activated
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = w_form_name
    * VARIANT = ' '
    * DIRECT_CALL = ' '
    IMPORTING
    fm_name = w_fmodule
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    * Calling the SMARTFORM using the function module retrieved above
    * GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
    * format of the output
    w_cparam-no_dialog = 'X'.
    w_cparam-preview = space. " Suppressing the dialog box
                                                        " for print preview
    w_cparam-getotf = 'X'.
    * Printer name to be used is provided in the export parameter
    * OUTPUT_OPTIONS
    w_outoptions-tddest = 'LP01'.
    CALL FUNCTION w_fmodule
    EXPORTING
    * ARCHIVE_INDEX =
    * ARCHIVE_INDEX_TAB =
    * ARCHIVE_PARAMETERS =
    control_parameters = w_cparam
    * MAIL_APPL_OBJ =
    * MAIL_RECIPIENT =
    * MAIL_SENDER =
    output_options = w_outoptions
    * USER_SETTINGS = 'X'
    IMPORTING
    * DOCUMENT_OUTPUT_INFO =
    job_output_info = t_otf_from_fm
    * JOB_OUTPUT_OPTIONS =
    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.
    t_otf[] = t_otf_from_fm-otfdata[].
    * Function Module CONVERT_OTF is used to convert the OTF format to PDF
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    * ARCHIVE_INDEX = ' '
    * COPYNUMBER = 0
    * ASCII_BIDI_VIS2LOG = ' '
    * PDF_DELETE_OTFTAB = ' '
    IMPORTING
    BIN_FILESIZE = W_bin_filesize
    * BIN_FILE =
    TABLES
    otf = T_OTF
    lines = T_pdf_tab
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    ERR_BAD_OTF = 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.
    * To display File SAVE dialog window
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    * EXPORTING
    * WINDOW_TITLE =
    * DEFAULT_EXTENSION =
    * DEFAULT_FILE_NAME =
    * FILE_FILTER =
    * INITIAL_DIRECTORY =
    * WITH_ENCODING =
    * PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = w_FILE_NAME
    path = w_FILE_PATH
    fullpath = w_FULL_PATH
    * USER_ACTION =
    * FILE_ENCODING =
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 3
    others = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    * Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
    * presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = W_bin_filesize
    filename = w_FULL_PATH
    FILETYPE = 'BIN'
    * APPEND = ' '
    * WRITE_FIELD_SEPARATOR = ' '
    * HEADER = '00'
    * TRUNC_TRAILING_BLANKS = ' '
    * WRITE_LF = 'X'
    * COL_SELECT = ' '
    * COL_SELECT_MASK = ' '
    * DAT_MODE = ' '
    * CONFIRM_OVERWRITE = ' '
    * NO_AUTH_CHECK = ' '
    * CODEPAGE = ' '
    * IGNORE_CERR = ABAP_TRUE
    * REPLACEMENT = '#'
    * WRITE_BOM = ' '
    * TRUNC_TRAILING_BLANKS_EOL = 'X'
    * WK1_N_FORMAT = ' '
    * WK1_N_SIZE = ' '
    * WK1_T_FORMAT = ' '
    * WK1_T_SIZE = ' '
    * IMPORTING
    * FILELENGTH =
    tables
    data_tab = T_pdf_tab
    * FIELDNAMES =
    * EXCEPTIONS
    * FILE_WRITE_ERROR = 1
    * NO_BATCH = 2
    * GUI_REFUSE_FILETRANSFER = 3
    * INVALID_TYPE = 4
    * NO_AUTHORITY = 5
    * UNKNOWN_ERROR = 6
    * HEADER_NOT_ALLOWED = 7
    * SEPARATOR_NOT_ALLOWED = 8
    * FILESIZE_NOT_ALLOWED = 9
    * HEADER_TOO_LONG = 10
    * DP_ERROR_CREATE = 11
    * DP_ERROR_SEND = 12
    * DP_ERROR_WRITE = 13
    * UNKNOWN_DP_ERROR = 14
    * ACCESS_DENIED = 15
    * DP_OUT_OF_MEMORY = 16
    * DISK_FULL = 17
    * DP_TIMEOUT = 18
    * FILE_NOT_FOUND = 19
    * DATAPROVIDER_EXCEPTION = 20
    * CONTROL_FLUSH_ERROR = 21
    * OTHERS = 22
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Do reward if helpful
    Edited by: sharad narayan on Apr 4, 2008 2:14 PM
    Edited by: sharad narayan on Apr 4, 2008 2:18 PM

  • Smart Form convert to Pdf and send to email

    hi,
    ive dev the smart for me21n. its  working fine. Standard programme is SAPLMEGUI.
    now new requirement is , convert the smart form to pdf and then sending the pdf through email to customer.
    Can any plz tell me is there any stadard programme or else need to custmise the print programme?
    Regards

    Kirans belong to convert the smart form to pdf.
    there is standard programme RSTXPDFT4
    but after convert the form to pdf. i need to send it thorough mail.
    iam checking other link one which is send by mr.naresh..
    thank you
    Regards

  • Converting smart forms as a pdf in different languages

    Hi Experts,
    I have been created a smart form and later on i converted it to in pdf also, but how can i convert a smart form output into different languages (English(defualt), German, Italian, French, Spanish,). Can anyone tell me about the idea behind this or a simple demo program???????????
    do i need to maintain each text on the smart form into these languages already through SE63 or somewhere any idea that can help me without translating the whole text into those languages, could be able to do pdf conversion.
    Thanks and Regards,
    Shakun

    The OTF data needs to already be in the target language - the conversion process is a process of changing the document format only, not a translation tool.

  • Smart forms convert to pdf binary data

    Dear All,
    I'm working on smart forms integrations with .net and  I need to send the smart forms PDF binary data though custom rfc .
    For that i'm  converting smart forms otf  data  to pdf in and pass this data  through rfc but this idata is is not wokring on .net guys when they are converting this on pdf..
    so is there any need of decoded smart forms otf data before passing through or i'm missing some basic step?
    Please guide me?
    Rg
    Anuj

    hi,
    Have a look on this wiki:
    [http://wiki.sdn.sap.com/wiki/display/Snippets/SmartformoutputtoPDFformat]
    And maybe this one could also interest you:
    [|http://wiki.sdn.sap.com/wiki/display/Snippets/SmartformtoMailasPDF+attachment]
    regards
    mickael

  • Regading  smart form printpreview to pdf

    <<Do not post duplicate questions. >>
    i have one smart created with one custem page format . 400 * 1100 . that smart form attached to vfo3 transcation .
    when iam seeing printpreviw is ok . but when iam converting this print preview to pdf . the last data missing in page .
    but in print preview half page only . but not getting full data .
    any one suggest me .
    Edited by: Matt on Jul 20, 2010 2:05 PM

    hi ,
            your check with window size and  Alignments
    Regards,
    Ansari

  • Smart form downloaded into .xml file ??.

    Hi all,
    When a smart form is downloaded, it gets downloaded as a .xml file.
    My question is, how does it get converted to .xml file.
    <i>Is there any</i> <u>function module</u> that is called and <i>if so</i> <u>what</u> is the function module.

    Hi,
    You can download into XML format. However, it's not sure about uploading. Refer to the program <b>'SF_XSF_DEMO'</b>.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
    Feel free to revert back.
    --Ragu

  • Smart Form Download

    Hi all,
    When a smart form is downloaded it gets downloaded as .xml file.
    The question is, how does the smart form get converted to xml file. Is there any function module that is called when we download it and if so what is the function module.

    Hi
    These are the two standard function modules when we download the smart form.
    FUNCTION SDIXML_DATA_TO_DOM.
    and
    FUNCTION SDIXML_DOM_TO_XML'.  
    Hope this will definitely help you.
    Please reward suitable points.
    Regards
    - Atul

  • 4.6 C Smart Form Download

    Is there any program to dowm load and upload smart form in 4.6 version.
    Thank you.

    Hi AP,
    The download and upload utilities are available from 4.7 onward.
    Bur you can check this link for custom program which downloads the SmartForm as well as Smartstyles.
    http://sap4.com/wiki/index.php?title=ZSMART_FORM_UPLOAD_DOWNLOAD
    Hope this will help.
    Regards,
    Ferry Lianto

  • Smart form otf to pdf

    what are procedure shld follow  to download a smartform into pdf.
    i am calling directly smartform from the generated function by passing final table .

    go through this link, this might help you to guide about the complete process
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c8/4adf7ba13c4ac1b4600d4df15f8b84/frameset.htm
    http://sap.ittoolbox.com/documents/popular-q-and-a/displaying-a-pdf-file-in-place-2797
      Re: Smartform to PDF  
    Posted: Oct 10, 2006 12:37 PM    in response to: Rama krishna S       Reply      E-mail this post 
    Hi,
    Check this link...
    http://sap4.com/wiki/index.php?title=Genera_PDF_a_partir_de_Smartforms
    Please go through this link , hope you will get useful stuff from this.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/62ae7fcd-0b01-0010-3e9d-a54f26944450
    *& Form f9100_save_to_pdf
    text
    -->P_WS_FORMNAME text
    FORM f9100_save_to_pdf using value(ws_formname).
    data: i_lines TYPE tline OCCURS 0 WITH HEADER LINE.
    data: ws_bin_size type i,
    ws_filename type string.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    max_linewidth = 132
    IMPORTING
    bin_filesize = ws_bin_size
    TABLES
    otf = i_otf
    lines = i_lines
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    err_bad_otf = 4
    OTHERS = 5.
    IF sy-subrc <> 0.
    flg_exit = 'X'.
    MESSAGE i050 WITH 'Error converting to PDF format'.
    EXIT.
    ENDIF.
    Get the download path
    PERFORM get_download_path CHANGING ws_filename.
    if flg_exit = 'X'.
    EXIT.
    endif.
    Download
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = ws_bin_size
    filename = ws_filename
    filetype = 'BIN'
    TABLES
    data_tab = i_lines
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    OTHERS = 22.
    IF sy-subrc <> 0.
    MESSAGE i050 WITH 'Error while File download'.
    flg_exit = 'X'.
    EXIT.
    ELSE.
    MESSAGE i050 WITH 'File downloaded successfully '.
    flg_exit = 'X'.
    EXIT.
    ENDIF.
    Refer the following link for more details:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Please Refer this,
    https://forums.sdn.sap.com/click.jspa?searchID=5369529&messageID=3814804
    rEGARDS
    VASU

  • Smart form conversion in PDF

    Hi Guys,
    I have one query in the smartforms, I can able to convert the smartform to PDF and saving the PDF in my DESKTOP directly with showing the POP_UP, when i choose the print preview in the POP-UP screen.
    *My Requirement is : I need to display the PDF details first and later i will chose the save option, Could you add your comments.
    As of now i am using below code the PDF saving in the DESKTOP, Could any ple add your suggestion how to show the PDF with out saving the PDF.
    CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          FORMAT                = 'PDF'
        IMPORTING
          BIN_FILESIZE          = LOC_PDF_LEN
        TABLES
          OTF                   = INT_OTF
          LINES                 = IT_LINES
        EXCEPTIONS
          ERR_MAX_LINEWIDTH     = 1
          ERR_FORMAT            = 2
          ERR_CONV_NOT_POSSIBLE = 3
          ERR_BAD_OTF           = 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.
    To display File SAVE dialog window
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
        CHANGING
          FILENAME             = LOC_FILE_NAME
          PATH                 = LOC_FILE_PATH
          FULLPATH             = LOC_FULL_PATH
        EXCEPTIONS
          CNTL_ERROR           = 1
          ERROR_NO_GUI         = 2
          NOT_SUPPORTED_BY_GUI = 3
          OTHERS               = 4.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
    presentation server
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          BIN_FILESIZE            = LOC_PDF_LEN
          FILENAME                = LOC_FULL_PATH
          FILETYPE                = 'BIN'
        TABLES
          DATA_TAB                = IT_LINES
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          OTHERS                  = 22.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

    Hi
    If you mean to see the pdf file before saving it, it's possible to see the print of the sf only.
    If you mean to open the pdf file after saving it:
    CALL FUNCTION 'CALL_BROWSER'
           EXPORTING
                URL                    = LOC_FILE_NAME
           EXCEPTIONS
                FRONTEND_NOT_SUPPORTED = 1
                FRONTEND_ERROR         = 2
                PROG_NOT_FOUND         = 3
                NO_BATCH               = 4
                UNSPECIFIED_ERROR      = 5
                OTHERS                 = 6.
    Max

  • Smart form: Spool to PDF Conversion more than 100 pages.

    Hi folks,
    I have an issue with Function Module (FM) CONVERT_ABAPSPOOLJOB_2_PDF when the report to be converted has more than 100 pages.....i have explained this scenario as below
    We have been using the FM CONVERT_ABAPSPOOLJOB_2_PDF to convert ABAP report to PDF file and then send this via mail using FM SO_DOCUMENT_SEND_API1.....
    PDF conversion using FM CONVERT_ABAPSPOOLJOB_2_PDF works well if the number of report pages is less than 100....i.e the table pdf of the FM will contain the output as expected.....
    If the report has more than 100 pages, the the FM CONVERT_ABAPSPOOLJOB_2_PDF will schedule the conversion job as a background job and returns with a SY-subrc eq 0 and the table parameter pdf will ne empty.
    Could you suggest me a woorkaround in this situtaion...i.e how do I then get the output of the background job
    And  any process to convert Spool to PDF if having more than 100 pages.
    Thanks in Advance............

    Pb,
    If the report has more than 100 pages, the the FM CONVERT_ABAPSPOOLJOB_2_PDF will schedule the conversion job as a background job and returns with a SY-subrc eq 0 and the table parameter pdf will ne empty
    i would suggest you to if pages are more than 100 than you need to send report output to sp01 with spool request number by using fm job_open..job_close..
    than from sp01 you can convert pdf by running RSTXPDFT4 in se38.
    hope this would solve your problem.
    Amit.

  • Probelm in Smart forms Download/upload into Ecc6.0

    Dear Friends,
    i m working on Sap4.6c version i want to download smartform(report) from 4.6c and upload it into ECC6 so is there is any utility to do this.
    regarding sapscript there is one program rstxscrp to do this, is there is any such program for smartform.
    thanks in advance
    regards,
    Bhaskar.

    Hi,
    I dont think it is available.
    Save the smartforms in a  request and ask the Basis to transport to the ECC6.0 system.
    This is very simple and easy to do, as you will not miss out anything even if you had to redo the same in Ecc6.0
    Regards
    Subramanian

Maybe you are looking for