05-10-2016 8:39 AM
Hi,
I have the email format which is been called through screen, in that I have added a new button for attaching the file(any file format).
Please check the below screenshot:
So here, when I click on the attachment, I need to get the popup for asking the document to attach,
we can do this through -> CALL METHOD cl_gui_frontend_services=>file_open_dialog
But how to attach new file to the mail body?
Please let me know about this.
Regards,
EH
05-10-2016 8:45 AM
Hi Hunt,
What kind of file do you want to add on email body?
Images ?
Secondly , why do u want to add file on email body, why dont u try it like attachment?
please let me know about this details.
regards,
K.B
05-10-2016 8:52 AM
Hi Bektas,
Actually, I dont want to add file in email body, but adding a file should be like an attachment and file format is not in particular. So I need add any file as an attachment.
Thanks.
EH
05-10-2016 9:00 AM
Hello Hunt,
Are you using class cl_send_request_bcs to send an email with an attachment or Function Modules like "SO_DOCUMENT_API" is used in the program?
Would you like to display it in the screen once the documents are attached?. If yes, you would need to add a button as "Attachment List" and display the documents attached as list?
whats your requirement?
05-10-2016 9:05 AM
Hi Sudar,
The Goal of my idea is to Attach a file(Any file) to the email.
If you see the Screenshot, Email body with sender mail id is ready(Almost everything is ready), but only thing left out is adding a new attachment to the email when the user click on the "Attachment" button
Nope, I haven`t used the SO_DOCUMENT_API. or the class: cl_send_request_bcs
Cheers,
EH
05-10-2016 9:24 AM
Nope, I haven`t used the SO_DOCUMENT_API. or the class: cl_send_request_bcs
So what are you using to send the email?
Apart this, you have to:
1- read the file as BIN or ASC (based the file extension) with cl_gui_frontend_services
2-save into your internal tables (1 for each attachment)
3-convert the BIN ones in XString
4-pass the tables to the corresponding method to generate attachment.
i suggest you to use CL_BCS class (and all its friends) since is more flexible in my opinion.
05-10-2016 10:26 AM
05-10-2016 11:16 PM
As a side note - it seems like a rather strange idea to use SAP as a mail client... Wouldn't it be easier just to call Outlook? I imagine all those attachments also would be consuming space somewhere on the SAP server. Are you sure it's a good design decision?
05-11-2016 6:25 AM
Hi Jelena,
Its not my decision and I like your suggestion too.
I will discuss with my team about this
Thanks,
EH