2011 Feb 15 4:11 PM
Hi Experts,
I am using CL_BCS methods for sending attachements in emails in background, everything works fine except for DOCX extensions. It says the file is correpted while opening. I have tried adding the file name to header table as given in OSS note.
CONCATENATE '&SO_FILENAME=' lv_filename into lv_text_line.
append lv_text_line to lt_att_head.
But it just gives the file name with 4 extensions, but the file is still correpted.
Please help. My SAP version is 4.7
Thank you very much in advance,
Farook.
Hi Experts,
I am using CL_BCS methods for sending attachements in emails in background, everything works fine except for DOCX extensions. It says the file is correpted while opening. I have tried adding the file name to header table as given in OSS note.
CONCATENATE '&SO_FILENAME=' lv_filename into lv_text_line.
append lv_text_line to lt_att_head.
But it just gives the file name with 4 extensions, but the file is still correpted.
Please help. My SAP version is 4.7
Thank you very much in advance,
Farook.
2011 Feb 15 7:37 PM
Hello Farook,
Please check the link below:
In the above link, some useful link is provided by Christoph Hopf. Also, the creater of the thread solved Word (docx) file corruption issue with the help of SAP note 1459896.
Eventually i have fixed the the corruption of DOCX(MS office 2007) files by referring to SAP note 1459896.
Hope that helps!
Regards,
Saba
2011 Feb 15 7:44 PM
For Docs or pdfs or xls
use SCMS_BINARY_TO_XSTRING and SCMS_XSTRING_TO_BINARY
From here - catch the size of the attachment and pass it onto add_attachment method
If you have a docx or xlsx, then pass on the header oss note 1459896
something like
lr_document->add_attachment(
i_attachment_type = lv_objtp "'PDF'
i_attachment_subject = lv_attachment_subject
i_attachment_size = lv_size_char "size from SCMS_XSTRING_TO_BINARY
i_att_content_hex = lt_content_bin
i_attachment_header = lt_att_head
).
Also - may be useful -
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |