Problem in converting script o/p to PDF

Hi,
    Iam trying to convert a script output into  PDF that gets saved on C drive.I have used 'Convert_OTF'
FM .now ewhen i try to print preview in VA02 (sales order).it says "OTF end command // missing in OTF". any help wud be appreciated.
Thanks,
Naren

Hi naren,
DATA: i_otf LIKE itcoo OCCURS 100 WITH HEADER LINE,
      i_pdf LIKE tline OCCURS 100 WITH HEADER LINE,
      i_opt like itcpo occurs 0 with header line.  
i_opt-TDGETOTF = 'X'.
append i_opt.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
   APPLICATION                       = 'TX'
   FORM                              = 'ZTEST_SCRIPT1'
   LANGUAGE                          = SY-LANGU
   OPTIONS                           = i_opt 
EXCEPTIONS
   CANCELED                          = 1
   DEVICE                            = 2
   FORM                              = 3
   OPTIONS                           = 4
   UNCLOSED                          = 5
   MAIL_OPTIONS                      = 6
   ARCHIVE_ERROR                     = 7
   INVALID_FAX_NUMBER                = 8
   MORE_PARAMS_NEEDED_IN_BATCH       = 9
   SPOOL_ERROR                       = 10
   CODEPAGE                          = 11
   OTHERS                            = 12
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 'WRITE_FORM'
EXPORTING
   ELEMENT                        = 'TEXT'
   FUNCTION                       = 'SET'
   TYPE                           = 'BODY'
   WINDOW                         = 'HEADER'
* IMPORTING
*   PENDING_LINES                  =
* EXCEPTIONS
*   ELEMENT                        = 1
*   FUNCTION                       = 2
*   TYPE                           = 3
*   UNOPENED                       = 4
*   UNSTARTED                      = 5
*   WINDOW                         = 6
*   BAD_PAGEFORMAT_FOR_PRINT       = 7
*   SPOOL_ERROR                    = 8
*   CODEPAGE                       = 9
*   OTHERS                         = 10
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 'CLOSE_FORM'
* IMPORTING
*   RESULT                         =
*   RDI_RESULT                     =
TABLES
   OTFDATA                        = i_otf
EXCEPTIONS
   UNOPENED                       = 1
   BAD_PAGEFORMAT_FOR_PRINT       = 2
   SEND_ERROR                     = 3
   SPOOL_ERROR                    = 4
   CODEPAGE                       = 5
   OTHERS                         = 6
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 'CONVERT_OTF'
EXPORTING
   format                      = 'PDF'
*   MAX_LINEWIDTH               = 132
*   ARCHIVE_INDEX               = ' '
*   COPYNUMBER                  = 0
*   ASCII_BIDI_VIS2LOG          = ' '
*   PDF_DELETE_OTFTAB           = ' '
* IMPORTING
*   BIN_FILESIZE                =
*   BIN_FILE                    =
  TABLES
    otf                         = i_otf
    lines                       = i_pdf
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 'GUI_DOWNLOAD'
  EXPORTING
*   BIN_FILESIZE                    =
    filename                        = 'c:\test_pdf.pdf'
   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                      = ' '
*   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
* IMPORTING
*   FILELENGTH                      =
  tables
    data_tab                        = i_pdf
*   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.
Regards,
Sravanthi

