cancel
Showing results for 
Search instead for 
Did you mean: 

Send mail with DMS attachment

Former Member
0 Kudos

Hi Friends,

I am uplodaing the DMS documents using CV01N transaction. I want to send these DMS documents as a mail attachments.

For these i have written the code by using the below function modules.

1. Call BAPI 'BAPI_DOCUMENT_GETDETAIL2'

call function 'BAPI_DOCUMENT_GETDETAIL2'

exporting

documenttype = document_key-doctype

documentnumber = document_key-docnumber

documentpart = document_key-docpart

documentversion = document_key-docversion

getcomponents = 'X'

getdocdescriptions = 'X'

getdocfiles = 'X'

getclassification = 'X'

importing

documentdata = documentdata

return = lv_return

tables

documentdescriptions = it_documentdescriptions

documentfiles = it_documentfiles

characteristicvalues = it_characteristicvalues

classallocations = it_classallocations.

2. Now call SCMS_DOC_READ to get the Binary Data of the File.

call function 'SCMS_DOC_READ'

exporting

mandt = sy-mandt

stor_cat = c_storage

doc_id = it_co_documentfiles-file_id

tables

access_info = lt_access

content_bin = lt_sdokcntbin.

IT_SDOKCNTBIN is the Binary Data with 1022 raw type. I splitted into 255 raw type.

i am able to send Excel attachment through mail, But when we open the attachemnt i am not able to see the content.

Could u please help me on this.

Thanks,

Riyez

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Your forum was useful to me. I wanted to know how did you split 1022 RAW to 255 RAW and XSTrING?

Regards,

Ritesh

Former Member
0 Kudos

Hi,

Your forum was useful to me. I wanted to know how did you split 1022 RAW to 255 RAW?

Regards,

Ritesh

Former Member
0 Kudos

Hi,

Try out this code, i think it will solve your purpose.

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/codetogetthecontentofanattachmentinDMandmailittoexternalemailid

Thanks

Papiya

Former Member
0 Kudos

Hi,

Thanks a lot. It solved my issue.

Regards

Riyez