2016 Mar 09 7:59 PM
Hi Experts,
My requirement is converted one smartform into PDF and sent it via Email,but the attachment in the mail is not opening giving error as Failed to load PDF document or this document cannot be opened as it is an attachment sent via email and not decoded properly.
Pleasesuggest some solution with supporting code well appreciated.
Thanks in Advance,
Suprit Patil.
2016 Mar 09 8:26 PM
Personally I would use the function module SSFCOMP_PDF_PREVIEW first to check whether the otf data (job_output_info-otfdata from the FM that called the smartform) will open a correct PDF with the contents of the smartform.
If that works correctly, the problem may be in converting the otfdata and attaching it to the email. For that I generally use the classes cl_bcs & cl_document_bcs (there plenty of examples that can be found on the net).
As far as adding the attachment goes, there is an add_attachment method in the class cl_document_bcs. And for that you'll have to convert the otfdata to either SOLI_TAB or
SOLIX_TAB. You can use FM SX_OBJECT_CONVERT_OTF_PDF for that I believe.
Personally I would use the function module SSFCOMP_PDF_PREVIEW first to check whether the otf data (job_output_info-otfdata from the FM that called the smartform) will open a correct PDF with the contents of the smartform.
If that works correctly, the problem may be in converting the otfdata and attaching it to the email. For that I generally use the classes cl_bcs & cl_document_bcs (there plenty of examples that can be found on the net).
As far as adding the attachment goes, there is an add_attachment method in the class cl_document_bcs. And for that you'll have to convert the otfdata to either SOLI_TAB or
SOLIX_TAB. You can use FM SX_OBJECT_CONVERT_OTF_PDF for that I believe.
2016 Mar 09 8:26 PM
Personally I would use the function module SSFCOMP_PDF_PREVIEW first to check whether the otf data (job_output_info-otfdata from the FM that called the smartform) will open a correct PDF with the contents of the smartform.
If that works correctly, the problem may be in converting the otfdata and attaching it to the email. For that I generally use the classes cl_bcs & cl_document_bcs (there plenty of examples that can be found on the net).
As far as adding the attachment goes, there is an add_attachment method in the class cl_document_bcs. And for that you'll have to convert the otfdata to either SOLI_TAB or
SOLIX_TAB. You can use FM SX_OBJECT_CONVERT_OTF_PDF for that I believe.
2016 Mar 10 4:38 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |