<?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 converting spool request into multiple pdf formated documents in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-spool-request-into-multiple-pdf-formated-documents/m-p/5601520#M1276594</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;             I am designing a report with several pages of output and running it in background.&lt;/P&gt;&lt;P&gt;Is there a possibility to convert each page into an separate pdf format document ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use ALV report as output, if its more than page, do I face any issue with pdf conversion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2009 00:32:47 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-06T00:32:47Z</dc:date>
    <item>
      <title>converting spool request into multiple pdf formated documents</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-spool-request-into-multiple-pdf-formated-documents/m-p/5601520#M1276594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;             I am designing a report with several pages of output and running it in background.&lt;/P&gt;&lt;P&gt;Is there a possibility to convert each page into an separate pdf format document ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use ALV report as output, if its more than page, do I face any issue with pdf conversion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 00:32:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-spool-request-into-multiple-pdf-formated-documents/m-p/5601520#M1276594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T00:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: converting spool request into multiple pdf formated documents</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/converting-spool-request-into-multiple-pdf-formated-documents/m-p/5601521#M1276595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the Following code, This might be helpful:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;form rstxpdft4 using filename.
*
* Read spool job contents (OTF or ABAP list) and convert
* to PDF, download PDF
*
  data: download  value 'X'.
  data: lv_filename like rlgrap-filename.

  lv_filename = filename.

  data otf like itcoo occurs 100 with header line.
  data cancel.
  data pdf like tline occurs 100 with header line.
  data doctab like docs occurs 1 with header line.
  data: numbytes type i,
        arc_idx like toa_dara,
        pdfspoolid like tsp01-rqident,
        jobname like tbtcjob-jobname,
        jobcount like tbtcjob-jobcount,
        is_otf.
  data: client like tst01-dclient,
        name like tst01-dname,
        objtype like rststype-type,
        type like rststype-type.

  select single * from tsp01 where rqident = gt_rq-rqident.
  if sy-subrc &amp;lt;&amp;gt; 0.

    write: / 'Spool request does not exist', gt_rq-rqident
            color col_negative.
    exit.
  endif.
  client = tsp01-rqclient.
  name   = tsp01-rqo1name.
  call function 'RSTS_GET_ATTRIBUTES'
       exporting
            authority     = 'SP01'
            client        = client
            name          = name
            part          = 1
       importing
            type          = type
            objtype       = objtype
       exceptions
            fb_error      = 1
            fb_rsts_other = 2
            no_object     = 3
            no_permission = 4.
  if objtype(3) = 'OTF'.
    is_otf = 'X'.
  else.
    is_otf = space.
  endif.
  if is_otf = 'X'.
    call function 'CONVERT_OTFSPOOLJOB_2_PDF'
         exporting
              src_spoolid              = gt_rq-rqident
              no_dialog                = ' '
         importing
              pdf_bytecount            = numbytes
              pdf_spoolid              = pdfspoolid
              btc_jobname              = jobname
              btc_jobcount             = jobcount
         tables
              pdf                      = pdf  .
  else.
    call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
         exporting
              src_spoolid              = gt_rq-rqident
              no_dialog                = ' '
         importing
              pdf_bytecount            = numbytes
              pdf_spoolid              = pdfspoolid
              btc_jobname              = jobname
              btc_jobcount             = jobcount
         tables
              pdf                      = pdf
          .
*************** download PDF file ***********
 v_filename = lv_filename.
*  call function 'WS_DOWNLOAD'
*       exporting
*            bin_filesize            = numbytes
*            filename                = lv_filename
*            filetype                = 'BIN'
*       tables
*            data_tab                = pdf
*       exceptions
*            file_open_error         = 1
*            file_write_error        = 2
*            invalid_filesize        = 3
*            invalid_type            = 4
*            no_batch                = 5
*            unknown_error           = 6
*            invalid_table_width     = 7
*            gui_refuse_filetransfer = 8
*            customer_error          = 9
*            others                  = 10.
*  if sy-subrc &amp;lt;&amp;gt; 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
**         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*  else.
*    gv_count = gv_count + 1.
*  endif.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    BIN_FILESIZE                    = numbytes
    FILENAME                        = v_filename
    FILETYPE                        = 'BIN'
*   APPEND                          = ' '
*   WRITE_FIELD_SEPARATOR           = ' '
*   HEADER                          = '00'
*   TRUNC_TRAILING_BLANKS           = ' '
*   WRITE_LF                        = 'X'
*   COL_SELECT                      = ' '
*   COL_SELECT_MASK                 = ' '
*   DAT_MODE                        = ' '
*   CONFIRM_OVERWRITE               = ' '
*   NO_AUTH_CHECK                   = ' '
*   CODEPAGE                        = ' '
*   IGNORE_CERR                     = ABAP_TRUE
*   REPLACEMENT                     = '#'
*   WRITE_BOM                       = ' '
*   TRUNC_TRAILING_BLANKS_EOL       = 'X'
*   WK1_N_FORMAT                    = ' '
*   WK1_N_SIZE                      = ' '
*   WK1_T_FORMAT                    = ' '
*   WK1_T_SIZE                      = ' '
*   WRITE_LF_AFTER_LAST_LINE        = ABAP_TRUE
*   SHOW_TRANSFER_STATUS            = ABAP_TRUE
* IMPORTING
*   FILELENGTH                      =
  TABLES
    DATA_TAB                        = pdf .
*   FIELDNAMES                      =&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 01:05:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/converting-spool-request-into-multiple-pdf-formated-documents/m-p/5601521#M1276595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T01:05:19Z</dc:date>
    </item>
  </channel>
</rss>

