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: 

Problem opening outlook session from ABAP program

Former Member
0 Kudos

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

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

Hello Raymond,

Thanks for the hints.

Could you please let me know what is DE/RE? Where can I check the settings?

Since the issue happens only in some systems, we can compare the settings of problematic systems with the successful systems.


Thanks & Regards,

Sainath

0 Kudos

I wrote "DE-RE select" for "deselect/reselect"

Former Member
0 Kudos

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'.

0 Kudos

Hello Jim,

Thanks for the reply. However, the current logic works for all other systems except for few users. So, could you please suggest?

Regards,

Sainath