08-10-2009 1:35 PM
Hi,
I need to open the outlook email editor from ABAP program with attachmentn so that the user can manually input the To, CC, subject and body.
Can anybody help ?
Thanks and regards
Sontosh.
08-10-2009 1:50 PM
08-10-2009 2:22 PM
Hi
for the Attachments
type-pools ole2 .
data : ooutapp type ole2_object , "Outlook.Application
omail type ole2_object , "Outlook.MailItem
lattach type ole2_object , "Outlook.Attachment
lattachmsg type ole2_object.
* Email Body, Subj, Text
CREATE OBJECT ooutapp 'Outlook.Application'.
IF sy-subrc NE 0.
EXIT.
ENDIF.
CALL METHOD OF ooutapp 'CreateItem' = omail
EXPORTING
#1 = 0.
SET PROPERTY OF omail 'Importance' = 2 .
SET PROPERTY OF omail 'To' = 'MYMAILADRESS'.
SET PROPERTY OF omail 'Subject' = 'Subject'.
SET PROPERTY OF omail 'Body' = 'Body text...'.
* Aufbau einer Tabelle mit Attachment Pfad+Bezeichnung für
*generate tab for attachment path & full name
wa_atta_file-filename = 'C: em ilename.ext'.
APPEND wa_atta_file TO it_atta_file.
LOOP AT it_atta_file INTO wa_atta_file.
CALL METHOD OF omail 'Attachments' = lattach.
CALL METHOD OF lattach 'Add'
EXPORTING
#1 = wa_atta_file-filename.
ENDLOOP.
* Outlook starten und Daten übergeben
* start outlook in display mode
CALL METHOD OF omail 'Display'.
* Ausräumen
FREE OBJECT omail.
it should work..
bestreg robert
02-25-2021 7:10 AM
08-11-2009 7:34 AM
Hi
If we give external file it is working fine.....but i want to add my internal table data as excel attachment.
Regards
N.Sontosh
08-11-2009 7:40 AM
hi
... i have found not really a solution for internal tables directly into outlook...
but:
make in front of the Oulook upload a download into a temporary directory ( workdir of sap ) of your excel-file.
load it up to outlook...
after that delte the file in the temp dir
it´s easy, fast and... it works fine.....
bestreg
Robert