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

Send excel attachment using FM SO_NEW_DOCUMENT_ATT_SEND_API1

Former Member
0 Likes
1,029

Hi ABAPers,

I managed to send excel attachment using FM SO_NEW_DOCUMENT_ATT_SEND_API1.

Let say I send it to my own email account.

But, when try to open the excel document, from lotus notes, there is warning message produced by the microsoft excel saying:

"The file is not in a recognizable format.

.

.

and so on....."

Anyway, when I click button 'OK', excel sheet will be opened and no information lost.

How can we code the abap program so that the message will not come each time I open the attachment from my lotus notes?

Or this is just the tab delimited issue?

Thank you.

Regards,

Edward.

Hi ABAPers,

I managed to send excel attachment using FM SO_NEW_DOCUMENT_ATT_SEND_API1.

Let say I send it to my own email account.

But, when try to open the excel document, from lotus notes, there is warning message produced by the microsoft excel saying:

"The file is not in a recognizable format.

.

.

and so on....."

Anyway, when I click button 'OK', excel sheet will be opened and no information lost.

How can we code the abap program so that the message will not come each time I open the attachment from my lotus notes?

Or this is just the tab delimited issue?

Thank you.

Regards,

Edward.

4 REPLIES 4
Read only

Former Member
0 Likes
802

hai,

DESCRIBE TABLE so_ali[] LINES lineno.

objpack-transf_bin = 'X'.

objpack-head_start = 1.

objpack-head_num = 1.

objpack-body_start = 1.

objpack-doc_size = lineno * 255 .

objpack-body_num = lineno.

objpack-doc_type = 'PDF'.

objpack-obj_name = 'INVOICE'.

objpack-obj_descr = 'Invoice'.

objpack-obj_langu = 'E'.

APPEND objpack.

ur document size should be calculated properly otherwise u will be getting this problem.

Read only

0 Likes
802

Hi Shan,

Thank you for replying.

I have the same as follows:

DESCRIBE TABLE lt_contents_hex LINES lv_lines.

lt_packing_list-transf_bin = 'X'.

lt_packing_list-head_start = 1.

lt_packing_list-head_num = 1.

lt_packing_list-body_start = 1.

lt_packing_list-body_num = lv_lines.

lt_packing_list-doc_type = 'XLS'.

lt_packing_list-obj_name = 'ATTACHMENT'.

lt_packing_list-obj_descr = 'Attachment'.

lt_packing_list-doc_size = lv_lines * 255.

APPEND lt_packing_list.

I'm using lt_contents_hex instead of lt_contents_bin.

Still the problem is there.

Is there any other way to calculate the doc size correctly?

Regards,

Edward.

Read only

0 Likes
802

Hi

describe table it_attach lines w_lines.

read table it_attach index w_lines.

w_doc_data-doc_size =

( w_lines - 1 ) * 255 + strlen( it_attach ).

w_doc_data-obj_langu = sy-langu.

w_doc_data-obj_name = 'SAPRPT'.

w_doc_data-obj_descr = ld_mtitle.

w_doc_data-sensitivty = 'F'.

clear t_attachment.

refresh t_attachment.

t_attachment[] = pit_attach[].

Regards

Jana

Read only

Former Member
0 Likes
802

Hi Shan & Jana,

Yes, it is due to doc size.

Thx for your help.

Regards,

Edward.