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: 

Add attachment to mail

former_member196079
Active Contributor
0 Kudos

Hi experts.

I must trigger a Mail with as attachment, the attachment of an business activity.

So, i've used the class cl_crm_documents->get_info for read the attachment and after

cl_crm_documents->get_document for get all the details of the attachment(file format,name, etc).

This method return also the Binary of the attachment.

Now i must add the attachment at the mail. i'm using BCS


        CALL METHOD document->add_attachment
          EXPORTING
            i_attachment_type    = file_type
            i_attachment_subject = file_des
            i_att_content_hex    = binary_content.

the problem is the binary_content...The method has as parameter a table with a structure length 255.

The method cl_crm_documents->get_document return a structure with lenght 1022.

How i can map this 2 tables??

or how i can get the binary with a table compatible with the method document->add_attachment?

Best regards

Marco

Marco

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Marco,

I had similar problem in the past.

I used

SCMS_BINARY_TO_XSTRING to convert a binary table to xstring, then

SCMS_XSTRING_TO_BINARY to convert xstring to binary.

Regards

Andrea

2 REPLIES 2

Former Member
0 Kudos

Hi Marco,

I had similar problem in the past.

I used

SCMS_BINARY_TO_XSTRING to convert a binary table to xstring, then

SCMS_XSTRING_TO_BINARY to convert xstring to binary.

Regards

Andrea

0 Kudos

Ciao Andrea

Thanks for your reply..

This trick solved my problem!!

Grazie

Marco

Edited by: Menegazzo Marco on Mar 24, 2011 3:27 PM