<?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: PDF Attachement in RFC Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-attachement-in-rfc-function-module/m-p/5567925#M1270175</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;follwo the belwo steps..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

*      Work Area for Print Parameters
 Data :      wa_pri_params TYPE pri_params,
*      Work Area for Converted PDF file
Data :       wa_pdf TYPE tline,

  if t_ouputdata[] is not initial.
*    WAIT UP TO 1 SECONDS.
    CONCATENATE 'E'
                 w_tabix
                 sy-datum+4(4)
                 sy-uzeit INTO
                 wa_pri_params-plist.
  ENDIF.
  NEW-PAGE PRINT ON NO DIALOG PARAMETERS wa_pri_params.     "creating spool request
  WRITE : / text-s32.
  ULINE.
  LOOP AT t_error INTO wa_error.
    WRITE : / wa_error-text.
  ENDLOOP.
  WRITE : / text-s33.
  NEW-PAGE PRINT OFF.                                                                   "closing spool request


* To fetch the spool number from TSP01 table
  SELECT rqident
         FROM tsp01
         INTO w_rqident
         UP TO 1 ROWS
         WHERE rq2name = wa_pri_params-plist.
  ENDSELECT.
* Subroutine to convert ABAP spool to PDF file
  PERFORM abapspoll_to_pdf.
* Now t_pdf table contains the PDF data...
" now call the function module in backgrond task destination and push the PDF format dat to external system... 

FORM abapspoll_to_pdf.
* Function Module to Convert Spool to PDF file
  CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
    EXPORTING
      src_spoolid     = w_rqident
      no_dialog       = 'X'
      dst_device      = 'LP01'
      pdf_destination = 'X'
    TABLES
      pdf             = t_pdf.
  CLEAR wa_mail_receivers.
ENDFORM.                    " ABAPSPOLL_TO_PDF
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 May 2009 18:43:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-13T18:43:43Z</dc:date>
    <item>
      <title>PDF Attachement in RFC Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-attachement-in-rfc-function-module/m-p/5567923#M1270173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are going to send the PDF format of Purchase Orders to other Non-SAP System through RFC Function Module. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest, is there any RFC function module to send PDF file as the attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or is there any other way to send the PDF files on regular basis from SAP to Non-SAP system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nrusingha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 11:58:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-attachement-in-rfc-function-module/m-p/5567923#M1270173</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T11:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Attachement in RFC Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-attachement-in-rfc-function-module/m-p/5567924#M1270174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;These are the FM for sending external email :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO_DOCUMENT_SEND_API1&lt;/P&gt;&lt;P&gt;SAPoffice: Send new document with attachments via RFC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO_NEW_DOCUMENT_ATT_SEND_API1&lt;/P&gt;&lt;P&gt;(In 4.6C only, You can go to SE37 and click the documentation on how to use it. A sample program is provided there.)&lt;/P&gt;&lt;P&gt;SAPoffice: Send new document with attachments via RFC&lt;/P&gt;&lt;P&gt;Note : If you are using FM SO_NEW_DOCUMENT_ATT_SEND_API1 then Export Parameter DOCUMENT_DATA-OBJ_DESCR contains the Subject.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SO_NEW_DOCUMENT_SEND_API1&lt;/P&gt;&lt;P&gt;SAPoffice: Send new document&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 12:56:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-attachement-in-rfc-function-module/m-p/5567924#M1270174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T12:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: PDF Attachement in RFC Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-attachement-in-rfc-function-module/m-p/5567925#M1270175</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;follwo the belwo steps..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

*      Work Area for Print Parameters
 Data :      wa_pri_params TYPE pri_params,
*      Work Area for Converted PDF file
Data :       wa_pdf TYPE tline,

  if t_ouputdata[] is not initial.
*    WAIT UP TO 1 SECONDS.
    CONCATENATE 'E'
                 w_tabix
                 sy-datum+4(4)
                 sy-uzeit INTO
                 wa_pri_params-plist.
  ENDIF.
  NEW-PAGE PRINT ON NO DIALOG PARAMETERS wa_pri_params.     "creating spool request
  WRITE : / text-s32.
  ULINE.
  LOOP AT t_error INTO wa_error.
    WRITE : / wa_error-text.
  ENDLOOP.
  WRITE : / text-s33.
  NEW-PAGE PRINT OFF.                                                                   "closing spool request


* To fetch the spool number from TSP01 table
  SELECT rqident
         FROM tsp01
         INTO w_rqident
         UP TO 1 ROWS
         WHERE rq2name = wa_pri_params-plist.
  ENDSELECT.
* Subroutine to convert ABAP spool to PDF file
  PERFORM abapspoll_to_pdf.
* Now t_pdf table contains the PDF data...
" now call the function module in backgrond task destination and push the PDF format dat to external system... 

FORM abapspoll_to_pdf.
* Function Module to Convert Spool to PDF file
  CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
    EXPORTING
      src_spoolid     = w_rqident
      no_dialog       = 'X'
      dst_device      = 'LP01'
      pdf_destination = 'X'
    TABLES
      pdf             = t_pdf.
  CLEAR wa_mail_receivers.
ENDFORM.                    " ABAPSPOLL_TO_PDF
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 May 2009 18:43:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/pdf-attachement-in-rfc-function-module/m-p/5567925#M1270175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-13T18:43:43Z</dc:date>
    </item>
  </channel>
</rss>

