If your company is using the “My Leave Requests” SAP Fiori application and also uses Microsoft Outlook then this blog might be for you. Below you see a list of my recently submitted leave request in Fiori. Wouldn’t it be nice to have this information also reflected in the Outlook Calendar?
Behind the scenes the Fiori application is powered by a SAP NetWeaver Gateway OData service called LEAVEREQUEST. This service can be used for different consumption experience beyond the Fiori UI. In this blog I will briefly discuss how you can utilize this service together with the SAP NetWeaver Gateway productivity accelerator for Microsoft to bring leave requests into your Microsoft Outlook Calendar.
If you are not yet familiar with the Appointment Template of SAP NetWeaver Gateway productivity accelerator for Microsoft, then you should take a look at this blog before you continue.
First I need to find the URL of the OData service. In the SAP NetWeaver Gateway system I navigate to Activate and Maintain Services (transaction /iwfnd/maint_service). In the Service Catalog I look for a service with the technical service name ZLEAVEREQUEST_2 (have not tried version 1 of the service).
Via the Call Browser button I get to the URL, which is required for the next step.
In my case the URL looks like this: http://<host>:<port>/sap/opu/odata/GBHCM/LEAVEREQUEST;v=2
In Microsoft Visual Studio, I create a new project based on the GWPAM Outlook 2010 Add-in template. The GWPAM wizard launches and here I provide a template name and chose Appointment as the template type.
Next, on the Service Details tab, I enter the URL and click on the GO button, which prompts me to authenticate against the Gateway system. In the Collection Name dropdown list I select the LeaveRequestCollection entry.
As for the mapping instruction I keep it simple and only map 3 fields (which I will have to enhance later in coding):
|Service Properties||Outlook Properties|
I am not tweaking the Custom Properties. By default I will get all of them. I also skip over the Associated Properties to keep things simple.
That’s it. I click on the Finish button to generate the project. Once generated, I set my user id and password in the BusinessConnectivityHelper class. I use Basic Authentication to keep things simple, but GWPAM does also support X.509 and SAML 2.0. Now I give this a try to see the “plain-vanilla” solution that GWPAM generated. From Outlook I click on the GetAll button to retrieve the data through the Fiori OData Service and now I see the leave requests in my Outlook Calendar:
The calendar entries you see correspond to the ones you see in the Fiori application above. Below you see one of the leave requests with the Subject, Start and End populated with data from the SAP HR system:
Looking at the auto-generated user property folder, here you see all additional data that the OData service offers:
I hope you are excited by now. But you might be saying: Pretty cool, but a bit plain. Ok, this is where your work starts to enhance the generated coding to take full advantage of the SAP data and map it into the proper fields and formats of an Outlook Appointment. Example: The HR Leave Status (posted vs. approved) could determine the Appointment Busy Status (tentative vs. out-of-office). In the screenshot below I have done a couple of simple tweaks to the .NET coding:
Of course this could be taken even further to allow the creation or changes of a leave request from Outlook, which I will not touch on in this blog. The sky is the limit? Almost, more precisely, the OData service, the .NET framework and your skills are the limits. 😉
SAP Fiori has many other scenarios that fit really well into Outlook. I hope to post a follow-up blog on some other scenarios. Please leave your feedback and comments of scenarios you have tried.
Update: In the meantime I have written another blog on how to bring the SAP Fiori My Contacts to Outlook. I hope you find it helpful.