Similar Messages

  • Converting Script from OTF to PDF format

    Hi Experts,
    Using FM CONVERT_OTF in SAP Script print program I am converting data of Script from OTF to PDF format but the data in PDF document srinks and looks like slightly overlapping one leter on the other, can any ony please tell me that how can I avaoid this.
    Thanks in Advance
    Best Regards
    Venkat

    Dear Venkatesh,
    I have the same scenario. I have to convert Script to PDF and then write it to FTP Server.
    Could you please provide me the code which you have used?
    Regards,
    Chaitanya A

  • Abobe v8: Problems with converting from word 2003 to PDF

    I use one of those free conversion tools, since i am a student. My problem is that i have a word document with a unique page margin. When i convert from word 2003 to pdf everything gets converted except the page margin which is much bigger then it's supposed to be. Do anyone know how i can fix that?, any help are appriciated.
    Kindly Erik

    You cannot fix anything in Reader. If you have a problem with the tool
    used to create your pdf, please ask in their forum.
    Mike

  • How to convert script o/p to pdf o/p

    Hi All,
        I have a requirement where i need to convert script output to pdf output. What is the function moodule available ? Please help me in this regard asap.
    Regards
    Lakshmi

    Hi,
    Try this sample code and reward points by clicking the star on the left of reply,if it helps you.
    REPORT  zzz_jaytest .
    Types Declaration
    TYPES : BEGIN OF ty_pa0001,
            pernr TYPE pa0001-pernr,
            bukrs TYPE pa0001-bukrs,
            werks TYPE pa0001-werks,
            END OF ty_pa0001.
    Internal Table Declaration
    DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001,  "For pa0001 Details
           i_otf TYPE STANDARD TABLE OF itcoo,         "For OTF data
           i_content_txt TYPE soli_tab,                "Content
           i_content_bin TYPE solix_tab,               "Content
           i_objhead TYPE soli_tab,
    Work Area Declaration
           w_pa0001 TYPE ty_pa0001,                    "For pa0001 Details
           w_res TYPE itcpp,                           "SAPscript output
                                                       "parameters
           w_otf TYPE itcoo,                           "For OTF
           w_pdf TYPE solisti1,                        "For PDF
           w_transfer_bin TYPE sx_boolean,             "Content
           w_options TYPE itcpo,                       "SAPscript output
                                                       "interface
    Variable Declaration
           v_len_in TYPE so_obj_len,
           v_size TYPE i.
    Constants Declaration
    CONSTANTS : c_x TYPE c VALUE 'X',                         "X
                c_locl(4) TYPE c VALUE 'LOCL',                "Local Printer
                c_otf TYPE sx_format VALUE 'OTF',             "OTF
                c_pdf TYPE sx_format VALUE 'PDF',             "PDF
                c_printer TYPE sx_devtype VALUE 'PRINTER',    "PRINTER
                c_bin TYPE char10 VALUE 'BIN',                "BIN
                c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading
                                                              "File Name
                c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'.        "Form Name
    START-OF-SELECTION.
    Selecting the records from pa0001
      SELECT pernr bukrs werks FROM pa0001
      INTO TABLE i_pa0001 UP TO 10 ROWS.
    Setting the options
      w_options-tdcopies   = 1 ."Number of copies
      w_options-tdnoprev   = c_x."No print preview
      w_options-tdgetotf   = c_x."Return of OTF table
      w_options-tddest     = c_locl."Spool: Output device
    Opening the form
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          form     = c_form
          device   = c_printer
          language = sy-langu
          OPTIONS  = w_options
        IMPORTING
          RESULT   = w_res.
      LOOP AT i_pa0001 INTO w_pa0001.
    Writting into the form
        CALL FUNCTION 'WRITE_FORM'
          EXPORTING
            element = 'MAIN'
            window  = 'MAIN'.
      ENDLOOP.
    Closing the form
      CALL FUNCTION 'CLOSE_FORM'
        IMPORTING
          RESULT                   = w_res
        TABLES
          otfdata                  = i_otf
        EXCEPTIONS
          unopened                 = 1
          bad_pageformat_for_print = 2
          send_error               = 3
          spool_error              = 4
          codepage                 = 5
          OTHERS                   = 6.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Converting OTF data to single line
      LOOP AT i_otf INTO w_otf.
        CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
                                          INTO w_pdf.
        APPEND w_pdf TO i_content_txt.
      ENDLOOP.
    Converting to PDF Format
      CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
        EXPORTING
          format_src      = c_otf
          format_dst      = c_pdf
          devtype         = c_printer
        CHANGING
          transfer_bin    = w_transfer_bin
          content_txt     = i_content_txt
          content_bin     = i_content_bin
          objhead         = i_objhead
          len             = v_len_in
        EXCEPTIONS
          err_conv_failed = 1
          OTHERS          = 2.
      v_size = v_len_in.
    Downloading the PDF File
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          bin_filesize = v_size
          filename     = c_name
          filetype     = c_bin
        TABLES
          data_tab     = i_content_bin.

  • More problems while converting hyperlinks in word to pdf - missing first words

    I'm using Microsoft Office Word 2007 and Adobe Acrobat 9 Pro Extended (I think on Windows XP).
    If I have a word document with a working hyperlink when I convert it to PDF (using the Acrobat button in Word)I end up with a working hyperlink in the pdf file but it is missing the first word. For example :
    in Word the hyperlinked phrase will be http:/tinyurl.com/MarinaBloj but in the pdf version it will be :/tinyurl.com/MarinaBloj
    or
    in Word the hypelinked phrase will be "Sensitivity to luminance and chromaticity gradients in a complex scene." but in the pdf version it will be " to luminance and chromaticity gradients in a complex scene." with an extra blank space.
    worse, if in the word it is a single word, say "PDF" then all you get in the created pdf document is " " i.e. a blank space that is actually is a hyperlink (you can see the corresponding address if you hover the mouse).

    I am experiencing the exact problem...hyperlinks work after conversion from Word to pdf however first word is missing. I can only reproduce the problem on one computer. Other computers I have tried it on do not have that problem. Here is a work around i found....You can select the entire document (Ctrl + Shift + End from the beginning), then go to "Create PDF". Go into Options and select the "Selection" option. Then proceed to convert the document. It's a workaround but I'd like to know what the cause of the problem is.

  • Problem in converting to PDF

    Hi,
    i am facing a strange problem while converting the book file to pdf...
    Error message:
    %%[ ProductName: Distiller ]%%
    %%[Page: 1]%%
    %%[Page: 2]%%
    %%[ Error: ioerror; OffendingCommand: readstring ]%%
    Stack:
    (====;;;;;;::::9998877755554444222222222-\)&# ...)
    -file-
    -mark-
    -save-
    %%[ Flushing: rest of job (to end-of-file) will be ignored ]%%
    %%[ Warning: PostScript error. No PDF file produced. ] %%
    I think its with the encapsulated post script files I use in the book.
    please help me to resolve this issue...
    Thanks...

    PostScript language level 2 dates back to 1990. PostScript language level 3 was announced in 1996 with first devices shipping in 1997. Adobe Acrobat Distiller is effectively an Adobe PostScript 3 device as of Acrobat 4.0. At Adobe, we know of no problems associated with processing of properly generated PostScript language level 3 files by Distiller.
    In terms of what may appear in an EPS file, the major areas of difference would be in use of smooth-shaded gradients in language level 3 as opposed to adjacent similar polygons or images to represent gradients in language level 2.
    Ironically, changing the settings of the Adobe PDF PostScript printer driver instance for PostScript language level (the Distiller itself has no such setting) does
    not affect the placed EPS (or EPS derived from placed PDF) in your FrameMaker document. The PostScript text in the EPS is simply passed through the driver unchanged, regardless of the driver's PostScript language level setting, to the Distiller. The setting you changed affected only the PostScript generated from non-EPS components of your FrameMaker document.
    I cannot rationally explain the symptoms you experienced and why the driver setting change you made resolved the symptoms without looking at your files and knowing exactly how they were generated. It is possible that the problem has nothing to do whatsoever with your EPS files! :-)
    - Dov

  • Problem in converting some images

    Hi all,
    I have a problem when converting a word document in pdf (using acrobat 9). If i use the standard settinings, everything works fine. If I use personalised options to mantain bookmarks and links in the final pdf, some images (png) after the conversion appear with some black stripes on top of them.
    Does someone encountered the same problem?
    Thank You!

    Sorry for the delay in my response. I was on vacation.
    I tried following code (giving the type as related). But still it didn't work out :(
    I am sure i am doing some silly mistake. I guess mistake is in how i use cid:imageDo i need to use four unique cid tag if i attach four images? If yes can someone help me how? Thanks
    MimeMultipart multiPart = new MimeMultipart("related");
    MimeBodyPart msgBody = new MimeBodyPart();
    String htmlText = content+"<H1></H1><img src=\"cid:image\">";
    msgBody.setContent(htmlText, "text/html");
    multiPart.addBodyPart(msgBody);
    File folder = new File("./result");
    File[] listOfFiles = folder.listFiles();
    for (int i = 0; i < listOfFiles.length; i++)
    MimeBodyPart attachmentPart = new MimeBodyPart();
    FileDataSource fds = new FileDataSource(listOfFiles.getAbsolutePath());
    attachmentPart.setDataHandler(new DataHandler(fds));
    attachmentPart.setFileName(listOfFiles[i].getName());
    attachmentPart.setHeader("Content-Type", "image/png" );
    //attachmentPart.setDisposition("inline");
    attachmentPart.setHeader("Content-ID","image"+i);
    mp.addBodyPart(attachmentPart);
    System.out.println("Attached the file " + listOfFiles[i].getAbsolutePath());
    mess.setContent(multiPart);

  • Problem in converting Spool Request into PDF format

    Hi,
      I am facing problem to convert spool request (which store output of sap script) in to PDF format. Actually I have converted it with function module 'CONVERT_OTFSPOOLJOB_2_PDF' and it is working properly but the problem occurs where the BOLD fonts are used. I am unable to see the Text/Address where i have used Bold Font in script (PDF FORMAT). Even though in (SPO1) spool request shows every thing perfectly (along with Bold Font). It will great if you could suggest me something.
    Thanks,
    Pradeep

    Hi Pradeep,
    Use ,
    Closing the Sapscript, we save data (OTF) in a table
    CALL FUNCTION 'CLOSE_FORM'
    TABLES
    otfdata = t_otfdata
    EXCEPTIONS
    unopened = 1
    bad_pageformat_for_print = 2
    send_error = 3
    spool_error = 4
    OTHERS = 5.
    DATA: BEGIN OF t_otfdata2 OCCURS 0.
    INCLUDE STRUCTURE solisti1.
    DATA: END OF t_otfdata2.
    Move OTF data to another table with lenght 255
    LOOP AT t_otfdata.
    CONCATENATE t_otfdata-tdprintcom t_otfdata-tdprintpar INTO t_otfdata2.
    APPEND t_otfdata2.
    ENDLOOP.
    Convert OTF format to PDF
    CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
    EXPORTING
    format_src = 'OTF'
    format_dst = 'PDF'
    devtype = 'PRINTER'
    FUNCPARA =
    len_in = len_in
    IMPORTING
    len_out = len_out
    TABLES
    content_in = t_otfdata2
    content_out = t_pdfdata
    EXCEPTIONS
    err_conv_failed = 1
    OTHERS = 2.
    Have a look at Progs. RSTXPDF4 and RSTXPDFT2 for converting the Spool to PDF.
    Regards,
    Raj
    Message was edited by: Rajasekhar Dinavahi
    Message was edited by: Rajasekhar Dinavahi

  • Problem in converting Spool to PDF file, having non-English characters

    Hi All,
            I have problem in converting Spool to PDF format.
    Scenario : I have a spool which has non-English characters. I am using CONVERT_ABAPSPOOLJOB_2_PDF  FM to perform conversion. But my output is having junk values( ie # ) for non-English characters. Any pointers to solve this issue will be appreciated.
    I even tried with report RSTXPDFT4 , it also gives me the same junk characters.
    Regards,
    Navin.

    Hi All,
            I have problem in converting Spool to PDF format.
    Scenario : I have a spool which has non-English characters. I am using CONVERT_ABAPSPOOLJOB_2_PDF  FM to perform conversion. But my output is having junk values( ie # ) for non-English characters. Any pointers to solve this issue will be appreciated.
    I even tried with report RSTXPDFT4 , it also gives me the same junk characters.
    Regards,
    Navin.

  • Hyperlink problem when converting Word to PDF

    Hi everyone.
    I am using Adobe Acrobat 7.0 Standard version 7.1.4 on a Windows 2000 environment.
    I am using Word XP/2002 SP3.
    I have a couple of problems when converting Word to PDF.
    When converting a long link which is in 2 lines, PDF just takes one line into account, not considering the whole link
    When I have hyperlinks that links to a web page, the link works fine in Word but in pdf, it gets the few words after the url address making the link not work.  For example.  I have a hyperlink that http://www.google.com/ and after this I have the words: "This is a sample text".  The hyperlink in pdf would then become http://www.google.comThisisasampletext
    Do you have any ideas how I can correct this?
    Thanks.

    To get the cross references, you have to use Convert to PDF (PDF Maker part of the Acrobat product). However, you first need to go to the print menu and set the printer to the Adobe PDF printer. Close the print menu and then do a reflow and link update of the document (ctrl-A, then F9 I think). This is needed to get the links correct since WORD reflows the document based on the printer (problem with them going to the wrong place).
    Printing to the Adobe PDF printer (the step of print to file is not needed, just print to the printer and the rest is automatic) does not include the links. PDF Maker is a PreProcessor for the Adobe PDF printer that adds PDF Marks to the PS file before it is sent to Distiller (OK, the printer when used normally creates a PS file and then invokes Distiller to complete the process - your steps did with the Adobe PDF printer is the same process done manually).
    Summary:
    1. Fix document after setting the printer to Adobe PDF.
    2. Use PDF Maker (create PDF button)

  • Problem in converting smartform to PDF

    Hi Experts,
    I am facing the issue while converting the smartform to pdf form with the help of FM convert_otf_2_pdf .
    Problem is that
    CH3OH4OD7     3 , 4 and 7 are the subscipts in SMARTFORM like in a chemical formula ,but after conveting to PDF # is replacing the subscripts like CH#OH#OD# .
    Kindly help in this issue.
    Thanks
    Sachin
    Edited by: Rob Burbank on Feb 6, 2012 10:13 AM

    Try this example it will be help full
    REPORT  YSAMPLE5.
    DATA:
    w_form_name TYPE tdsfname VALUE 'YSAMPLE2',
    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
    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
    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'
    tables
    data_tab = T_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.

  • Problem in converting reports  to PDF format - bug

    dear all,
    There is a problem in converting the reports in PDF format.
    The situation is that if we use the tool bar icon in SAP B1 to get the reports in PDF format, there are printing errors. The output PDF file does not contain the exact data that is in the report, the values are getting interchanged and mismatched.
    But if we do the same using the print in the PDF option in choose from printers window as we do regular pringting, the document is printed properly.
    what may be the cause for this bug like thing. How can we solve it??
    please help me..
    thanks and regards,
    Yeshwanth Prakash

    Check this SAP Note: 1089388     Incorrect value in exported PDF when Concat function is used
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/smb_searchnotes/display.htm?note_langu=E&note_numm=1089388]

  • Problem in converting spool to pdf

    Hi Experts,
    I want an internal table to be converted to the PDF. For this RSPO_OPEN_SPOOLREQUEST, RSPO_WRITE_SPOOLREQUEST and RSPO_CLOSE_SPOOLREQUEST to create the spool. However, somehow the table tsp01 does not gets updated as a result i could not convert the data to PDF. Can any one help me how this problem could be solved.
    Thank.
    Warm Regards,
    Harshad.

    Hi,
    you can refer this sample code.
    DATA: t_otfdata_tab LIKE ITCOO OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'CLOSE_FORM'
    TABLES
    OTFDATA = t_otfdata_tab
    fill the exceptions..
    IF SY-SUBRC = 0.
    ENDIF.
    then pass the t_otfdata_tab to this function module..
    CONSTANTS: c_pdf(03) VALUE 'PDF'.
    PDF File size
    DATA: w_file_size TYPE I.
    Internal Table to hold Form contents in PDF format
    DATA: t_pdfdata_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    for converting. the output format from OTF to PDF
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT eq c_pdf
    IMPORTING
    BIN_FILESIZE = w_file_size
    TABLES
    OTF eq t_otfdata_tab
    LINES eq t_pdfdata_tab
    EXCEPTIONS...
    use these links, hope it will be useful to you....
    Problem in converting spool to PDF file
    Problem in converting the spool to PDF.
    Thanks and Regards,
    Ahamed.

  • I have a problem in converting smartform output to pdf format.

    Hi,
    While converting the smartform output to pdf format.
    It is showing this error.
    otf end command // missing in otf data.
    I have used this function.
    Assigning the OTFDATA to OTF Structure table
        CLEAR gt_otf.
        gt_otf[] = gs_otfdata-otfdata[].
    Convert the OTF DATA to SAP Script Text lines
        CLEAR gt_pdf_tab.
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
            max_linewidth         = 132
          IMPORTING
            bin_filesize          = gv_bin_filesize
          TABLES
            otf                   = gt_otf
            lines                 = gt_pdf_tab
          EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 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.
    Please help me in this regard. Thanks in advance.

    Hi ,
    I am getting this exception "err_conv_not_possible"
    CALL FUNCTION f_name " '/1BCDWB/SF00000092'
          EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
            CONTROL_PARAMETERS       = st_control_parameters
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
         OUTPUT_OPTIONS             = st_output_options
      USER_SETTINGS              = 'X'
            ZST_TEXTSYMBOLS            = ZST_TEXTSYMBOLS
            wa_kna1                    = wa_kna1
            wa_claim_header            = wa_claim_header
       IMPORTING
         DOCUMENT_OUTPUT_INFO       = st_document_output_info
         JOB_OUTPUT_INFO            = st_job_output_info
         JOB_OUTPUT_OPTIONS         = st_job_output_options
          TABLES
            IT_CLAIM_VERSION           = IT_CLAIM_VERSION
            IT_CLAIM_ITEM              = IT_CLAIM_ITEM
            IT_CLAIM_PARTNER           = IT_CLAIM_PARTNER
            IT_FINAL                   = IT_FINAL
       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.
        ELSE.
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
          EXPORTING
             USE_OTF_MC_CMD               = 'X'
        ARCHIVE_INDEX                =
          IMPORTING
          BIN_FILESIZE   = v_bin_filesize
          TABLES
          OTF = st_job_output_info-OTFDATA[]
          DOCTAB_ARCHIVE = it_docs
          LINES  = it_lines
          EXCEPTIONS
          ERR_CONV_NOT_POSSIBLE = 1
          ERR_OTF_MC_NOENDMARKER = 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.
        ENDIF.
    HERE when i tried to debug it i got SY-SUBRC = 1.
    Please help me in this regard. Thanks in advance.

  • Alignment problem in converting smartform printpreview into PDF

    Hi all,
    I am getting some alignment problem in converting smartform printpreview into PDF format, i.e the format of PDF is different from printpreviw of smartform.
    kindly suggest something so that alignment is not changed while converting to PDF.
    Regards,
    Sumalatha

    use below f.m to convert it into 255 characters....
         CALL FUNCTION 'QCE1_CONVERT'
            TABLES
              t_source_tab         = i_tline
              t_target_tab         = so_ali[]
            EXCEPTIONS
              convert_not_possible = 1
              OTHERS               = 2.

Maybe you are looking for

  • Upgrade from SAP Webas 6.40 to SAP Netweaver 2004s

    Do we have to change the virtual host name used for high availability clustering environment to local host name before we conduct the upgrade from SAP WebAS 6.40 to SAP NetWeaver 2004's ?

  • Can I turn a tool recorded artwork into a video?

    I want to show a video turning into a drawing. Can I use the tool recording feature to change my photo into a drawing and than export that to video?

  • Error 0xE8000084

    I just downloaded iOS 7 today and after the download, I was having trouble connecting my iPhone 5 to iTunes. My phone does not show up in iTunes even though it is plugged in and I repeatedly get the error code 0xE8000084. I have Windows 8 and I have

  • Text not aligning . . .

    Does anyone have any suggestions on how to align text? I'm designing a page using a text box. It looks great with iWeb, but when I publish it, all the text doesn't look right. This page is suppose to host my resume so I'm pretty concerned about the a

  • URL to XI connectivity

    Hello Friends, Case: I want that sender sends a data as a part of the URL and based on the value, XI does some processing and returns the information back. Is it possible for me to incorporate the above case through the XI ? Thanks for all your help,