<?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: Programmatically reading and processing a spool file in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616527#M1569893</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : it_spool      TYPE STANDARD TABLE OF rsporq    .
.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  find_spool_request_id
*&amp;amp;---------------------------------------------------------------------*
FORM find_spool_request_id.

  CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
    EXPORTING
      allclients          = '320'
      datatype            = '*'
      has_output_requests = '*'
      rq0name             = nast-dsnam
      rq1name             = '*'
      rq2name             = '*'
      rqdest              = 'LOCL'
      rqowner             = sy-uname
    TABLES
      spoolrequests       = it_spool
    EXCEPTIONS
      no_permission       = 1
      OTHERS              = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE i000 DISPLAY LIKE 'E' WITH text-002.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " find_spool_request_id

 READ TABLE it_spool INTO wa_spool INDEX 1.
  v_spoolno = wa_spool-rqident.
*Get Spool request attributes
  SELECT SINGLE *
    FROM tsp01
    INTO tsp01
    WHERE rqident EQ v_spoolno.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: K.Manas on Jan 7, 2011 6:22 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jan 2011 05:22:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-01-07T05:22:24Z</dc:date>
    <item>
      <title>Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616518#M1569884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to read and process a spool file generated by a background job in my ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone advise if this is possible in SAP and if so, the best way to do this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only information I will have in my program is the job name and the date on which the job was run. I then need to find the corresponding spool and read this into an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas on how to do this would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ruby&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jan 2011 11:48:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616518#M1569884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-05T11:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616519#M1569885</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 table TBTCP for relating the spool and background job name. Both are available.&lt;/P&gt;&lt;P&gt;for processing a spool request in your program , you can search in SCN.There are lot of posts available.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jan 2011 12:10:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616519#M1569885</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2011-01-05T12:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616520#M1569886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hi,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Use table TBTCP for relating the spool and background job name. Both are available.&lt;/P&gt;&lt;P&gt;&amp;gt; for processing a spool request in your program , you can search in SCN.There are lot of posts available.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Table TBTCP has the date when the job was scheduled, but not date when the job was run. Since Ruby wrote that he wants to select by the date when the job was run, he can't simply to a SELECT from TBTCP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Ruby:&lt;/P&gt;&lt;P&gt;With FM  &lt;STRONG&gt;BP_JOB_SELECT&lt;/STRONG&gt; you can search jobs by jobname and run time date. In the output list of the FM you'll get the internal job number (JOBCOUNT) from all matching jobs. Now you can do a SELECT from TBTCP supplying the JOBCOUNT and JOBNAME which were supplied by BP_JOB_SELECT.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jan 2011 12:27:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616520#M1569886</guid>
      <dc:creator>adrian_dorn</dc:creator>
      <dc:date>2011-01-05T12:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616521#M1569887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at RSPO_FIND_SPOOL_REQUESTS to determine the spool id, then at rspo_return_spooljob to read the data from the spool file into a buffer where you can access it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;look at function groups SPOO and SPOX for other helpful function modules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jan 2011 12:38:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616521#M1569887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-05T12:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616522#M1569888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Please don't leave meaningless comments when closing old threads, the comment box can be left empty, only fill it when you want to describe your solution so other people might benefit.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Jan 2011 12:47:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616522#M1569888</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2011-01-05T12:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616523#M1569889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you guys for your responses. I have checked table TBTCP and I can see one of the spools in here, however, my job generates 3 separate spools and only the last one seems to be in this table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way of getting the other spools or is this a limitation of SAP?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 09:32:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616523#M1569889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-06T09:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616524#M1569890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI  Ruby,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a Ztable and save every spool you generated, including Date,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 09:40:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616524#M1569890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-06T09:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616525#M1569891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;RSPO_FIND_SPOOL_REQUESTS &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you should be able to\, based ont he spool name, date and time, determine which are for the job that was run&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jan 2011 11:56:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616525#M1569891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-06T11:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616526#M1569892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruby,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIrst use BP_JOB_READ to read the job.&lt;/P&gt;&lt;P&gt;You will get the spools from return table SPOOL_ATTRIBUTES-SPOOLID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use RSPO_RETURN_SPOOLJOB to read the spool using that spool id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Joivto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2011 05:18:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616526#M1569892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-07T05:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically reading and processing a spool file</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616527#M1569893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : it_spool      TYPE STANDARD TABLE OF rsporq    .
.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  find_spool_request_id
*&amp;amp;---------------------------------------------------------------------*
FORM find_spool_request_id.

  CALL FUNCTION 'RSPO_FIND_SPOOL_REQUESTS'
    EXPORTING
      allclients          = '320'
      datatype            = '*'
      has_output_requests = '*'
      rq0name             = nast-dsnam
      rq1name             = '*'
      rq2name             = '*'
      rqdest              = 'LOCL'
      rqowner             = sy-uname
    TABLES
      spoolrequests       = it_spool
    EXCEPTIONS
      no_permission       = 1
      OTHERS              = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MESSAGE i000 DISPLAY LIKE 'E' WITH text-002.
    LEAVE LIST-PROCESSING.
  ENDIF.
ENDFORM.                    " find_spool_request_id

 READ TABLE it_spool INTO wa_spool INDEX 1.
  v_spoolno = wa_spool-rqident.
*Get Spool request attributes
  SELECT SINGLE *
    FROM tsp01
    INTO tsp01
    WHERE rqident EQ v_spoolno.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: K.Manas on Jan 7, 2011 6:22 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2011 05:22:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/programmatically-reading-and-processing-a-spool-file/m-p/7616527#M1569893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-07T05:22:24Z</dc:date>
    </item>
  </channel>
</rss>

