<?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: Fetching data from Spool in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-spool/m-p/2974767#M702111</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Saras Jain,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a method which i have return to get the spool id later using this spool id i'll show the report in PDF. In your case its XI. But the logic is same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* * *
* Purpose:  Print remuneration Statements of the given payroll area for the current period;
*           Excecute the report RPCEDTK0 (Remuneration Statements for Canada) in backgound mode
*           and send the output to the print spool. Return the generated spool request number and spool type
* * *

  py_available = space. " Remuneration statements are not available initially

* Get Print Parameters
  DATA: l_valid TYPE c,                                     "#EC NEEDED
        ls_params  TYPE pri_params.

  CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
      no_dialog              = 'X'
      layout                 = 'X_65_132'
    IMPORTING
      valid                  = l_valid
      out_parameters         = ls_params
    EXCEPTIONS
      archive_info_not_found = 1
      invalid_print_params   = 2
      invalid_archive_params = 3
      OTHERS                 = 4.

  IF sy-subrc IS INITIAL.

    DATA: l_jobcount TYPE tbtcjob-jobcount,
          l_jobname  TYPE tbtcjob-jobname VALUE 'RPCEDTK0' .

*   Open a background job
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = l_jobname
      IMPORTING
        jobcount         = l_jobcount
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.

    IF sy-subrc IS INITIAL.

*     Submit the report RPCEDTK0 in background mode and send the output to
*     the spool; PCS_HR_CA_CALC is standard variant and part of the R2R content.
      SUBMIT rpcedtk0
        USING SELECTION-SET 'BP_HR_CA_CALC'              "#EC CI_SUBMIT
*        with andruck ...
*        with anz-test ...
        WITH bondt EQ space       " Off-cycle Payroll Payment Date for Special Run
        WITH chk_ess EQ space     " Check ESS
*        with compress ...
        WITH cur_alt EQ space     " Ouput Currency: Alternative currency
        WITH cur_fp EQ 'X'        " Ouput Currency: For-period
        WITH cur_ip EQ space      " Ouput Currency: In-period
        WITH cur_val EQ space     " Ouput Currency: Alternative currency value
*        with exp_frm ...
*        with formular ...
*        with impmem ...
        WITH only EQ space        " Print Superlines
        WITH payid EQ space       " Payroll Identifier  for Special Run
        WITH payty EQ space       " Payroll Type for Special Run
        WITH pnpabkrs EQ abkrs    " Payroll Area for Selection
*        with pnpansvh ...
*        with pnpbegda ...
*        with pnpbegps ...
*        with pnpbtrtl ...
*        with pnpbukrs ...
*        with pnpdisbd ...
*        with pnpdised ...
*        with pnpdispj ...
*        with pnpdispp ...
*        with pnpename ...
*        with pnpendda ...
*        with pnpendps ...
*        with pnpesscf ...
*        with pnpfistl ...
*        with pnpfkber ...
*        with pnpgeber ...
*        with pnpgrant ...
*        with pnpgsber ...
*        with pnpindex ...
*        with pnpjuper ...
*        with pnpkokrs ...
*        with pnpkoktl ...
*        with pnpkostl ...
*        with pnpmasng ...
*        with pnpmassg ...
*        with pnpmassn ...
*        with pnpmcide ...
*        with pnpmcstr ...
*        with pnpmstbr ...
*        with pnpobjid ...
*        with pnporgeh ...
*        with pnpotype ...
        WITH pnppabrj EQ space  " Payroll Year
        WITH pnppabrp EQ space  " Payroll Period
*        with pnppernr ...
*        with pnppernr ...
*        with pnppersg ...
*        with pnppersk ...
*        with pnpplans ...
*        with pnpplvar ...
*        with pnpsacha ...
*        with pnpsachp ...
*        with pnpsachz ...
*        with pnpsasba ...
*        with pnpsasbp ...
*        with pnpsasbz ...
*        with pnpsbmod ...
*        with pnpsname ...
*        with pnpsortf ...
*        with pnpsortt ...
*        with pnpstat1 ...
*        with pnpstat2 ...
*        with pnpstat3 ...
*        with pnpstatu ...
*        with pnpstell ...
*        with pnptimed ...
*        with pnptimr1 ...
*        with pnptimr2 ...
*        with pnptimr3 ...
*        with pnptimr4 ...
*        with pnptimr5 ...
*        with pnptimr6 ...
        WITH pnptimr9 EQ 'X'      " Current Period
        WITH pnptimra EQ space    " Other Period
