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

Sending a mail with attachment problem

vallamuthu_madheswaran2
Active Contributor
0 Likes
733

HI friends,

I'm unsing the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' and send a mail with attachemnt. The attachemnt is a '.doc' file.

i've send a internal table data as a attachemnt file.

My problem is, it's displays in first page but it not display in second page. but i'm haveing 40 line data

1 ACCEPTED SOLUTION
Read only

brad_bohn
Active Contributor
0 Likes
679

Where does the data come from? How do you retrieve it? How do you attach it? Does the attachment data work if you download it and execute it (GUI_DOWNLOAD and GUI_EXECUTE)? You need to provide enough information to solve an issue.

What aren't you using class CL_BCS to send the email?

HI friends,

I'm unsing the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' and send a mail with attachemnt. The attachemnt is a '.doc' file.

i've send a internal table data as a attachemnt file.

My problem is, it's displays in first page but it not display in second page. but i'm haveing 40 line data

3 REPLIES 3
Read only

brad_bohn
Active Contributor
0 Likes
680

Where does the data come from? How do you retrieve it? How do you attach it? Does the attachment data work if you download it and execute it (GUI_DOWNLOAD and GUI_EXECUTE)? You need to provide enough information to solve an issue.

What aren't you using class CL_BCS to send the email?

Read only

Former Member
0 Likes
679

Like Brad says - go for CL_BCS usage.

For Docs or pdfs or xls

use SCMS_BINARY_TO_XSTRING and SCMS_XSTRING_TO_BINARY

From here - catch the size of the attachment and pass it onto add_attachment method

If you have a docx or xlsx, then pass on the header oss note 1459896

something like

lr_document->add_attachment(

i_attachment_type = lv_objtp "'PDF'

i_attachment_subject = lv_attachment_subject

i_attachment_size = lv_size_char "size from SCMS_XSTRING_TO_BINARY

i_att_content_hex = lt_content_bin

i_attachment_header = lt_att_head

).

http://wiki.sdn.sap.com/wiki/display/ABAP/SendingMails-HomePage

Read only

vallamuthu_madheswaran2
Active Contributor
0 Likes
679

Solved myself