Skip to Content
author's profile photo Former Member
Former Member

Problem opening outlook session from ABAP program

Dear Experts,

I am facing an issue related to Outlook from ABAP program. As per the code, the program will create(opens) a new outlook email. But in some systems, it gives an error like SESSION failure. The place where it fails is below:

CREATE OBJECT ole_session 'MAPI.SESSION'.

if sy-subrc ne 0.

raise NO_SESSION.

endif.

I am sure this is a not an issue with sap as this works for other systems. Please let me know if any specific outlook settings are required for this issue.

Note: I have searched the forums, but couldn't find a solution.

Thanks in advance.

Regards,

Sainath

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Dec 11, 2015 at 02:36 PM

    Did you check the Outlook versions, are they the same (there are some threads and OSS notes)

    There can also be some security problem too. Sometimes DE/RE-select MS Outlook as the email default application solved the MAPI problem.

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2015 at 03:08 PM

    I have done this before using code like below:

    DATA oleapp type ole2_object.

    DATA oleitem type ol2_object.

    CREATE OBJECT oleapp 'OUTLOOK.APPLICATION'.

    CALL METHOD OF oleapp 'CREATEITEM' = oleitem

    EXPORTING #1 = 0.

    SET PROPERTY OF oleitem 'TO' = 'Me@test.com'.

    CALL METHOD OF oleitem 'DISPLAY'.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.