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: 

Open outlook editor from abap program with attachment.

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

Hi Sontosh,

The following link shall guide u to the exact way to perform the required action..

please have a look ...

[;

here u shall be using the OLE concept to open another application through SAP ....

best of luck !!!

if the given solution has helped to solve the issue, pls do ack it.....

Thanks

Ravi

robert_altenstraer
Active Participant

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

0 Kudos

It's works fine..

thanks a lot.

Former Member
0 Kudos

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

0 Kudos

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