<?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: Convert ALV to PDF in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865909#M1322415</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;Refer the following code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
get the spool number
* Declaration of local variables.
DATA:
LV_RQ2NAME LIKE TSP01-RQ2NAME.
 
CONCATENATE SY-REPID+0(8)
SY-UNAME+0(3)
INTO LV_RQ2NAME SEPARATED BY '_'.
* Get the spool number.
SELECT * FROM TSP01 WHERE RQ2NAME = LV_RQ2NAME
ORDER BY RQCRETIME DESCENDING.
V_RQIDENT = TSP01-RQIDENT.
EXIT.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR V_RQIDENT.
ENDIF


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RItesh J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jul 2009 04:04:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-14T04:04:26Z</dc:date>
    <item>
      <title>Convert ALV to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865903#M1322409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ABAPers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an requirement I need to convert ALV into an PDF.&lt;/P&gt;&lt;P&gt;Could you please guide to achieve the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;niTin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 11:48:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865903#M1322409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T11:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert ALV to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865904#M1322410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nitin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a spool job of the ALV output and convert that spool into PDF using FM CONVERT_ABAPSPOOLJOB_2_PDF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want more on this then pls revert.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 11:52:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865904#M1322410</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T11:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert ALV to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865905#M1322411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nitin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First convert the ALV o/p to spool, then take the spool no use Report &lt;STRONG&gt;RSTXPDFT4&lt;/STRONG&gt; to convert it to PDF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amitava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 11:54:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865905#M1322411</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T11:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Convert ALV to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865906#M1322412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nitin, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define the  tline ( SAPscript: Text ) as follows. &lt;/P&gt;&lt;P&gt;DATA: itable_pdf TYPE TABLE OF tline WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at first call the FM   'CONVERT_ABAPSPOOLJOB_2_PDF'  by passing the spool no and you will get the pdf data in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    src_spoolid           = spool_no&lt;/P&gt;&lt;P&gt; TABLES&lt;/P&gt;&lt;P&gt;   PDF                        = itable_pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now call the  follwing FM &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        filename                        =  v_string                " data : v_string  type string default 'testpdffile.pdf'.&lt;/P&gt;&lt;P&gt;       FILETYPE                        = 'BIN'&lt;/P&gt;&lt;P&gt;      tables&lt;/P&gt;&lt;P&gt;        data_tab                        =  itable_pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Abhishek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 11:59:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865906#M1322412</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T11:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Convert ALV to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865907#M1322413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I need to send this PDF as an attachment to an email after converting the PDF from ALV.&lt;/P&gt;&lt;P&gt;can it be done thr spool request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2009 12:05:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865907#M1322413</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-13T12:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Convert ALV to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865908#M1322414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nitin, &lt;/P&gt;&lt;P&gt;&amp;lt;li&amp;gt; ALV output as PDF possible.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zvenkat_download_alvoutput.
DATA:i_t001 TYPE t001 OCCURS 0,
     pdf    LIKE tline OCCURS 0,
     g_spool   TYPE tsp01-rqident,
     g_program TYPE sy-repid VALUE sy-repid.
TYPE-POOLS:slis.
DATA: w_print TYPE slis_print_alv,
      w_print_ctrl TYPE alv_s_pctl.
PARAMETERS: p_file TYPE string.

INITIALIZATION.
  p_file = 'C:\venkat.pdf'.
"START-OF-SELECTION.
START-OF-SELECTION.
  SELECT * FROM t001 INTO TABLE i_t001 UP TO 100 ROWS.
  w_print-print = 'X'.

  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program = g_program
      i_structure_name   = 'T001'
      is_print           = w_print
    TABLES
      t_outtab           = i_t001.
  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.

    g_spool = sy-spono.
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid              = g_spool
      TABLES
        pdf                      = pdf.
    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.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = p_file
          filetype                = 'BIN'
        TABLES
          data_tab                = pdf.
      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.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = g_program
            i_structure_name   = 'T001'
          TABLES
            t_outtab           = i_t001.    "is_print = w_print
      ENDIF.
    ENDIF.

  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;lt;li&amp;gt; After PDF conversion, you can send mail that PDF as an attachment. for that use SO_NEW_DOCUMENT_ATT_SEND_API1 function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Venkat.O&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 03:47:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865908#M1322414</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-07-14T03:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert ALV to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865909#M1322415</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;Refer the following code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
get the spool number
* Declaration of local variables.
DATA:
LV_RQ2NAME LIKE TSP01-RQ2NAME.
 
CONCATENATE SY-REPID+0(8)
SY-UNAME+0(3)
INTO LV_RQ2NAME SEPARATED BY '_'.
* Get the spool number.
SELECT * FROM TSP01 WHERE RQ2NAME = LV_RQ2NAME
ORDER BY RQCRETIME DESCENDING.
V_RQIDENT = TSP01-RQIDENT.
EXIT.
ENDSELECT.
IF SY-SUBRC NE 0.
CLEAR V_RQIDENT.
ENDIF


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RItesh J&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jul 2009 04:04:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865909#M1322415</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-14T04:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: Convert ALV to PDF</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865910#M1322416</link>
      <description>&lt;P&gt;Be sure to also check out this other link:&lt;/P&gt;&lt;A href="https://blogs.sap.com/2019/01/23/export-a-pdf-file-out-of-sap-gui-for-html-applications-in-sap-s4hana-cloud/"&gt;https://blogs.sap.com/2019/01/23/export-a-pdf-file-out-of-sap-gui-for-html-applications-in-sap-s4hana-cloud/&lt;/A&gt;&lt;BR /&gt;Regards,</description>
      <pubDate>Fri, 14 Oct 2022 21:29:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-alv-to-pdf/m-p/5865910#M1322416</guid>
      <dc:creator>german_lopez1</dc:creator>
      <dc:date>2022-10-14T21:29:26Z</dc:date>
    </item>
  </channel>
</rss>

