2023 Jan 12 6:16 AM
Hi,
I have a requirement to built a functionality to read a particular inbox in outlook through ABAP code so as to process the data in ECC as per the subject lines of the emails received. Can someone help me how to do it ?
Regards
Sammy
2023 Jan 12 6:47 AM
Best way is to use an API.
You can use the Microsoft Graph API to access everything around Office. I´ve used it to access calendars.
https://learn.microsoft.com/de-de/graph/api/resources/mail-api-overview?view=graph-rest-1.0
We wrote our own implementation but you can use this
https://github.com/microsoft/ABAP-SDK-for-Azure
2023 Jan 12 6:44 AM
Outlook is a client email. You probably need to access a Server email.
First you need to know the available protocol of this server : SMTP, POP3, IMAP ...
2023 Jan 12 6:47 AM
Best way is to use an API.
You can use the Microsoft Graph API to access everything around Office. I´ve used it to access calendars.
https://learn.microsoft.com/de-de/graph/api/resources/mail-api-overview?view=graph-rest-1.0
We wrote our own implementation but you can use this
https://github.com/microsoft/ABAP-SDK-for-Azure
2023 Jan 13 6:47 AM
Do you have sample code to use Microsoft Graph API to access Outlook ?
2023 Jan 13 7:06 AM
Hi vaishali_singh ,
i don´t have the code anymore.
But we were using this approach:
2023 Jan 19 10:45 AM
2023 Jul 12 7:51 AM
To access the Outlook inbox through ABAP (Advanced Business Application Programming), you can use the SAP Exchange Connector (SXC) framework. The SXC framework allows you to connect to various email servers, including Microsoft Exchange, and perform actions on the inbox such as reading emails, creating new emails, and managing folders. Here are the steps to access the Outlook inbox through ABAP using the SXC framework:
Ensure that the SXC framework is installed and configured in your SAP system. The SXC framework provides the necessary classes and functions to interact with email servers.
Use the CL_BCS class in ABAP to create a connection to the email server. Instantiate an instance of the CL_BCS class and set the properties such as the server address, credentials, and protocol (IMAP or POP3) for accessing the Outlook inbox.
Use the CREATE_DOCUMENT method of the CL_BCS class to create an email object. Set the necessary attributes such as sender, recipient, subject, and body of the email.
Use the SEND method of the CL_BCS class to send the email. This will connect to the Outlook server, authenticate the user, and send the email from the specified sender to the specified recipient.
Use the GET_INBOX method of the CL_BCS class to retrieve the list of emails in the Outlook inbox. This will return a collection of email objects that you can loop through and process as needed.
Perform any additional actions on the emails, such as reading the content, marking it as read, moving to folders, or deleting it.
Greetings,
Peter