*        with pnpvdsk1 ...
*        with pnpwerks ...
        WITH pnpxabkr EQ abkrs    " Payroll Area for Selection
*        with pnpxbwbk ...
*        with pnpxpgpk ...
        WITH prt_prot EQ space    " Output Log
*        with pyabrj0 ...
*        with pyabrj1 ...
*        with pyabrp0 ...
*        with pyabrp1 ...
*        with pyarch ...
*        with pybegda ...
*        with pyct_per ...
*        with pyendda ...
*        with pyeval ...
*        with pypa03r0 ...
*        with pypa03r1 ...
*        with pyparaid ...
*        with pyscreen ...
*        with pysortt ...
*        with pyvw0 ...
*        with pyvw0_0 ...
*        with pyvw0_1 ...
*        with pyvw1 ...
*        with pyvw1_0 ...
*        with pyvw1_1 ...
*        with pyvw2 ...
*        with pyvw2_0 ...
*        with pyxabkr ...
*        with rueckd ...
*        with rueckr ...
*        with sort_rr ...
*        with sprache ...
        VIA JOB l_jobname NUMBER l_jobcount
        TO SAP-SPOOL WITHOUT SPOOL DYNPRO SPOOL PARAMETERS ls_params
        AND RETURN.

      IF sy-subrc &amp;lt;&amp;gt; 0.

      ENDIF. " SUBMIT rpcedtk0

*     Schedule and close job.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = l_jobcount
          jobname              = l_jobname
          strtimmed            = 'X'
        EXCEPTIONS
          cant_start_immediate = 1
          invalid_startdate    = 2
          jobname_missing      = 3
          job_close_failed     = 4
          job_nosteps          = 5
          job_notex            = 6
          lock_failed          = 7
          invalid_target       = 8
          OTHERS               = 9.

      IF sy-subrc IS INITIAL.

*       Retreive the latest spool of the logged in user
        DATA: l_job_read_jobhead   TYPE tbtcjob,
              it_job_read_steplist TYPE TABLE OF tbtcstep,
              wa_job_read_steplist TYPE tbtcstep.

        DO.
          CALL FUNCTION 'BP_JOB_READ'
            EXPORTING
              job_read_jobcount     = l_jobcount
              job_read_jobname      = l_jobname
              job_read_opcode       = 20
            IMPORTING
              job_read_jobhead      = l_job_read_jobhead
            TABLES
              job_read_steplist     = it_job_read_steplist
            EXCEPTIONS
              invalid_opcode        = 1
              job_doesnt_exist      = 2
              job_doesnt_have_steps = 3
              OTHERS                = 4.

          IF sy-subrc IS INITIAL.
            IF l_job_read_jobhead-status EQ 'F'.
              READ TABLE it_job_read_steplist INDEX 1 INTO wa_job_read_steplist.
              py_spool_id = wa_job_read_steplist-listident.
              py_spool_type = 'A'.
              IF NOT py_spool_id IS INITIAL.
                py_available = 'X'.
              ENDIF.
              EXIT.
            ENDIF.
          ENDIF. " BP_JOB_READ
        ENDDO.

      ENDIF. " JOB_CLOSE

    ENDIF. " JOB_OPEN

  ENDIF. " GET_PRINT_PARAMETERS
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful,&lt;/P&gt;&lt;P&gt;Aleem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Nov 2007 07:14:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-15T07:14:38Z</dc:date>
    <item>
      <title>Fetching data from Spool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-spool/m-p/2974765#M702109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I need to do the following:-&lt;/P&gt;&lt;P&gt;There are certain list of transactions that gives ALV List as output and reading data directly from that list is not possible.&lt;/P&gt;&lt;P&gt;So we need to run  transactions like IW58 in background and generate a spool job. Then we need to pick the spool via spool number and read the data in it.&lt;/P&gt;&lt;P&gt;How do we pick data from our spool and process that through XI and update the data base.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Saras Jain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 09:05:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-spool/m-p/2974765#M702109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T09:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from Spool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-spool/m-p/2974766#M702110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RSPO_RETURN_ABAP_SPOOLJOB Fetch printer spool according to the spool number informed &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Nov 2007 15:43:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-spool/m-p/2974766#M702110</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-14T15:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from Spool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-spool/m-p/2974767#M702111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Saras Jain,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a method which i have return to get the spool id later using this spool id i'll show the report in PDF. In your case its XI. But the logic is same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* * *
