<?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 SCRIPTS in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/3479148#M836338</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;&lt;/P&gt;&lt;P&gt;Check this link for sample program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/download" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/download&lt;/A&gt;&lt;EM&gt;SAPScript&lt;/EM&gt;output&lt;EM&gt;to&lt;/EM&gt;PDF+file.&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function Module: CONVERT_OTF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward Points if found helpfull..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cheers,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Chandra Sekhar.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 08 Mar 2008 06:11:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-08T06:11:30Z</dc:date>
    <item>
      <title>SAP SCRIPTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/3479145#M836335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      How could i get the output in PDF format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 02:54:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/3479145#M836335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T02:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAP SCRIPTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/3479146#M836336</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;usually the Output of Sap script in OTF format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we need to convert into PDF format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check with the following code it will helpful for u.&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;P&gt;&lt;/P&gt;&lt;P&gt;Types Declaration &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Internal Table Declaration &lt;/P&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;P&gt;Work Area Declaration &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Variable Declaration &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Constants Declaration &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Selecting the records from pa0001 &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Setting the options &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Opening the form &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Writting into the form &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Closing the form &lt;/P&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 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;P&gt;&lt;/P&gt;&lt;P&gt;Converting OTF data to single line &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Converting to PDF Format &lt;/P&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;P&gt;&lt;/P&gt;&lt;P&gt;Downloading the PDF File &lt;/P&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.[/code]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 03:04:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/3479146#M836336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T03:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAP SCRIPTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/3479147#M836337</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;use the standard program RSTXPDFT4 for ur purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;useful reward with points.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 03:05:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/3479147#M836337</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T03:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAP SCRIPTS</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/3479148#M836338</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;&lt;/P&gt;&lt;P&gt;Check this link for sample program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/49e15474-0e01-0010-9cba-e62df8244556&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/download" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/download&lt;/A&gt;&lt;EM&gt;SAPScript&lt;/EM&gt;output&lt;EM&gt;to&lt;/EM&gt;PDF+file.&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Function Module: CONVERT_OTF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward Points if found helpfull..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Cheers,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Chandra Sekhar.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Mar 2008 06:11:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-scripts/m-p/3479148#M836338</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-08T06:11:30Z</dc:date>
    </item>
  </channel>
</rss>

