2011 Mar 04 8:36 AM
I want to send excel as mail attachment with 53 columns when exceute in background. But i_attach has 255 characters so its truncating more than 255 characters in header and values of excel.
so pls tel how to send attachment with all internal table contents.
Adding Attachment
CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = C_EXT
I_ATTACHMENT_SIZE = L_SIZE
I_ATTACHMENT_SUBJECT = 'Valid Standard Cost Estimate'
I_ATT_CONTENT_TEXT = I_ATTACH[].
I want to send excel as mail attachment with 53 columns when exceute in background. But i_attach has 255 characters so its truncating more than 255 characters in header and values of excel.
so pls tel how to send attachment with all internal table contents.
Adding Attachment
CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = C_EXT
I_ATTACHMENT_SIZE = L_SIZE
I_ATTACHMENT_SUBJECT = 'Valid Standard Cost Estimate'
I_ATT_CONTENT_TEXT = I_ATTACH[].
2011 Mar 04 8:41 AM
Hi,
What extension are you using? Try 'BIN' Extension and remove the size parameter.
Also add it to the HEX table, not the text one.
CALL METHOD lv_document->add_attachment
EXPORTING
i_attachment_type = 'BIN'
i_attachment_subject = lv_string
i_att_content_hex = lt_attach[]
i_attachment_header = lt_att_table[].
Thanks
Ernesto
2011 Mar 04 8:48 AM
thanks for ur reply
but all hex and text are also declared with 255 ly.
or otherwise i can download that internal table into excel in background execution and upload it and send as mail attachment ah.
but how to download,upload and send mail in background
2011 Mar 04 9:06 AM
Hi,
You can check SAP Std. Program BCS_EXAMPLE_5. It sends a Word Document by email. Excel file should be the same.
If you do not specify the size, it will automatically calculate it.
Regards,
Edited by: Ernesto Caballero on Mar 4, 2011 10:08 AM
2011 Mar 04 9:37 AM
they use the same method CALL METHOD lv_document->add_attachment
it allows the internal table only for 255 characters
2011 Mar 07 5:07 PM
Excel itself has a restriction that there can be no more than 255 characters in a cell (at least before 2010 version).
I'm not sure why it would truncate data in Excel, e.g. I send PDFs as attachment and they're just a stream of binary data. The content is placed in the same 255 char. table, but it's binary data, so at the end it comes out OK anyway. It's supposed to be magically reassembled when leaving SAP (as far as I understand). Are you using binary transfer?
There are numerous examples already available on SDN. Here is just one from the top of the list:
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |