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

Reg: Call method document->add_attachment

Former Member
2,190

Hi,

We are sending attachments by email using set of cl_document_bcs -> methods.

When we try to send 2007 document files as attachment,i.e docx,xlsx files.The file type is getting truncated.

The reason is that the attribute of this method i_attachment_type is of type SOODK-OBJTP of length 3 chars only.

CALL METHOD document->add_attachment

EXPORTING

i_attachment_type = v_extension_type

i_attachment_subject = v_attachname

i_att_content_hex = it_content_binary.

Any suggestions to overcome this issue.

Thanks for your help.

Regards,

Keerthi

5 REPLIES 5
Read only

Former Member
0 Likes
1,077

Even i have tried the same. Try using the 2003 formats only. Is 2003 format not working for you???

Regards,

Lalit Mohan Gupta

Read only

Former Member
0 Likes
1,077

pass XLS only...

any ways MS OFFICE is downward compatible..

Read only

former_member182670
Contributor
1,077

Have a look at note 1459896 - BCS: Support for four-digit file name extensions

https://service.sap.com/sap/support/notes/1459896

it has sample source code.

Read only

Former Member
0 Likes
1,077

Hello, I just pas through that problem.

1. I applied note 1433744, to allow to have file name with the proper extension "XLSX".

2. When using the method add_attachment, the parameter i_attachment_type = 'EXT'.

3. Be sure to have the parameter I_ATTACHMENT_SIZE setproperly

Doing so, I have been able to have the right filename as attachment and been able to open the file without error in the Excel 2007.

Regards

dstj

Read only

0 Likes
1,077

Hi ,

How do you calculated the I_ATTACHMENT_SIZE . Can you share your sample program . I am having a similar issue with .

regards

Sanjib