<?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 Merging multiple spools into a single PDF to attach workflow in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-multiple-spools-into-a-single-pdf-to-attach-workflow/m-p/554664#M21180</link>
    <description>&lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Dear Experts,&lt;/P&gt;
  &lt;P&gt;I have a requirement to merge multiple spools into a single PDF and attaching this final pdf to a workflow work item for approval.&lt;/P&gt;
  &lt;P&gt;Below is the process I followed for 3 spools conversion&lt;/P&gt;
  &lt;P&gt;1) ‘CONVERT_ABAPSPOOLJOB_2_PDF’ – To convert spool into PDF format&lt;/P&gt;
  &lt;P&gt;2) SX_TABLE_LINE_WIDTH_CHANGE – To Change the line width&lt;/P&gt;
  &lt;P&gt;3) SCMS_BINARY_TO_XSTRING – To Convert Binary to XSTRING format&lt;/P&gt;
  &lt;P&gt;4) SCMS_XSTRING_TO_BINARY – To convert XSTRING to Binary&lt;/P&gt;
  &lt;P&gt;5) Appended 3 internal tables data to single internal table and passing the final internal table to&lt;/P&gt;
  &lt;P&gt;method cl_gui_frontend_services=&amp;gt;gui_download.&lt;/P&gt;
  &lt;P&gt;I wrote the below code to to merge 3 spools into single pdf, program could able to generate a pdf but showing only single spool(First spool) .&lt;/P&gt;
  &lt;P&gt;Where I am missing??????? Could you please help us in complete the requirement.&lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;
  &lt;P&gt;REPORT ZSPOOL.&lt;BR /&gt;PARAMETERS e_spool TYPE rspoid.&lt;BR /&gt;PARAMETERS e_spool1 TYPE rspoid.&lt;BR /&gt;PARAMETERS e_spool2 TYPE rspoid.&lt;BR /&gt;*PERFORM ali_spool_generator&lt;BR /&gt;* CHANGING&lt;BR /&gt;* e_spool.&lt;BR /&gt;DATA et_pdf TYPE tline_tab.&lt;BR /&gt;DATA et_pdf1 TYPE tline_tab.&lt;BR /&gt;DATA et_pdf2 TYPE tline_tab.&lt;BR /&gt;DATA e_binary_length TYPE i.&lt;BR /&gt;DATA e_binary_length1 TYPE i.&lt;BR /&gt;DATA e_binary_length2 TYPE i.&lt;BR /&gt;PERFORM convert_ali_spool_to_pdf&lt;BR /&gt;USING&lt;BR /&gt; e_spool&lt;BR /&gt;CHANGING&lt;BR /&gt; et_pdf&lt;BR /&gt; e_binary_length.&lt;BR /&gt;PERFORM convert_ali_spool_to_pdf&lt;BR /&gt;USING&lt;BR /&gt; e_spool1&lt;BR /&gt;CHANGING&lt;BR /&gt; et_pdf1&lt;BR /&gt; e_binary_length1.&lt;BR /&gt;PERFORM convert_ali_spool_to_pdf&lt;BR /&gt;USING&lt;BR /&gt; e_spool2&lt;BR /&gt;CHANGING&lt;BR /&gt; et_pdf2&lt;BR /&gt; e_binary_length2.&lt;BR /&gt;data SOLI_TAB type SOLI_TAB.&lt;BR /&gt;data SOLI_TAB1 type SOLI_TAB.&lt;BR /&gt;data SOLI_TAB2 type SOLI_TAB.&lt;BR /&gt;CALL FUNCTION ‘SX_TABLE_LINE_WIDTH_CHANGE’&lt;BR /&gt;TABLES&lt;BR /&gt; content_in = et_pdf&lt;BR /&gt; content_out = SOLI_TAB&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 4.&lt;BR /&gt;CALL FUNCTION ‘SX_TABLE_LINE_WIDTH_CHANGE’&lt;BR /&gt;TABLES&lt;BR /&gt; content_in = et_pdf1&lt;BR /&gt; content_out = SOLI_TAB1&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 4.&lt;/P&gt;
  &lt;P&gt;CALL FUNCTION ‘SX_TABLE_LINE_WIDTH_CHANGE’&lt;BR /&gt;TABLES&lt;BR /&gt; content_in = et_pdf2&lt;BR /&gt; content_out = SOLI_TAB2&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 4.&lt;/P&gt;
  &lt;P&gt;data e_xstring TYPE xstring.&lt;BR /&gt;data e_xstring1 TYPE xstring.&lt;BR /&gt;data e_xstring2 TYPE xstring.&lt;BR /&gt;CALL FUNCTION ‘SCMS_BINARY_TO_XSTRING’&lt;BR /&gt;EXPORTING&lt;BR /&gt; input_length = e_binary_length&lt;BR /&gt;IMPORTING&lt;BR /&gt;buffer = e_xstring&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = SOLI_TAB&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 2.&lt;BR /&gt;CALL FUNCTION ‘SCMS_BINARY_TO_XSTRING’&lt;BR /&gt;EXPORTING&lt;BR /&gt; input_length = e_binary_length1&lt;BR /&gt;IMPORTING&lt;BR /&gt;buffer = e_xstring1&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = SOLI_TAB1&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 2.&lt;/P&gt;
  &lt;P&gt;CALL FUNCTION ‘SCMS_BINARY_TO_XSTRING’&lt;BR /&gt;EXPORTING&lt;BR /&gt; input_length = e_binary_length2&lt;BR /&gt;IMPORTING&lt;BR /&gt;buffer = e_xstring2&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = SOLI_TAB2&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 2.&lt;/P&gt;
  &lt;P&gt;DATA lt_solix TYPE solix_tab.&lt;BR /&gt;DATA lt_solix1 TYPE solix_tab.&lt;BR /&gt;DATA lt_solix2 TYPE solix_tab.&lt;BR /&gt;CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’&lt;BR /&gt;EXPORTING&lt;BR /&gt;buffer = e_xstring&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = lt_solix.&lt;BR /&gt;CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’&lt;BR /&gt;EXPORTING&lt;BR /&gt;buffer = e_xstring1&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = lt_solix1.&lt;/P&gt;
  &lt;P&gt;CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’&lt;BR /&gt;EXPORTING&lt;BR /&gt;buffer = e_xstring2&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = lt_solix2.&lt;/P&gt;
  &lt;P&gt;append LINES OF lt_solix1 to lt_solix.&lt;BR /&gt;append LINES OF lt_solix2 to lt_solix.&lt;/P&gt;
  &lt;P&gt;* REPLACE THAT BY YOUR CODE TO SEND MAIL&lt;BR /&gt;CALL METHOD cl_gui_frontend_services=&amp;gt;gui_download&lt;BR /&gt;EXPORTING&lt;BR /&gt; bin_filesize = e_binary_length&lt;BR /&gt; filename = `C:\Users\ffffffffff.pdf`&lt;BR /&gt; filetype = ‘BIN’&lt;BR /&gt;CHANGING&lt;BR /&gt; data_tab = lt_solix&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 3.&lt;BR /&gt;* &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;
  &lt;P&gt;FORM ali_spool_generator&lt;BR /&gt;CHANGING&lt;BR /&gt; e_spoolid TYPE rspoid.&lt;BR /&gt;* NEW-PAGE PRINT ON NO DIALOG.&lt;BR /&gt;* WRITE : / ‘Hello World’.&lt;BR /&gt;* NEW-PAGE PRINT OFF.&lt;BR /&gt;* e_spoolid = sy-spono.&lt;BR /&gt;* COMMIT WORK.&lt;BR /&gt;ENDFORM.&lt;/P&gt;
  &lt;P&gt;FORM convert_ali_spool_to_pdf&lt;BR /&gt;USING&lt;BR /&gt; i_spoolid TYPE rspoid&lt;BR /&gt;CHANGING&lt;BR /&gt; et_pdf TYPE tline_tab&lt;BR /&gt; e_binary_length TYPE i.&lt;BR /&gt;CALL FUNCTION ‘CONVERT_ABAPSPOOLJOB_2_PDF’&lt;BR /&gt;EXPORTING&lt;BR /&gt; src_spoolid = i_spoolid&lt;BR /&gt; no_dialog = ‘X’&lt;BR /&gt;IMPORTING&lt;BR /&gt; pdf_bytecount = e_binary_length&lt;BR /&gt;TABLES&lt;BR /&gt; pdf = et_pdf&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 12.&lt;BR /&gt;ENDFORM.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Dec 2017 15:47:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2017-12-04T15:47:56Z</dc:date>
    <item>
      <title>Merging multiple spools into a single PDF to attach workflow</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-multiple-spools-into-a-single-pdf-to-attach-workflow/m-p/554664#M21180</link>
      <description>&lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Dear Experts,&lt;/P&gt;
  &lt;P&gt;I have a requirement to merge multiple spools into a single PDF and attaching this final pdf to a workflow work item for approval.&lt;/P&gt;
  &lt;P&gt;Below is the process I followed for 3 spools conversion&lt;/P&gt;
  &lt;P&gt;1) ‘CONVERT_ABAPSPOOLJOB_2_PDF’ – To convert spool into PDF format&lt;/P&gt;
  &lt;P&gt;2) SX_TABLE_LINE_WIDTH_CHANGE – To Change the line width&lt;/P&gt;
  &lt;P&gt;3) SCMS_BINARY_TO_XSTRING – To Convert Binary to XSTRING format&lt;/P&gt;
  &lt;P&gt;4) SCMS_XSTRING_TO_BINARY – To convert XSTRING to Binary&lt;/P&gt;
  &lt;P&gt;5) Appended 3 internal tables data to single internal table and passing the final internal table to&lt;/P&gt;
  &lt;P&gt;method cl_gui_frontend_services=&amp;gt;gui_download.&lt;/P&gt;
  &lt;P&gt;I wrote the below code to to merge 3 spools into single pdf, program could able to generate a pdf but showing only single spool(First spool) .&lt;/P&gt;
  &lt;P&gt;Where I am missing??????? Could you please help us in complete the requirement.&lt;/P&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;
  &lt;P&gt;REPORT ZSPOOL.&lt;BR /&gt;PARAMETERS e_spool TYPE rspoid.&lt;BR /&gt;PARAMETERS e_spool1 TYPE rspoid.&lt;BR /&gt;PARAMETERS e_spool2 TYPE rspoid.&lt;BR /&gt;*PERFORM ali_spool_generator&lt;BR /&gt;* CHANGING&lt;BR /&gt;* e_spool.&lt;BR /&gt;DATA et_pdf TYPE tline_tab.&lt;BR /&gt;DATA et_pdf1 TYPE tline_tab.&lt;BR /&gt;DATA et_pdf2 TYPE tline_tab.&lt;BR /&gt;DATA e_binary_length TYPE i.&lt;BR /&gt;DATA e_binary_length1 TYPE i.&lt;BR /&gt;DATA e_binary_length2 TYPE i.&lt;BR /&gt;PERFORM convert_ali_spool_to_pdf&lt;BR /&gt;USING&lt;BR /&gt; e_spool&lt;BR /&gt;CHANGING&lt;BR /&gt; et_pdf&lt;BR /&gt; e_binary_length.&lt;BR /&gt;PERFORM convert_ali_spool_to_pdf&lt;BR /&gt;USING&lt;BR /&gt; e_spool1&lt;BR /&gt;CHANGING&lt;BR /&gt; et_pdf1&lt;BR /&gt; e_binary_length1.&lt;BR /&gt;PERFORM convert_ali_spool_to_pdf&lt;BR /&gt;USING&lt;BR /&gt; e_spool2&lt;BR /&gt;CHANGING&lt;BR /&gt; et_pdf2&lt;BR /&gt; e_binary_length2.&lt;BR /&gt;data SOLI_TAB type SOLI_TAB.&lt;BR /&gt;data SOLI_TAB1 type SOLI_TAB.&lt;BR /&gt;data SOLI_TAB2 type SOLI_TAB.&lt;BR /&gt;CALL FUNCTION ‘SX_TABLE_LINE_WIDTH_CHANGE’&lt;BR /&gt;TABLES&lt;BR /&gt; content_in = et_pdf&lt;BR /&gt; content_out = SOLI_TAB&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 4.&lt;BR /&gt;CALL FUNCTION ‘SX_TABLE_LINE_WIDTH_CHANGE’&lt;BR /&gt;TABLES&lt;BR /&gt; content_in = et_pdf1&lt;BR /&gt; content_out = SOLI_TAB1&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 4.&lt;/P&gt;
  &lt;P&gt;CALL FUNCTION ‘SX_TABLE_LINE_WIDTH_CHANGE’&lt;BR /&gt;TABLES&lt;BR /&gt; content_in = et_pdf2&lt;BR /&gt; content_out = SOLI_TAB2&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 4.&lt;/P&gt;
  &lt;P&gt;data e_xstring TYPE xstring.&lt;BR /&gt;data e_xstring1 TYPE xstring.&lt;BR /&gt;data e_xstring2 TYPE xstring.&lt;BR /&gt;CALL FUNCTION ‘SCMS_BINARY_TO_XSTRING’&lt;BR /&gt;EXPORTING&lt;BR /&gt; input_length = e_binary_length&lt;BR /&gt;IMPORTING&lt;BR /&gt;buffer = e_xstring&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = SOLI_TAB&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 2.&lt;BR /&gt;CALL FUNCTION ‘SCMS_BINARY_TO_XSTRING’&lt;BR /&gt;EXPORTING&lt;BR /&gt; input_length = e_binary_length1&lt;BR /&gt;IMPORTING&lt;BR /&gt;buffer = e_xstring1&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = SOLI_TAB1&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 2.&lt;/P&gt;
  &lt;P&gt;CALL FUNCTION ‘SCMS_BINARY_TO_XSTRING’&lt;BR /&gt;EXPORTING&lt;BR /&gt; input_length = e_binary_length2&lt;BR /&gt;IMPORTING&lt;BR /&gt;buffer = e_xstring2&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = SOLI_TAB2&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 2.&lt;/P&gt;
  &lt;P&gt;DATA lt_solix TYPE solix_tab.&lt;BR /&gt;DATA lt_solix1 TYPE solix_tab.&lt;BR /&gt;DATA lt_solix2 TYPE solix_tab.&lt;BR /&gt;CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’&lt;BR /&gt;EXPORTING&lt;BR /&gt;buffer = e_xstring&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = lt_solix.&lt;BR /&gt;CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’&lt;BR /&gt;EXPORTING&lt;BR /&gt;buffer = e_xstring1&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = lt_solix1.&lt;/P&gt;
  &lt;P&gt;CALL FUNCTION ‘SCMS_XSTRING_TO_BINARY’&lt;BR /&gt;EXPORTING&lt;BR /&gt;buffer = e_xstring2&lt;BR /&gt;TABLES&lt;BR /&gt; binary_tab = lt_solix2.&lt;/P&gt;
  &lt;P&gt;append LINES OF lt_solix1 to lt_solix.&lt;BR /&gt;append LINES OF lt_solix2 to lt_solix.&lt;/P&gt;
  &lt;P&gt;* REPLACE THAT BY YOUR CODE TO SEND MAIL&lt;BR /&gt;CALL METHOD cl_gui_frontend_services=&amp;gt;gui_download&lt;BR /&gt;EXPORTING&lt;BR /&gt; bin_filesize = e_binary_length&lt;BR /&gt; filename = `C:\Users\ffffffffff.pdf`&lt;BR /&gt; filetype = ‘BIN’&lt;BR /&gt;CHANGING&lt;BR /&gt; data_tab = lt_solix&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 3.&lt;BR /&gt;* &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/P&gt;
  &lt;P&gt;FORM ali_spool_generator&lt;BR /&gt;CHANGING&lt;BR /&gt; e_spoolid TYPE rspoid.&lt;BR /&gt;* NEW-PAGE PRINT ON NO DIALOG.&lt;BR /&gt;* WRITE : / ‘Hello World’.&lt;BR /&gt;* NEW-PAGE PRINT OFF.&lt;BR /&gt;* e_spoolid = sy-spono.&lt;BR /&gt;* COMMIT WORK.&lt;BR /&gt;ENDFORM.&lt;/P&gt;
  &lt;P&gt;FORM convert_ali_spool_to_pdf&lt;BR /&gt;USING&lt;BR /&gt; i_spoolid TYPE rspoid&lt;BR /&gt;CHANGING&lt;BR /&gt; et_pdf TYPE tline_tab&lt;BR /&gt; e_binary_length TYPE i.&lt;BR /&gt;CALL FUNCTION ‘CONVERT_ABAPSPOOLJOB_2_PDF’&lt;BR /&gt;EXPORTING&lt;BR /&gt; src_spoolid = i_spoolid&lt;BR /&gt; no_dialog = ‘X’&lt;BR /&gt;IMPORTING&lt;BR /&gt; pdf_bytecount = e_binary_length&lt;BR /&gt;TABLES&lt;BR /&gt; pdf = et_pdf&lt;BR /&gt;EXCEPTIONS&lt;BR /&gt;OTHERS = 12.&lt;BR /&gt;ENDFORM.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 15:47:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-multiple-spools-into-a-single-pdf-to-attach-workflow/m-p/554664#M21180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-12-04T15:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Merging multiple spools into a single PDF to attach workflow</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-multiple-spools-into-a-single-pdf-to-attach-workflow/m-p/554665#M21181</link>
      <description>&lt;P&gt;It's been asked several times how to merge spools into one pdf. Please search the forum.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 17:37:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-multiple-spools-into-a-single-pdf-to-attach-workflow/m-p/554665#M21181</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-12-04T17:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: Merging multiple spools into a single PDF to attach workflow</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/merging-multiple-spools-into-a-single-pdf-to-attach-workflow/m-p/554666#M21182</link>
      <description>&lt;P&gt;call the below FM in a loop three times if you want to create three spools and the later merge into PDF.&lt;/P&gt;
  &lt;P&gt;FORM convert_ali_spool_to_pdf&lt;BR /&gt;USING&lt;BR /&gt; i_spoolid TYPE rspoid&lt;BR /&gt;CHANGING&lt;BR /&gt; et_pdf TYPE tline_tab&lt;BR /&gt; e_binary_length TYPE i.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 09:21:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/merging-multiple-spools-into-a-single-pdf-to-attach-workflow/m-p/554666#M21182</guid>
      <dc:creator>VijayCR</dc:creator>
      <dc:date>2017-12-05T09:21:33Z</dc:date>
    </item>
  </channel>
</rss>

