<?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: how to create a spool requset for 'z program'. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-a-spool-requset-for-z-program/m-p/3485627#M838030</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is automaticaly done in batch, so i suppose you ask in interactive mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ways to produce a spool while being created are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Execute a report using the Execute and print function &lt;/P&gt;&lt;P&gt;- Switch on printing in a report using the ABAP statement NEW-PAGE PRINT ON. &lt;/P&gt;&lt;P&gt;- Call a report using the statement SUBMIT rep TO SAP-SPOOL &lt;/P&gt;&lt;P&gt;- Schedule a report as a background job using the statement SUBMIT rep USER user VIA JOB job NUMBER n TO SAP-SPOOL. When the report runs, the system writes the output to the spool system. &lt;/P&gt;&lt;P&gt;- Schedule a report as a background job using the function module JOB_SUBMIT. When the report runs, the sytsem writes the output to the spool system. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also use "tips" like the following code to force printing :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES sscrfields.

AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'ONLI'.
  sscrfields-ucomm = 'PRIN'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Feb 2008 07:56:15 GMT</pubDate>
    <dc:creator>RaymondGiuseppi</dc:creator>
    <dc:date>2008-02-28T07:56:15Z</dc:date>
    <item>
      <title>how to create a spool requset for 'z program'.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-a-spool-requset-for-z-program/m-p/3485624#M838027</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;Could anybody please tell me how to generate a spool request for a Z program. and how to check the spool request.&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;sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 07:33:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-a-spool-requset-for-z-program/m-p/3485624#M838027</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T07:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a spool requset for 'z program'.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-a-spool-requset-for-z-program/m-p/3485625#M838028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;&lt;SPAN __default_attr="sylfaen" __jive_macro_name="font"&gt;&lt;SPAN __default_attr="15" __jive_macro_name="size"&gt;
Spool request is automatically created when a background job is executed and list is generated.

For manually doing it via program check this sample code:

&lt;PRE&gt;&lt;CODE&gt;DATA: pripar TYPE pri_params,
      arcpar TYPE arc_params,
      lay TYPE pri_params-paart,
      lines TYPE pri_params-linct,
      rows TYPE pri_params-linsz.
DATA: val(1), val1(1).
DATA: dest TYPE pri_params-pdest VALUE 'NHREMOTE'.
DATA: name TYPE pri_params-plist VALUE 'Testing'.
DATA: i_pdf TYPE STANDARD TABLE OF tline.
DATA: spono TYPE tsp01-rqident.
 
CALL FUNCTION 'GET_PRINT_PARAMETERS'
  EXPORTING
    destination            = dest
    no_dialog              = 'X'
    immediately            = ' '
  IMPORTING
    out_archive_parameters = arcpar
    out_parameters         = pripar
    valid                  = val
    valid_for_spool_creation = val1
  EXCEPTIONS
    archive_info_not_found = 1
    invalid_print_params   = 2
    invalid_archive_params = 3
    OTHERS                 = 4.
IF sy-subrc NE 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
 
pripar-prdsn = 'DSN'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
  EXPORTING
    in_archive_parameters    = arcpar
    in_parameters            = pripar
    no_dialog                = 'X'
    list_name                = name
  IMPORTING
    out_archive_parameters   = arcpar
    out_parameters           = pripar
    valid                    = val
    valid_for_spool_creation = val1
  EXCEPTIONS
    archive_info_not_found   = 1
    invalid_print_params     = 2
    invalid_archive_params   = 3
    OTHERS                   = 4.
 
IF sy-subrc EQ 0.
  NEW-PAGE PRINT ON
  NEW-SECTION
  PARAMETERS pripar
  ARCHIVE PARAMETERS arcpar
  NO DIALOG.
ELSE.
  WRITE:/ 'Unable to create spool'.
   EXIT.
ENDIF.
 
WRITE:/ 'First Line'.
WRITE:/ 'Second Line'.
 
NEW-PAGE PRINT OFF.
 
spono = sy-spono.&lt;/CODE&gt;&lt;/PRE&gt;

System Variable SPONO holds the spool number. Now you can use the spool number for further processing like downloading to PC later or send a mail with the data in spool.
&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN __default_attr="maroon" __jive_macro_name="color"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 07:44:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-a-spool-requset-for-z-program/m-p/3485625#M838028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T07:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a spool requset for 'z program'.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-a-spool-requset-for-z-program/m-p/3485626#M838029</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;You can check the following code for reference&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_job_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get current job details&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'GET_JOB_RUNTIME_INFO'&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      eventid                 = gd_eventid&lt;/P&gt;&lt;P&gt;      eventparm               = gd_eventparm&lt;/P&gt;&lt;P&gt;      external_program_active = gd_external_program_active&lt;/P&gt;&lt;P&gt;      jobcount                = gd_jobcount&lt;/P&gt;&lt;P&gt;      jobname                 = gd_jobname&lt;/P&gt;&lt;P&gt;      stepcount               = gd_stepcount&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      no_runtime_info         = 1&lt;/P&gt;&lt;P&gt;      OTHERS                  = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_job_details&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;      Form  obtain_spool_id&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;To obtain the spool ID generated&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;FORM obtain_spool_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CHECK NOT ( gd_jobname IS INITIAL ).&lt;/P&gt;&lt;P&gt;  CHECK NOT ( gd_jobcount IS INITIAL ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * FROM  tbtcp&lt;/P&gt;&lt;P&gt;                 INTO TABLE it_tbtcp&lt;/P&gt;&lt;P&gt;                 WHERE      jobname     = gd_jobname&lt;/P&gt;&lt;P&gt;                 AND        jobcount    = gd_jobcount&lt;/P&gt;&lt;P&gt;                 AND        stepcount   = gd_stepcount&lt;/P&gt;&lt;P&gt;                 AND        listident   &amp;lt;&amp;gt; '0000000000'&lt;/P&gt;&lt;P&gt;                 ORDER BY   jobname&lt;/P&gt;&lt;P&gt;                            jobcount&lt;/P&gt;&lt;P&gt;                            stepcount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    gd_spool_nr = wa_tbtcp-listident.&lt;/P&gt;&lt;P&gt;    MESSAGE s004 WITH gd_spool_nr.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    MESSAGE s005.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " obtain_spool_id&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 07:47:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-a-spool-requset-for-z-program/m-p/3485626#M838029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T07:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a spool requset for 'z program'.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-a-spool-requset-for-z-program/m-p/3485627#M838030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is automaticaly done in batch, so i suppose you ask in interactive mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ways to produce a spool while being created are&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Execute a report using the Execute and print function &lt;/P&gt;&lt;P&gt;- Switch on printing in a report using the ABAP statement NEW-PAGE PRINT ON. &lt;/P&gt;&lt;P&gt;- Call a report using the statement SUBMIT rep TO SAP-SPOOL &lt;/P&gt;&lt;P&gt;- Schedule a report as a background job using the statement SUBMIT rep USER user VIA JOB job NUMBER n TO SAP-SPOOL. When the report runs, the system writes the output to the spool system. &lt;/P&gt;&lt;P&gt;- Schedule a report as a background job using the function module JOB_SUBMIT. When the report runs, the sytsem writes the output to the spool system. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also use "tips" like the following code to force printing :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TABLES sscrfields.

AT SELECTION-SCREEN.
IF sscrfields-ucomm = 'ONLI'.
  sscrfields-ucomm = 'PRIN'.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 07:56:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-a-spool-requset-for-z-program/m-p/3485627#M838030</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2008-02-28T07:56:15Z</dc:date>
    </item>
  </channel>
</rss>

