03-11-2017 1:13 PM
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
03-11-2017 3:34 PM
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)
03-11-2017 3:34 PM
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)
03-12-2017 2:45 PM
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
03-12-2017 4:52 PM
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).
03-13-2017 10:52 AM
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
03-13-2017 4:38 PM
If this is resolved then kindly close the question. It still appears as unanswered as of now.
Thanks.