Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Contents of Internal Table as PDF attachment to Outlook Mail.

Former Member
0 Kudos

Hi,

This is a report program. I have an internal table with the data (it has a line of 72 characters). I want it to be sent as PDF attachment.

When i am passing the data directly to the CONTENTS_BIN parameter. The mail is being sent. The attachment with the .PDF extension can be seen, but am unable to open it. It gives an error.

Kindly provide a solution. This is not related to smartforms. No spool generation.

Points will be definitely awarded.

Thanks & Regards,

Goutham.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

In function group STXW there is a function CONVERT_ABAPSPOOLJOB_2_PDF which can take spool output and format it as PDF. There are a number of other functions for OTF (Sapscript) to PDF.

If you call function PRINT_TEXT passing it your data in the TDLINE field of the LINES (TLINE) table with appropriate formatting characters in the TDFORMAT field, and if you set field TDGETOTF in the OPTIONS (ITCPO) structure to 'X', it will return the OTFDATA table which you can covert to PDF.

To email the resulting PDF you will need to convert from lines of 134 characters to lines of 255 characters required by the send email function modules. Be careful not to compress spacing when doing this - PDF is sensistve to this as it is binary data.

Andrew

5 REPLIES 5

Former Member
0 Kudos

may b u dont have the acrobat reader to read the pdf file....

0 Kudos

Hi Premalatha,

Thanks for your response. But i have Acrobat reader 8 installed on my system. I can read other PDF files. I suppose this is not the problem.

Regards,

Goutham

Former Member
0 Kudos

In function group STXW there is a function CONVERT_ABAPSPOOLJOB_2_PDF which can take spool output and format it as PDF. There are a number of other functions for OTF (Sapscript) to PDF.

If you call function PRINT_TEXT passing it your data in the TDLINE field of the LINES (TLINE) table with appropriate formatting characters in the TDFORMAT field, and if you set field TDGETOTF in the OPTIONS (ITCPO) structure to 'X', it will return the OTFDATA table which you can covert to PDF.

To email the resulting PDF you will need to convert from lines of 134 characters to lines of 255 characters required by the send email function modules. Be careful not to compress spacing when doing this - PDF is sensistve to this as it is binary data.

Andrew

0 Kudos

Hi Andrew,

Thank you very much for your response.

Is it mandatory to have the OTF form of the internal table data and then convert it to PDF format for the PDF attachment creation.

Is there any direct way to send the internal table data and get the content in it in the PDF attachment.

Regards,

Goutham

Former Member
0 Kudos

Thanks.