<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SAP script to PDF in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-to-pdf/m-p/2366747#M524091</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once try with this FM.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CONVERT_OTF&amp;lt;/b&amp;gt; Convert SAP documents (SAPScript) to other types. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Example:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION "CONVERT_OTF"
       EXPORTING    FORMAT                = "PDF"
       IMPORTING    BIN_FILESIZE          = FILE_LEN
       TABLES       OTF                   = OTFDATA
                    LINES                 = PDFDATA
       EXCEPTIONS   ERR_MAX_LINEWIDTH     = 1                   
                    ERR_FORMAT            = 2
                    ERR_CONV_NOT_POSSIBLE = 3
                    OTHERS                = 4.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;or&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SX_OBJECT_CONVERT_OTF_PDF&amp;lt;/b&amp;gt; Conversion From OTF to PDF (SAPScript conversion) .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;follow this link for sample program.&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html" target="test_blank"&gt;http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ashokreddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 Jun 2007 15:32:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-16T15:32:07Z</dc:date>
    <item>
      <title>SAP script to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-to-pdf/m-p/2366745#M524089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       I am converting the SAP script to PDF using FM 'CONVERT_OTF'.&lt;/P&gt;&lt;P&gt;But in PDF file two pages coming intance of one page in Script .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For EX : In script output i am geting one page.But In PDF i am geting two copys for the same out in one file.(Same page printing two times in PDF file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  How to reduce the PDF file size.or give me some idea for this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;urgent issue i want to close this today.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2007 13:23:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-to-pdf/m-p/2366745#M524089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-16T13:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAP script to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-to-pdf/m-p/2366746#M524090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check your code aginst this sample code....... u can find the difference try to change that n execute your code  once agin......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT zzz_jaytest .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Types Declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TYPES : BEGIN OF ty_pa0001,&lt;/P&gt;&lt;P&gt;pernr TYPE pa0001-pernr,&lt;/P&gt;&lt;P&gt;bukrs TYPE pa0001-bukrs,&lt;/P&gt;&lt;P&gt;werks TYPE pa0001-werks,&lt;/P&gt;&lt;P&gt;END OF ty_pa0001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Internal Table Declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA : i_pa0001 TYPE STANDARD TABLE OF ty_pa0001, "For pa0001 Details&lt;/P&gt;&lt;P&gt;i_otf TYPE STANDARD TABLE OF itcoo, "For OTF data&lt;/P&gt;&lt;P&gt;i_content_txt TYPE soli_tab, "Content&lt;/P&gt;&lt;P&gt;i_content_bin TYPE solix_tab, "Content&lt;/P&gt;&lt;P&gt;i_objhead TYPE soli_tab,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Work Area Declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;w_pa0001 TYPE ty_pa0001, "For pa0001 Details&lt;/P&gt;&lt;P&gt;w_res TYPE itcpp, "SAPscript output&lt;/P&gt;&lt;P&gt;"parameters&lt;/P&gt;&lt;P&gt;w_otf TYPE itcoo, "For OTF&lt;/P&gt;&lt;P&gt;w_pdf TYPE solisti1, "For PDF&lt;/P&gt;&lt;P&gt;w_transfer_bin TYPE sx_boolean, "Content&lt;/P&gt;&lt;P&gt;w_options TYPE itcpo, "SAPscript output&lt;/P&gt;&lt;P&gt;"interface&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Variable Declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;v_len_in TYPE so_obj_len,&lt;/P&gt;&lt;P&gt;v_size TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Constants Declaration&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CONSTANTS : c_x TYPE c VALUE 'X', "X&lt;/P&gt;&lt;P&gt;c_locl(4) TYPE c VALUE 'LOCL', "Local Printer&lt;/P&gt;&lt;P&gt;c_otf TYPE sx_format VALUE 'OTF', "OTF&lt;/P&gt;&lt;P&gt;c_pdf TYPE sx_format VALUE 'PDF', "PDF&lt;/P&gt;&lt;P&gt;c_printer TYPE sx_devtype VALUE 'PRINTER', "PRINTER&lt;/P&gt;&lt;P&gt;c_bin TYPE char10 VALUE 'BIN', "BIN&lt;/P&gt;&lt;P&gt;c_name TYPE string VALUE 'C:\ZZZ_JAYTEST.PDF',"Downloading&lt;/P&gt;&lt;P&gt;"File Name&lt;/P&gt;&lt;P&gt;c_form(11) TYPE c VALUE 'ZZZ_JAYTEST'. "Form Name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Selecting the records from pa0001&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT pernr bukrs werks FROM pa0001&lt;/P&gt;&lt;P&gt;INTO TABLE i_pa0001 UP TO 10 ROWS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Setting the options&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;w_options-tdcopies = 1 ."Number of copies&lt;/P&gt;&lt;P&gt;w_options-tdnoprev = c_x."No print preview&lt;/P&gt;&lt;P&gt;w_options-tdgetotf = c_x."Return of OTF table&lt;/P&gt;&lt;P&gt;w_options-tddest = c_locl."Spool: Output device&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Opening the form&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'OPEN_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;form = c_form&lt;/P&gt;&lt;P&gt;device = c_printer&lt;/P&gt;&lt;P&gt;language = sy-langu&lt;/P&gt;&lt;P&gt;OPTIONS = w_options&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;RESULT = w_res.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_pa0001 INTO w_pa0001.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Writting into the form&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;element = 'MAIN'&lt;/P&gt;&lt;P&gt;window = 'MAIN'.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Closing the form&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'CLOSE_FORM'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;RESULT = w_res&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;otfdata = i_otf&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;unopened = 1&lt;/P&gt;&lt;P&gt;bad_pageformat_for_print = 2&lt;/P&gt;&lt;P&gt;send_error = 3&lt;/P&gt;&lt;P&gt;spool_error = 4&lt;/P&gt;&lt;P&gt;codepage = 5&lt;/P&gt;&lt;P&gt;OTHERS = 6.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Converting OTF data to single line&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT i_otf INTO w_otf.&lt;/P&gt;&lt;P&gt;CONCATENATE w_otf-tdprintcom w_otf-tdprintpar&lt;/P&gt;&lt;P&gt;INTO w_pdf.&lt;/P&gt;&lt;P&gt;APPEND w_pdf TO i_content_txt.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Converting to PDF Format&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;format_src = c_otf&lt;/P&gt;&lt;P&gt;format_dst = c_pdf&lt;/P&gt;&lt;P&gt;devtype = c_printer&lt;/P&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;P&gt;transfer_bin = w_transfer_bin&lt;/P&gt;&lt;P&gt;content_txt = i_content_txt&lt;/P&gt;&lt;P&gt;content_bin = i_content_bin&lt;/P&gt;&lt;P&gt;objhead = i_objhead&lt;/P&gt;&lt;P&gt;len = v_len_in&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;err_conv_failed = 1&lt;/P&gt;&lt;P&gt;OTHERS = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_size = v_len_in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Downloading the PDF File&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;bin_filesize = v_size&lt;/P&gt;&lt;P&gt;filename = c_name&lt;/P&gt;&lt;P&gt;filetype = c_bin&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;data_tab = i_content_bin. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you r using this function module check it once....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'CONVERT_OTF'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;format = 'PDF'&lt;/P&gt;&lt;P&gt;max_linewidth = 132&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;bin_filesize = v_len_in&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;otf = i_otf&lt;/P&gt;&lt;P&gt;lines = i_tline&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;err_max_linewidth = 1&lt;/P&gt;&lt;P&gt;err_format = 2&lt;/P&gt;&lt;P&gt;err_conv_not_possible = 3&lt;/P&gt;&lt;P&gt;others = 4.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fehlerhandling&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or u can use the standard program RSTXPDFT4 to download the script into PDF format onto a particular location&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~~Guduri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2007 13:29:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-to-pdf/m-p/2366746#M524090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-16T13:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: SAP script to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-to-pdf/m-p/2366747#M524091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once try with this FM.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CONVERT_OTF&amp;lt;/b&amp;gt; Convert SAP documents (SAPScript) to other types. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Example:&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION "CONVERT_OTF"
       EXPORTING    FORMAT                = "PDF"
       IMPORTING    BIN_FILESIZE          = FILE_LEN
       TABLES       OTF                   = OTFDATA
                    LINES                 = PDFDATA
       EXCEPTIONS   ERR_MAX_LINEWIDTH     = 1                   
                    ERR_FORMAT            = 2
                    ERR_CONV_NOT_POSSIBLE = 3
                    OTHERS                = 4.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;or&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SX_OBJECT_CONVERT_OTF_PDF&amp;lt;/b&amp;gt; Conversion From OTF to PDF (SAPScript conversion) .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;follow this link for sample program.&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html" target="test_blank"&gt;http://searchsap.techtarget.com/tip/0,289483,sid21_gci1121833,00.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ashokreddy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2007 15:32:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-to-pdf/m-p/2366747#M524091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-16T15:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAP script to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-to-pdf/m-p/2366748#M524092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 09:44:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script-to-pdf/m-p/2366748#M524092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-16T09:44:30Z</dc:date>
    </item>
  </channel>
</rss>

