Application Development and Automation 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: 
Read only

E-Mail with PDF attachment

Former Member
0 Likes
816

Hi All,

I have data in internal table which I need to email with pdf attachment. I have tried using SO_DOCUMENT_SEND_API1 and also with method add_attachment.

I am able to send as XLS but not as PDF.

I used FM SCMS_TEXT_TO_BINARY to convert internal table data to Binary and but no use.

It would be of great help If any one has a sample code of making this possible.

Thanks and Have a nice day!

Hi All,

I have data in internal table which I need to email with pdf attachment. I have tried using SO_DOCUMENT_SEND_API1 and also with method add_attachment.

I am able to send as XLS but not as PDF.

I used FM SCMS_TEXT_TO_BINARY to convert internal table data to Binary and but no use.

It would be of great help If any one has a sample code of making this possible.

Thanks and Have a nice day!

5 REPLIES 5
Read only

Former Member
0 Likes
764

Did you consider a search of the forum for PDF?

Read only

0 Likes
764

Yes I did. It all talks about converting spool to pdf. I have internal table only, I am not writing to screen/list.

Thanks.

Read only

0 Likes
764

Try using FM CONVERT_OTF.

CALL FUNCTION 'CONVERT_OTF'

EXPORTING

format = 'PDF'

  • MAX_LINEWIDTH = 132

  • ARCHIVE_INDEX = ' '

  • COPYNUMBER = 0

  • ASCII_BIDI_VIS2LOG = ' '

  • PDF_DELETE_OTFTAB = ' '

IMPORTING

bin_filesize = lv_filesize

  • BIN_FILE = lv_pdf_file

TABLES

otf = ls_job_info-otfdata

lines = lt_pdf_table

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

err_bad_otf = 4

OTHERS = 5 .

Read only

Former Member
0 Likes
764

Hi,

you could create a simple Smartform for this. It is quick to build and you can do some formatting stuff.

And for sending you could also use class CL_BCS.

Best regards,

Oliver

Read only

sjeevan
Active Contributor
0 Likes
764

Go to SPAD and create a new printer (copy from an existing working printer, give it any name like MAIL) and assign a "Device Type" as "PDF1". Now when you call the printer using your function module in your program it should ask for email, input your email parameter there in the program.