* Purpose:  Print remuneration Statements of the given payroll area for the current period;
*           Excecute the report RPCEDTK0 (Remuneration Statements for Canada) in backgound mode
*           and send the output to the print spool. Return the generated spool request number and spool type
* * *

  py_available = space. " Remuneration statements are not available initially

* Get Print Parameters
  DATA: l_valid TYPE c,                                     "#EC NEEDED
        ls_params  TYPE pri_params.

  CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
      no_dialog              = 'X'
      layout                 = 'X_65_132'
    IMPORTING
      valid                  = l_valid
      out_parameters         = ls_params
    EXCEPTIONS
      archive_info_not_found = 1
      invalid_print_params   = 2
      invalid_archive_params = 3
      OTHERS                 = 4.

  IF sy-subrc IS INITIAL.

    DATA: l_jobcount TYPE tbtcjob-jobcount,
          l_jobname  TYPE tbtcjob-jobname VALUE 'RPCEDTK0' .

*   Open a background job
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        jobname          = l_jobname
      IMPORTING
        jobcount         = l_jobcount
      EXCEPTIONS
        cant_create_job  = 1
        invalid_job_data = 2
        jobname_missing  = 3
        OTHERS           = 4.

    IF sy-subrc IS INITIAL.

*     Submit the report RPCEDTK0 in background mode and send the output to
*     the spool; PCS_HR_CA_CALC is standard variant and part of the R2R content.
      SUBMIT rpcedtk0
        USING SELECTION-SET 'BP_HR_CA_CALC'              "#EC CI_SUBMIT
*        with andruck ...
*        with anz-test ...
        WITH bondt EQ space       " Off-cycle Payroll Payment Date for Special Run
        WITH chk_ess EQ space     " Check ESS
*        with compress ...
        WITH cur_alt EQ space     " Ouput Currency: Alternative currency
        WITH cur_fp EQ 'X'        " Ouput Currency: For-period
        WITH cur_ip EQ space      " Ouput Currency: In-period
        WITH cur_val EQ space     " Ouput Currency: Alternative currency value
*        with exp_frm ...
*        with formular ...
*        with impmem ...
        WITH only EQ space        " Print Superlines
        WITH payid EQ space       " Payroll Identifier  for Special Run
        WITH payty EQ space       " Payroll Type for Special Run
        WITH pnpabkrs EQ abkrs    " Payroll Area for Selection
*        with pnpansvh ...
*        with pnpbegda ...
*        with pnpbegps ...
*        with pnpbtrtl ...
*        with pnpbukrs ...
*        with pnpdisbd ...
*        with pnpdised ...
*        with pnpdispj ...
*        with pnpdispp ...
*        with pnpename ...
*        with pnpendda ...
*        with pnpendps ...
*        with pnpesscf ...
*        with pnpfistl ...
*        with pnpfkber ...
*        with pnpgeber ...
*        with pnpgrant ...
*        with pnpgsber ...
*        with pnpindex ...
*        with pnpjuper ...
*        with pnpkokrs ...
*        with pnpkoktl ...
*        with pnpkostl ...
*        with pnpmasng ...
*        with pnpmassg ...
*        with pnpmassn ...
*        with pnpmcide ...
*        with pnpmcstr ...
*        with pnpmstbr ...
*        with pnpobjid ...
*        with pnporgeh ...
*        with pnpotype ...
        WITH pnppabrj EQ space  " Payroll Year
        WITH pnppabrp EQ space  " Payroll Period
*        with pnppernr ...
*        with pnppernr ...
*        with pnppersg ...
*        with pnppersk ...
*        with pnpplans ...
*        with pnpplvar ...
*        with pnpsacha ...
*        with pnpsachp ...
*        with pnpsachz ...
*        with pnpsasba ...
*        with pnpsasbp ...
*        with pnpsasbz ...
*        with pnpsbmod ...
*        with pnpsname ...
*        with pnpsortf ...
*        with pnpsortt ...
*        with pnpstat1 ...
*        with pnpstat2 ...
*        with pnpstat3 ...
*        with pnpstatu ...
*        with pnpstell ...
*        with pnptimed ...
*        with pnptimr1 ...
*        with pnptimr2 ...
*        with pnptimr3 ...
*        with pnptimr4 ...
*        with pnptimr5 ...
*        with pnptimr6 ...
        WITH pnptimr9 EQ 'X'      " Current Period
        WITH pnptimra EQ space    " Other Period
*        with pnpvdsk1 ...
*        with pnpwerks ...
        WITH pnpxabkr EQ abkrs    " Payroll Area for Selection
*        with pnpxbwbk ...
*        with pnpxpgpk ...
        WITH prt_prot EQ space    " Output Log
*        with pyabrj0 ...
*        with pyabrj1 ...
*        with pyabrp0 ...
*        with pyabrp1 ...
*        with pyarch ...
*        with pybegda ...
*        with pyct_per ...
*        with pyendda ...
*        with pyeval ...
*        with pypa03r0 ...
*        with pypa03r1 ...
*        with pyparaid ...
*        with pyscreen ...
*        with pysortt ...
*        with pyvw0 ...
*        with pyvw0_0 ...
*        with pyvw0_1 ...
*        with pyvw1 ...
*        with pyvw1_0 ...
*        with pyvw1_1 ...
*        with pyvw2 ...
*        with pyvw2_0 ...
*        with pyxabkr ...
*        with rueckd ...
*        with rueckr ...
*        with sort_rr ...
*        with sprache ...
        VIA JOB l_jobname NUMBER l_jobcount
        TO SAP-SPOOL WITHOUT SPOOL DYNPRO SPOOL PARAMETERS ls_params
        AND RETURN.

      IF sy-subrc &amp;lt;&amp;gt; 0.

      ENDIF. " SUBMIT rpcedtk0

*     Schedule and close job.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = l_jobcount
          jobname              = l_jobname
          strtimmed            = 'X'
        EXCEPTIONS
          cant_start_immediate = 1
          invalid_startdate    = 2
          jobname_missing      = 3
          job_close_failed     = 4
          job_nosteps          = 5
          job_notex            = 6
          lock_failed          = 7
          invalid_target       = 8
          OTHERS               = 9.

      IF sy-subrc IS INITIAL.

*       Retreive the latest spool of the logged in user
        DATA: l_job_read_jobhead   TYPE tbtcjob,
              it_job_read_steplist TYPE TABLE OF tbtcstep,
              wa_job_read_steplist TYPE tbtcstep.

        DO.
          CALL FUNCTION 'BP_JOB_READ'
            EXPORTING
              job_read_jobcount     = l_jobcount
              job_read_jobname      = l_jobname
              job_read_opcode       = 20
            IMPORTING
              job_read_jobhead      = l_job_read_jobhead
            TABLES
              job_read_steplist     = it_job_read_steplist
            EXCEPTIONS
              invalid_opcode        = 1
              job_doesnt_exist      = 2
              job_doesnt_have_steps = 3
              OTHERS                = 4.

          IF sy-subrc IS INITIAL.
            IF l_job_read_jobhead-status EQ 'F'.
              READ TABLE it_job_read_steplist INDEX 1 INTO wa_job_read_steplist.
              py_spool_id = wa_job_read_steplist-listident.
              py_spool_type = 'A'.
              IF NOT py_spool_id IS INITIAL.
                py_available = 'X'.
              ENDIF.
              EXIT.
            ENDIF.
          ENDIF. " BP_JOB_READ
        ENDDO.

      ENDIF. " JOB_CLOSE

    ENDIF. " JOB_OPEN

  ENDIF. " GET_PRINT_PARAMETERS
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful,&lt;/P&gt;&lt;P&gt;Aleem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Nov 2007 07:14:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-spool/m-p/2974767#M702111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-15T07:14:38Z</dc:date>
    </item>
  </channel>
</rss>

