Application Development 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: 

Having attachment instead of using the body (email)

Former Member
0 Kudos

Hi Gurus,

I am having a problem regarding the email. I am using the FM SO_NEW_DOCUMENT_ATT_SEND_API1.

Instead of putting the data to the body of the email, it is creating a file named MESSAGE1.PDF and putting the data inside the attached file.

Anyone knows why this is happening?

This is the sample code.

wa_objpack-doc_type = c_raw.

APPEND wa_objpack TO it_objpack.

Only the doc_type has value.

Thanks in advance.

Benedict

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

OBJPACK table is for attachment only. You need to use the other table to send as a body.

take a look at the thread below.

Cheers

VJ

8 REPLIES 8

Former Member
0 Kudos

Hi

OBJPACK table is for attachment only. You need to use the other table to send as a body.

take a look at the thread below.

Cheers

VJ

0 Kudos

Hi All,

Thanks for the response.

Actually, the requirement I should attach an attachment.

The problem is, there is another attachement that is being sent. And the data is the same with the expected attachment file.

Example.

Message1.dat

Filenam.dat

Message1.dat has the same data compared with Filename.dat. But I am expecting only the Filename.dat to appear. So there is an extra Message1.dat file attached.

I have checked the int table of pack. Only the doc_type has value = 'RAW'. Nothing else.

Thanks in advance.

Benedict.

former_member223537
Active Contributor
0 Kudos

Hi,

Please refer sample code :

http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

Best regards,

Prashant

Former Member
0 Kudos

Hi,

To put the data to body of the mail,you need to pass the data to the table contents_txt of F.M. SO_NEW_DOCUMENT_ATT_SEND_API1.

0 Kudos

Hi Koshal,

I don't need a text that is to be displayed in the body of the email.

My problem is that, there is an extra attachment added to the email with the same data with the expected attached file.

Please read the last post i have posted. (above your post)

Thanks.

Benedict

0 Kudos

Hi Koshal,

I have used the contents_txt but still having the MESSAGE.PDF in the email.

Why is this happening?

Thanks.

Benedict

Former Member
0 Kudos

sorry.. didn't know what solved the problem.