<?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: To Programatically retrive the Spool Data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388851#M189144</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to make report.&lt;/P&gt;&lt;P&gt;currently i am passing Report name and date and time &lt;/P&gt;&lt;P&gt;in selection screen (Variant still remaining)&lt;/P&gt;&lt;P&gt;and retriveing spoolid from TPS01.&lt;/P&gt;&lt;P&gt;it has worked till now.&lt;/P&gt;&lt;P&gt;but still to use FM and retrive data is still remaning as i am not able to cross check Variant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;  Joginder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Jun 2006 14:00:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-29T14:00:33Z</dc:date>
    <item>
      <title>To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388844#M189137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   i am developing a report in which i have retrive the data i.e ProgramName variant and  output of program,&lt;/P&gt;&lt;P&gt;For the program that has run in background (Spool dat that we see by TCODE SM37).&lt;/P&gt;&lt;P&gt;i tried finding the table but was unable to know where this data is stored.&lt;/P&gt;&lt;P&gt;please help me to know in which tables data is stored and How can i retrive&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 09:46:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388844#M189137</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T09:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388845#M189138</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;TSP01 is the table which stores all the spool  numbers.now use the spool number and read the spoll data using the FM &amp;lt;b&amp;gt;RSPO_DOWNLOAD_SPOOLJOB&amp;lt;/b&amp;gt; to download the spool to pC using the spool number.&lt;/P&gt;&lt;P&gt;to display the spool you can use...&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;RSPO_DISPLAY_ABAP_SPOOLJOB   &lt;/P&gt;&lt;P&gt;RSPO_DISPLAY_SPOOLJOB    &amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;or you can use this &amp;lt;b&amp;gt;CONVERT_ABAPSPOOLJOB_2_PDF&amp;lt;/b&amp;gt; to convert the spool to PDF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 09:53:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388845#M189138</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T09:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388846#M189139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Spool data will be stored as a TemseFile( SP11).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just u have to read that data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 09:55:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388846#M189139</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T09:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388847#M189140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Joginder,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Spool numbers are stored in the table &amp;lt;b&amp;gt; TSP01 &amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;Use the following code in your progeam to retrive the latest spool no.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;CONCATENATE sy-repid&lt;EM&gt;0(9) sy-uname&lt;/EM&gt;0(3) INTO tsp01-rq2name.&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt; This will pick the lastest spool no for the report id.&lt;/P&gt;&lt;P&gt;  SELECT MAX( rqcretime )&lt;/P&gt;&lt;P&gt;   FROM tsp01&lt;/P&gt;&lt;P&gt;   INTO tsp01-rqcretime&lt;/P&gt;&lt;P&gt;   WHERE rq2name = tsp01-rq2name.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    SELECT  SINGLE *&lt;/P&gt;&lt;P&gt;      FROM  tsp01&lt;/P&gt;&lt;P&gt;      WHERE rqcretime = tsp01-rqcretime.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      MESSAGE s000(0k) WITH 'Spool Number does not exist'.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      client = tsp01-rqclient.&lt;/P&gt;&lt;P&gt;      name   = tsp01-rqo1name.&lt;/P&gt;&lt;P&gt;    ENDIF.&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;You can also use &amp;lt;b&amp;gt; sy-spono&amp;lt;/b&amp;gt; which will returns the latest spool no of the report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Jothi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 10:20:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388847#M189140</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T10:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388848#M189141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;for u r help&lt;/P&gt;&lt;P&gt;but i am taking input on selection screen &lt;/P&gt;&lt;P&gt;Program Name &lt;/P&gt;&lt;P&gt;Variant&lt;/P&gt;&lt;P&gt;Date (section Option)&lt;/P&gt;&lt;P&gt;Time (selection Option)&lt;/P&gt;&lt;P&gt;and then retrive depending on this conditions &lt;/P&gt;&lt;P&gt;i am not able to cross check value of variant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please do reply on forum itself as i am not able to acces my mail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 12:56:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388848#M189141</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T12:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388849#M189142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am also waiting for Vijays reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 12:59:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388849#M189142</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T12:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388850#M189143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am just checking ,how to bring the relation between  Spool request and report . before that how are you generating the spool can you tell me that..., is it from program if so how? is it script or smart form or Report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 13:43:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388850#M189143</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T13:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388851#M189144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have to make report.&lt;/P&gt;&lt;P&gt;currently i am passing Report name and date and time &lt;/P&gt;&lt;P&gt;in selection screen (Variant still remaining)&lt;/P&gt;&lt;P&gt;and retriveing spoolid from TPS01.&lt;/P&gt;&lt;P&gt;it has worked till now.&lt;/P&gt;&lt;P&gt;but still to use FM and retrive data is still remaning as i am not able to cross check Variant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;  Joginder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 14:00:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388851#M189144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T14:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388852#M189145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can get the spool id using program name from table TBTCP, Field LISTIDENT is spool id, PROGNAME is program name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 14:12:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388852#M189145</guid>
      <dc:creator>sridhar_k1</dc:creator>
      <dc:date>2006-06-29T14:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388853#M189146</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 the table &amp;lt;b&amp;gt;VARI&amp;lt;/b&amp;gt;(&amp;lt;b&amp;gt; Fields : REPORT and VARIANT )&amp;lt;/b&amp;gt; to cross check the variants for a given program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also Check the tables.&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt;VARID&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt;VARIT&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;lt;b&amp;gt;VARIS&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun Sambargi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2006 14:22:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388853#M189146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-29T14:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388854#M189147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not able to data from spool and save it as .pdf&lt;/P&gt;&lt;P&gt;format&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2006 14:46:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388854#M189147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-03T14:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388855#M189148</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;This is working example code , check this. create a screen and place a custom container on it.it will work.&lt;/P&gt;&lt;P&gt;Give a spool number , first it will convert to PDF and it will show 'save as' dialog box to save the created file.&lt;/P&gt;&lt;P&gt;select suitable path to save the file and also you can see the converted PDF file in the SAP screen . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Laxman&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  YS_SPOOL_TO_PDF                                             *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ys_spool_to_pdf                         .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS lcl_pdf_demo_event_receiver DEFINITION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_pdf_demo_event_receiver DEFINITION.&lt;/P&gt;&lt;P&gt;  PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;    DATA:&lt;/P&gt;&lt;P&gt;      entry_field1(100) TYPE c,&lt;/P&gt;&lt;P&gt;      entry_field2(100) TYPE c.&lt;/P&gt;&lt;P&gt;    METHODS:&lt;/P&gt;&lt;P&gt;      on_document_saved&lt;/P&gt;&lt;P&gt;        FOR EVENT document_saved OF cl_gui_pdfviewer&lt;/P&gt;&lt;P&gt;          IMPORTING file_path,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      on_viewing_finished&lt;/P&gt;&lt;P&gt;        FOR EVENT document_closing OF cl_gui_pdfviewer.&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_pdf_demo_event_receiver DEFINITION&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      CLASS lcl_pdf_demo_event_receiver IMPLEMENTATION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS lcl_pdf_demo_event_receiver IMPLEMENTATION.&lt;/P&gt;&lt;P&gt;  METHOD on_document_saved.&lt;/P&gt;&lt;P&gt;    entry_field1 = 'Document Saved'.&lt;/P&gt;&lt;P&gt;    entry_field2 = file_path.&lt;/P&gt;&lt;P&gt;    CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        new_code = 'EVENT'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "on_document_saved&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  METHOD on_viewing_finished.&lt;/P&gt;&lt;P&gt;    entry_field1 = 'Viewing Finished'.&lt;/P&gt;&lt;P&gt;    entry_field2 = space.&lt;/P&gt;&lt;P&gt;    CALL METHOD cl_gui_cfw=&amp;gt;set_new_ok_code&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        new_code = 'EVENT'.&lt;/P&gt;&lt;P&gt;  ENDMETHOD.                    "on_viewing_finished&lt;/P&gt;&lt;P&gt;ENDCLASS.                    "lcl_pdf_demo_event_receiver IMPLEMENTATION&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;DATA : l_lines       TYPE i,&lt;/P&gt;&lt;P&gt;         l_temp(500)   TYPE c,&lt;/P&gt;&lt;P&gt;         l_offset      TYPE p,&lt;/P&gt;&lt;P&gt;         l_lineslen(2) TYPE p,&lt;/P&gt;&lt;P&gt;         l_mimelen(2)  TYPE p,&lt;/P&gt;&lt;P&gt;         l_tabix       LIKE sy-tabix,&lt;/P&gt;&lt;P&gt;         l_bytecount  TYPE i,&lt;/P&gt;&lt;P&gt;         l_size TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_pdf       LIKE tline OCCURS 10 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      xi_pdf       LIKE tline OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      html         LIKE solisti1   OCCURS 0  WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      xi_temp      LIKE bapiqcmime OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      xi_mime(255) TYPE c OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;       lt_doc  TYPE TABLE OF docs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : url TYPE char255.&lt;/P&gt;&lt;P&gt;DATA: my_pdf_viewer     TYPE REF TO cl_gui_pdfviewer,&lt;/P&gt;&lt;P&gt;       my_main_container TYPE REF TO cl_gui_custom_container,&lt;/P&gt;&lt;P&gt;       entry1(100) TYPE c,&lt;/P&gt;&lt;P&gt;       entry2(100) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: okcode TYPE sy-ucomm.&lt;/P&gt;&lt;P&gt;DATA: l_event_receiver TYPE REF TO lcl_pdf_demo_event_receiver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'C:\temp\file.pdf'."#EC NOTEXT&lt;/P&gt;&lt;P&gt;PARAMETERS : p_spool LIKE tsp01-rqident OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*-Convert OTF Spool to PDF&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; if x_temp = ''.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      src_spoolid              = p_spool&lt;/P&gt;&lt;P&gt;      no_dialog                = ' '&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      pdf_bytecount            = l_bytecount&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      pdf                      = it_pdf&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      err_no_otf_spooljob      = 1&lt;/P&gt;&lt;P&gt;      err_no_spooljob          = 2&lt;/P&gt;&lt;P&gt;      err_no_permission        = 3&lt;/P&gt;&lt;P&gt;      err_conv_not_possible    = 4&lt;/P&gt;&lt;P&gt;      err_bad_dstdevice        = 5&lt;/P&gt;&lt;P&gt;      user_cancelled           = 6&lt;/P&gt;&lt;P&gt;      err_spoolerror           = 7&lt;/P&gt;&lt;P&gt;      err_temseerror           = 8&lt;/P&gt;&lt;P&gt;      err_btcjob_open_failed   = 9&lt;/P&gt;&lt;P&gt;      err_btcjob_submit_failed = 10&lt;/P&gt;&lt;P&gt;      err_btcjob_close_failed  = 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    xi_pdf[] = it_pdf[].&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    xi_pdf[] = it_pdf[].&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; else.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CALL FUNCTION 'CONVERT_OTF_2_PDF'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       bin_filesize           = l_size&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       OTF                    = it_otf&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       DOCTAB_ARCHIVE         = lt_doc&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       LINES                  = it_pdf&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       ERR_CONV_NOT_POSSIBLE  = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       ERR_OTF_MC_NOENDMARKER = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       OTHERS                 = 3.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     v_retcode = 1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     perform protocol_update. exit.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   else.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     xi_pdf[] = it_pdf[].&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; -Reformat the line to 255 characters wide (&lt;DEL&gt;code from SAP&lt;/DEL&gt;)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLEAR: l_temp, l_offset, xi_temp.&lt;/P&gt;&lt;P&gt;  DESCRIBE TABLE xi_pdf   LINES  l_lines.&lt;/P&gt;&lt;P&gt;  DESCRIBE FIELD xi_pdf   LENGTH l_lineslen IN CHARACTER MODE.&lt;/P&gt;&lt;P&gt;  DESCRIBE FIELD xi_temp  LENGTH l_mimelen IN CHARACTER MODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT xi_pdf.&lt;/P&gt;&lt;P&gt;    l_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;    MOVE xi_pdf TO l_temp+l_offset.&lt;/P&gt;&lt;P&gt;    IF l_tabix = l_lines.&lt;/P&gt;&lt;P&gt;      l_lineslen = STRLEN( xi_pdf ).&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    l_offset = l_offset + l_lineslen.&lt;/P&gt;&lt;P&gt;    IF l_offset GE l_mimelen.&lt;/P&gt;&lt;P&gt;      CLEAR xi_temp.&lt;/P&gt;&lt;P&gt;      xi_temp = l_temp(l_mimelen).&lt;/P&gt;&lt;P&gt;      APPEND xi_temp.&lt;/P&gt;&lt;P&gt;      SHIFT l_temp BY l_mimelen PLACES.&lt;/P&gt;&lt;P&gt;      l_offset = l_offset - l_mimelen.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    IF l_tabix = l_lines.&lt;/P&gt;&lt;P&gt;      IF l_offset GT 0.&lt;/P&gt;&lt;P&gt;        CLEAR xi_temp.&lt;/P&gt;&lt;P&gt;        xi_temp = l_temp(l_offset).&lt;/P&gt;&lt;P&gt;        APPEND xi_temp.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT xi_temp.&lt;/P&gt;&lt;P&gt;    xi_mime(255) = xi_temp-line.&lt;/P&gt;&lt;P&gt;    APPEND xi_mime.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; -Final Data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  html[] = xi_mime[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  break gblap0.&lt;/P&gt;&lt;P&gt;  DATA : cancel.&lt;/P&gt;&lt;P&gt;  PERFORM download_w_ext(rstxpdft) TABLES html[]&lt;/P&gt;&lt;P&gt;                                   USING p_file&lt;/P&gt;&lt;P&gt;                                         '.pdf'&lt;/P&gt;&lt;P&gt;                                         'BIN'&lt;/P&gt;&lt;P&gt;                                         l_bytecount&lt;/P&gt;&lt;P&gt;                                         cancel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL SCREEN 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-Save spool in application server as pdf file&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; open dataset p_file for output.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; if sy-subrc = 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   loop at html.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     transfer html to p_file.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       v_retcode = 1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       perform protocol_update.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     endif.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endloop.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   close dataset p_file.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     v_retcode = 1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     perform protocol_update.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   it_command_files = p_file.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   append it_command_files.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   clear it_command_files.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; else.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   v_retcode = 1.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   perform protocol_update.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE status_0100 OUTPUT.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SET PF-STATUS 'xxxxxxxx'.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; SET TITLEBAR 'xxx'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF my_main_container IS INITIAL.&lt;/P&gt;&lt;P&gt;    CREATE OBJECT my_main_container&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        container_name = 'CUSTOM_CNTL'&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        cntl_error     = 1&lt;/P&gt;&lt;P&gt;        OTHERS         = 2.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      CREATE OBJECT my_pdf_viewer&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          parent              = my_main_container&lt;/P&gt;&lt;P&gt;        EXCEPTIONS&lt;/P&gt;&lt;P&gt;          cntl_error          = 1&lt;/P&gt;&lt;P&gt;          cntl_system_error   = 2&lt;/P&gt;&lt;P&gt;          OTHERS              = 3.&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;        "could not create PDF Viewer&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA: view_buttons_active TYPE char01.&lt;/P&gt;&lt;P&gt;    IF my_pdf_viewer-&amp;gt;acrobat_vs_reader = ''.&lt;/P&gt;&lt;P&gt;      view_buttons_active = 'X'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   CALL METHOD my_pdf_viewer-&amp;gt;create_toolbar&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       tool_buttons      = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       view_buttons      = view_buttons_active&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       cntl_error        = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       cntl_system_error = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;       OTHERS            = 3.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     "could not create toolbar&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;    CREATE OBJECT l_event_receiver.&lt;/P&gt;&lt;P&gt;    SET HANDLER l_event_receiver-&amp;gt;on_document_saved FOR my_pdf_viewer.&lt;/P&gt;&lt;P&gt;    SET HANDLER l_event_receiver-&amp;gt;on_viewing_finished FOR my_pdf_viewer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   IF NOT my_pdf_viewer-&amp;gt;html_viewer IS INITIAL.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      url = p_file.&lt;/P&gt;&lt;P&gt;      CALL METHOD my_pdf_viewer-&amp;gt;open_document&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          url = url.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " STATUS_0100  OUTPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Module  USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE user_command_0100 INPUT.&lt;/P&gt;&lt;P&gt;  LEAVE TO SCREEN 0.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_0100  INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Laxmana Kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2006 14:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388855#M189148</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-07-03T14:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388856#M189149</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;To retrieve programatically use the following code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_spool_details .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR : w_spool_number.&lt;/P&gt;&lt;P&gt;REFRESH : i_jobsteplist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CHECK WHETHER STATUS OF JOB IS COMPLETED OR CANCELLED&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHILE 1 = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GET THE JOB STEPLIST WHICH HAS THE SPOOL NUMBER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'BP_JOB_READ'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;job_read_jobcount = w_jobcount&lt;/P&gt;&lt;P&gt;job_read_jobname = w_jobname&lt;/P&gt;&lt;P&gt;job_read_opcode = '35'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;JOB_STEP_NUMBER =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;job_read_jobhead = wa_jobhead&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;job_read_steplist = i_jobsteplist&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CHANGING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RET =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;invalid_opcode = 1&lt;/P&gt;&lt;P&gt;job_doesnt_exist = 2&lt;/P&gt;&lt;P&gt;job_doesnt_have_steps = 3&lt;/P&gt;&lt;P&gt;OTHERS = 4&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;IF STATUS OF JOB IS COMPLETED(F) OR CANCELLED(A)&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;READ THE JOBSTEPLIST &amp;amp; GET THE SPOOL NUMBER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF wa_jobhead-status = 'A' OR wa_jobhead-status = 'F'.&lt;/P&gt;&lt;P&gt;READ TABLE i_jobsteplist INTO wa_jobsteplist INDEX 1.&lt;/P&gt;&lt;P&gt;CHECK wa_jobsteplist-listident &amp;lt;&amp;gt; space.&lt;/P&gt;&lt;P&gt;w_spool_number = wa_jobsteplist-listident.&lt;/P&gt;&lt;P&gt;EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDWHILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want the spool content into an internal table, then use the following FM :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RSPO_RETURN_ABAP_SPOOLJOB'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;rqident = w_spool_number&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FIRST_LINE = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LAST_LINE =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;buffer = i_buffer&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;no_such_job = 1&lt;/P&gt;&lt;P&gt;not_abap_list = 2&lt;/P&gt;&lt;P&gt;job_contains_no_data = 3&lt;/P&gt;&lt;P&gt;selection_empty = 4&lt;/P&gt;&lt;P&gt;no_permission = 5&lt;/P&gt;&lt;P&gt;can_not_access = 6&lt;/P&gt;&lt;P&gt;read_error = 7&lt;/P&gt;&lt;P&gt;OTHERS = 8&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you get the spool content into an internal table, pass this data to the email FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : l_spool_no TYPE tsp01_sp0r-rqid_char.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AFTER SENDING MAIL DELETE THE CORRESPONDING SPOOL&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_spool_no = w_spool_number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;spoolid = l_spool_no&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RC =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;STATUS =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Prashant Patil&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2006 15:17:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388856#M189149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-03T15:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388857#M189150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to save the spool data into application server&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 09:31:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388857#M189150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-06T09:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388858#M189151</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;I hope this will help you ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**********&lt;/P&gt;&lt;P&gt;FORM dwnld_spool_app.&lt;/P&gt;&lt;P&gt;  DATA: BEGIN OF i_outtab OCCURS 0,&lt;/P&gt;&lt;P&gt;          str(255) TYPE c,&lt;/P&gt;&lt;P&gt;        END OF i_outtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: BEGIN OF buffer OCCURS 10000,&lt;/P&gt;&lt;P&gt;           text(255) TYPE c,&lt;/P&gt;&lt;P&gt;        END OF buffer.&lt;/P&gt;&lt;P&gt;  DATA: startline TYPE i, endline TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  startline = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    REFRESH buffer.&lt;/P&gt;&lt;P&gt;    endline = startline + 9999.&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'&lt;/P&gt;&lt;P&gt;       EXPORTING&lt;/P&gt;&lt;P&gt;            rqident              = i_itcpp-tdspoolid&lt;/P&gt;&lt;P&gt;            first_line           = startline&lt;/P&gt;&lt;P&gt;            last_line            = endline&lt;/P&gt;&lt;P&gt;            desired_type         = 'RAW'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;           real_type            =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       TABLES&lt;/P&gt;&lt;P&gt;            buffer               = buffer&lt;/P&gt;&lt;P&gt;       EXCEPTIONS&lt;/P&gt;&lt;P&gt;            no_such_job          = 1&lt;/P&gt;&lt;P&gt;            job_contains_no_data = 2&lt;/P&gt;&lt;P&gt;            selection_empty      = 3&lt;/P&gt;&lt;P&gt;            no_permission        = 4&lt;/P&gt;&lt;P&gt;            can_not_access       = 5&lt;/P&gt;&lt;P&gt;            read_error           = 6&lt;/P&gt;&lt;P&gt;            type_no_match        = 7&lt;/P&gt;&lt;P&gt;            OTHERS               = 8.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      EXIT.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT buffer.&lt;/P&gt;&lt;P&gt;      i_outtab-str = buffer-text.&lt;/P&gt;&lt;P&gt;      APPEND i_outtab.&lt;/P&gt;&lt;P&gt;      CLEAR i_outtab.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    startline = endline + 1.&lt;/P&gt;&lt;P&gt;  ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA:v_spoolno(10).&lt;/P&gt;&lt;P&gt;  v_spoolno = i_itcpp-tdspoolid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CONCATENATE p_appath 'SE_XML_' v_spoolno '.txt' INTO v_apppath1 .&lt;/P&gt;&lt;P&gt;  CONDENSE v_apppath1 NO-GAPS.&lt;/P&gt;&lt;P&gt;*form download_to_appserver.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For uploading the internal tabel data into application server&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Open the dataset&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  OPEN DATASET v_apppath1 FOR OUTPUT IN TEXT MODE.&lt;/P&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Transfer table content to application server&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    LOOP AT i_outtab.&lt;/P&gt;&lt;P&gt;      TRANSFER i_outtab TO v_apppath1.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; close the dataset.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CLOSE DATASET v_apppath1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; sucess message&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   message s233 with p_appath.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    wa_zmtranprof_spool-filename = v_apppath1.&lt;/P&gt;&lt;P&gt;    wa_zmtranprof_spool-vstel    = s_vstel-low.&lt;/P&gt;&lt;P&gt;    wa_zmtranprof_spool-tdlnr    = s_tdlnr-low.&lt;/P&gt;&lt;P&gt;    wa_zmtranprof_spool-datum    = p_actdat.&lt;/P&gt;&lt;P&gt;    wa_zmtranprof_spool-erdat    = sy-datum.&lt;/P&gt;&lt;P&gt;    wa_zmtranprof_spool-erzeit   = sy-uzeit.&lt;/P&gt;&lt;P&gt;    INSERT zmtranprof_spool FROM wa_zmtranprof_spool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SKIP 2.&lt;/P&gt;&lt;P&gt;    FORMAT COLOR COL_TOTAL INTENSIFIED ON.&lt;/P&gt;&lt;P&gt;    WRITE:/ text-s05,v_apppath1.&lt;/P&gt;&lt;P&gt;    FORMAT COLOR  OFF.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    SKIP 2.&lt;/P&gt;&lt;P&gt;    WRITE:/ text-s07.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;satish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jul 2006 09:44:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388858#M189151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-06T09:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388859#M189152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm cannot  call the function module RSPO_DOWNLOAD_SPOOLJOB from VBA. The exception &amp;lt;i&amp;gt;SYSTEM_FAILURE &amp;lt;/i&amp;gt; is always raised.&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Sub downloadSpool(AppServ, Client, SysNo, UId, Pwd, idspool, file)
    ' idspool :   the id number of a spool request to download
    ' file:  the full path of the output file 
    Set objBAPIControl = CreateObject("SAP.Functions")
    Set objConnection = objBAPIControl.Connection
    
    objConnection.ApplicationServer = AppServ
    objConnection.Client = Client
    objConnection.SystemNumber = SysNo
    objConnection.User = UId
    objConnection.Password = Pwd
    
    
    If objConnection.logon(0, True) = False Then
        msgbox("Error Logging in")
        Exit Sub
    End If


    Set objSpoolFcn = objBAPIControl.Add("RSPO_DOWNLOAD_SPOOLJOB")    
    Set objParamID = objSpoolFcn.exports("ID")
    objParamID.Value = idspool
    
    Set objParamFNAME = objSpoolFcn.exports("FNAME")
    objParamFNAME.Value = file
    
    objSpoolFcn.Call      ' !!!!!!!!!!! SYSTEM_FAILURE !!!!!!!!!!!!!!
    
    Debug.Print objSpoolFcn.Exception

End Sub&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, paste this code into Excel/Access Visual Basic Editor and try to call the function  downloadSpool(), passing your logon information.&lt;/P&gt;&lt;P&gt;Every suggestion would be very appreciated.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Feb 2007 18:19:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388859#M189152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-02T18:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: To Programatically retrive the Spool Data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388860#M189153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Filipo, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you get any solution for your mentioned problem? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can we use function module RSPO_DOWNLOAD_SPOOLJOB from VBA?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, &lt;/P&gt;&lt;P&gt;Arpit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2009 08:54:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-programatically-retrive-the-spool-data/m-p/1388860#M189153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-18T08:54:47Z</dc:date>
    </item>
  </channel>
</rss>

