Skip to Content
-2

Email attachment were corrupted

Mar 11, 2017 at 01:13 PM

95

avatar image
Former Member

Hi all,

I have a requirement to send attachments to customer with different type of formats.

I'm sending the documents in .ZIP format, can you help me on this..

CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = l_vzip * IMPORTING * output_length = lv_len TABLES binary_tab = lit_content_255.

Thanks in advance,

Satish

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Sandra Rossi Mar 11, 2017 at 03:34 PM
1

You must first identify where the real problem is. How do you know it's because of SCMS_XSTRING_TO_BINARY? It could be because you pass the internal table to the mail in text mode, or you forget to pass the length of the ZIP (unit: number of bytes)

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Rossi,

Thanks for your reply.

Actually I'm pulling these attachments from SRM system in raw format. Based on attachment number i'm converting these attachments into XSTRING format and adding into ZIP format. And finally i'm converting ZIP data into Binary format using few classes. Finally I'm passing my internal table raw data ( lit_content_255 ) into CALL METHOD document->add_attachment.

CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'ZIP'
i_attachment_subject = lv_sub
i_att_content_hex = lit_content_255.

Note: In few cases (for few PO's) the attachments are sending properly ( not corrupting ). but in some cases the attachments corrupted.

Can you suggest me , is there any notes needs to implement for this type of issue. Pls help me.

Regards,

Satish

0

You should pass the length of the ZIP using I_ATTACHMENT_SIZE parameter of ADD_ATTACHMENT (otherwise, the length is considered being the number of lines of LIT_CONTENT_255 multiplied by 255 bytes).

0
avatar image
Former Member Mar 13, 2017 at 10:52 AM
0

Thanq Rossi... Finally I fixed the bug. Actually that is sorting problem. I sorted internal table of raw data by attachment number, that's why attachments corrupted. Now I removed "SORT statement. Issue resolved.

Thanks for your reply.

Regards,

Satish

Show 1 Share
10 |10000 characters needed characters left characters exceeded

If this is resolved then kindly close the question. It still appears as unanswered as of now.

Thanks.

1