2011 Jul 06 8:32 PM
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!
2011 Jul 06 8:48 PM
2011 Jul 06 9:14 PM
Yes I did. It all talks about converting spool to pdf. I have internal table only, I am not writing to screen/list.
Thanks.
2011 Jul 06 10:02 PM
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 .
2011 Jul 07 7:00 AM
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
2011 Jul 09 4:46 AM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |