Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Excel attachment using SO_DOCUMENT_SEND_API1

jpsapabap21
Participant
0 Likes
597

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?

2 REPLIES 2
Read only

Rocky1
Product and Topic Expert
Product and Topic Expert
0 Likes
380

Hi,

I am also using 6.0 and similar logic is working fine to calculate the size. I think there must be some problem some where else in the code. Can you put your code that you have used.

Thanks & Regards

Rocky

Read only

0 Likes
380

Implementing Note 1430123 solves the problem.