Skip to Content
0
Apr 15, 2010 at 08:20 AM

Excel attachment using SO_DOCUMENT_SEND_API1

217 Views

Hi

I am using FM SO_DOCUMENT_SEND_API1 to send .XLS attachment from ABAP program.

I am using following code to calculate the size.

 
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
 t_packing_list-doc_size   =  t_packing_list-body_num * 255.

CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
       EXPORTING
            document_data              = w_doc_data
            put_in_outbox              = 'X'
            sender_address             = ld_sender_address
            sender_address_type        = ld_sender_address_type
            commit_work                = 'X'
       IMPORTING
            sent_to_all                = w_sent_all
       TABLES
            packing_list               = t_packing_list
            contents_bin               = t_attachment
            contents_txt               = it_message
            receivers                  = t_receivers

(I have posted only relevant code)

This was working fine in 4.7. But since upgrade to 6.0, the attachment is transferred only half the actual size.

i.e. if my internal table shows 4 records, the attachment in the mail shows only 2 records.

What can be done in this case. A simple solution would be to multiply the size by 2.

t_packing_list-doc_size = t_packing_list-body_num * 255 * 2.

This works, but does seem like a work around.

What could be the reason for this and what should be the solution?