SAP ABAP Tutorial – have documents stored in BDS which I wish to send as email attachments. There is a lot of very helpful material around sending emails but it all seems to relate to sending the contents of an internal table as an excel attachment, for example. There is much detail on the methods to be called to convert the data from one format to another and then add it as an attachment.

I want to be able to attach an existing document(it could be any type of document but in my case it is a excel documentt) to an email and send it to an email address.



Using this class to get existing BDS Document binary, this binary have 1022 length ( RAW1022 ), that you must convert to RAW255 later.

lt_Soll is internal table contained RAW255 Data.

Tips : Convert RAW1022 to RAW255.

If you need ABAP Code to convert RAW1022 to RAW255 you cannot write you own logic to parsing this data manually.

SCMS_BINARY_TO_XSTRING is used to convert LT_SOLI ( RAW1022 ) to XSTRING Data, then after you get XSTRING data you need to run SCMS_XSTRING_TO_BINARY to convert back to binary with length RAW255 and save into LT_EXCEL internal table.

Below is ABAP full source code :

Incoming search terms: