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: 

Send Multiple PDF attachments in one email

0 Kudos

Hi,

I have created a z program to send email with a single pdf attachment.

I am using the FM: SO_NEW_DOCUMENT_ATT_SEND_API1 to send the email.

I am using the FM:GUI_UPLOAD to specify the PDF file.

Now I want to attach more than one RDF files to the email.

I have managed to create and send the email with two attachments but all attachments are corrupted.

When I open the email and trying to open the attachments I get an error:

The file is damaged and cannot be repaired.

Can someone help me?

1 ACCEPTED SOLUTION

Problem solved.

The error was in body_start, body_num and doc_size fields of packing_list table of the FM.

For second attachment:

The body_start must have the number of lines +1 of the first attachment

The body_num must have the number of lines of the second attachment .

The doc_size must have the number of lines of the second attachment multiplied by 255.

Thanks.

2 REPLIES 2

Problem solved.

The error was in body_start, body_num and doc_size fields of packing_list table of the FM.

For second attachment:

The body_start must have the number of lines +1 of the first attachment

The body_num must have the number of lines of the second attachment .

The doc_size must have the number of lines of the second attachment multiplied by 255.

Thanks.

0 Kudos

Note that SO_NEW_DOCUMENT_ATT_SEND_API1 is obsolete and that you should use BCS classes.

Now, read your question again and you'll see that it's impossible to answer except saying to compare your code to one of the BCS demo programs.