Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
Showing results for 
Search instead for 
Did you mean: 


SAP Gateway for Microsoft (GWM) is a product that simplifies the integration of SAP Gateway based services into Microsoft products. GWM provides an interoperability layer that makes sure that applications can communicate in a secure, reliable and scalable manner with SAP backend systems.

The GWM add-in for Visual Studio provides an extensive OData browsing functionality, a set of templates that can be used to create Contact, Calendar or Workflow-based scenarios in Microsoft Outlook 2010 and 2013 and also provides a generic service generation for any Visual Studio C# project. For details refer: SAP Gateway for Microsoft.

SAP Workflow Apps for Office Application helps to retrieve work item details (ex: leave requests, Travel Requests, Purchase Order Requests….etc.) from SAP Backend and update (Approve\Reject) request using Task Gateway Service V2, which is THE central workflow service that is used by plenty of (Fiori) applications, for example SAP FIori - MyInbox. This means that if you have already the SAP Fiori - My Inbox running, you can now easily also bring your workflows to Outlook. For details refer: Task Gateway Service Version 2.

This application supports 2 ways of accessing the TaskProcessingV2 (controlled through configurations as explained below in the configuration section).

  1. Directly from Gateway (Default).
  2. Through Azure via Provider Systems configured in GWM Azure Portal.

This application and this blog focuses on 2 potential scenarios (controlled through configurations as explained below in the configuration section).

  1. Any sample Workflow in the SAP Backend system - Showcases how you can take any workflow that you want to build or that you might already have in your system and expose it to Outlook.
  2. SAP Standard Travel request - Showcases how you can use existing out of the box SAP workflow services and get them to Outlook.

Note: Sample Workflow in this application can be considered as the Leave request workflow.

Application Code:

Application code can be downloaded from the GitHub Repository


  1. Operating System - Windows 7 and Windows 8.
  2. Microsoft Visual Studio 2013 Editions - Professional, Premium, Ultimate and Community.
  3. Net Framework 4.5.
  4. Microsoft Office Professional 2013 and Microsoft Office 365 (Office Online).
  5. Required Library Files- The following Dynamic Link Library files (with the extension .dll) should be present in the Global Assembly Cache (GAC) folder for installation:
    • Newtonsoft.Json.dll (version 5.0.6)
    • Microsoft.IdentityModel.Clients.ActiveDirectory.dll (version 1.0.2)
    • Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll (version 1.0.2)
    • Newtonsoft.Json.dll is available in the Json.Net 5.0.6 package,
    • Microsoft.IdentityModel.Clients.ActiveDirectory.dll and
    • Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll are available in the Active Directory Authentication Library 1.0.2 package. These packages can be downloaded at with a registered account. The downloaded files can be extracted to view the DLL files in the lib folder based on the .NET Framework version. Follow these steps to add the required DLL files to the GAC folder:
      1. Open Visual Studio Tools on the Start menu, right-click on Developer Command Prompt for VS2013 or Developer Command Prompt for VS2010 (depending on the version of Visual Studio being used) and choose Run as Administrator , choose Yes if Windows displays a security prompt.
      2. In Developer Command Prompt , run the command gacutil -if and press Enter. Repeat this step till all the required DLL files are added successfully.
  6. SAP Gateway for Microsoft (GWM) Solution.


This application supports 2 ways of accessing Task Processing Service controlled by configurations in the Web.Config file.

  1. Directly from Gateway - Provide the below values under Gateway Configurations section in the Web.Config.
    1. GatewayServiceUrl
    2. HasMultipleSapOrigin
    3. SapOrigin
    4. SapClient
    5. GatewayRequestType
  2. Through Azure via Provider Systems configured in Azure Portal - Provide the below values under Azure Configurations section in the Web.Config.
    1. ClientID
    2. ClientKey
    3. Authority
    4. ResourceUrl
    5. AppHostName
    6. AzureServiceUrl
    7. AzureRequestType

Note: GatewayRequestType/ AzureRequestType determines if it is sample Workflow or SAP Standard Travel request.

Steps to run the Apps for Office Workflow Application:

Note: You need to have a workflow and a related Taskprocessing service configured and accessible.

  • Download the SAP.Workflow.AppsforOfficeApplication code from Github.
  • Extract the file.
  • Open SAP.Workflow.AppsforOfficeApplication.sln file.
  • Build the project.
  • Deploy the solution.
  • Run the project.[BH1]
  • Enter the credentials to connect to Exchange email account.

  • Open the Workflow notification mail received in the inbox.
  • Click on the WorkflowApp.

  • Apps for Office Workflow application for Sample WF loads and displays the details of the request from the SAP Backend.

  • Approve\Reject the request.
  • Request gets updated in the SAP Backend system.
  • When you reopen the request, details are fetched from the SAP Backend.

About SAP.AppsforOffice.WorkflowAppln Code:

  • Structure of the code – 2 main projects as below
    • AADSSOTravelAgency
    • AADSSOTravelAgencyWeb

  • Description of the main files of the project
    • AADSSOTravelAgency
      • AADSSOTravelAgency.xml: Contains Activation rules. Out of the box, App will be enabled in the mails if the subject contains “# followed by numbers until next space”.
      • AADSSOTravelAgencyWeb
        • Images: Added images for SAP Icon, Approve, Reject and Close.
        • Pages->Utilities->Constant.cs: Maintain Gateway system user credentials which are used to access Task Processing Service.
        • Pages->AzurePages->Default.aspx.cs: Retrieves task details (Get) from SAP backend and Approve\Reject (Post) for Azure scenario.
        • Pages->GatewayPages->DefaultForGateway.cs: Retrieves task details (Get) from SAP backend, getting Decision Options and Approve\Reject (Post) for Gateway scenario.
        • Pages->AzurePages->UserInfoPage.cs: Getting Decision Options for Azure scenario.
        • Pages->AzurePages->UserInfo.js: Creates Approve\Reject buttons if Decision Options are available, displays status message upon Approve\Reject.

Sample Workflow in the SAP Backend:

  • This application supports any workflow created in SAP backend. Example: as show below.

  • Sample workflow as shown above is for the Leave request scenario. We have provided “Name”, “From Date”, and “To Date” as part of parameters. Decision Options – “Approve” and “Reject”.

  • “Name”, “From Date”, and “To Date” are categorized as Custom Attributes for Leave request and these values can be accessed using navigation property “CustomAttributeDefinitionData” and “CustomAttributeData”. For details refer: Custom Attributes.

End to End flow:

Below steps demonstrates how to create work items (Leave requests) in the SAP backend, send the Leave requests to Outlook 2013 (Office 365), retrieve details of therequest in Office 365 and Approve\Reject the request.

  • Open the workflow in SWDD transaction
  • Press on F8 to run the workflow

  • Provide “Name”, “From Date”, and “To Date”.

  • Press on F8 and then cancel button to get the Work item Id.

  • You can track this leave request in Business Workplace of the requester (inbox) in the transaction SBWP.

  • To send this leave request to Office 365 -> Send a mail from any Id to the approver’s Office 365 mail Id. Make sure subject has “# followed by Work item number generated above”.
  • Login to approver’s Office 365 -> Check for the new mail waiting for approval.

  • Click on the WorkflowApp -> Apps for Office Application for leave request will be loaded by fetching the request details from SAP backend.

  • Approve\Reject the request -> leave request gets approved\rejected in the SAP backend.

  • Upon refreshing the App -> leave requests details are fetched from SAP backend which means we get the real time status of the request in case request is updated from another application.

  • Status of this leave request gets updated in the SAP backend.

Additional Resources

SCN Spaces

SAP Gateway

SAP Gateway for Microsoft


How to Download SAP Gateway for Microsoft?

( -> Support Packages and Patches -> G -> GWPAM -> GWPAM 1.0 )

Demos & Videos

Lectures & How-Go Guides

Self Paced Learning

SAP Documentation

SAP Product Availability Matrix

Release Note Note



Connect with us:

SAP NetWeaver Gateway Twitter | LinkedIn | Youtube |

To  follow GWM, as well other solutions connecting SAP and Microsoft, subscribe to our social medial channels:
Facebook l Twitter | LinkedIn  | Youtube |

0 Kudos

Interesting... :smile:



Former Member
0 Kudos

Thank you for the post, It would be really nice if you can post the sample Web.Config file or little more details about values that should go in the Web.Config.



0 Kudos

Hi Prathiba,

I am struggling with installation,Could you please help me how to download the packages from NuGet Gallery | Home?

Thanks in Advance.

0 Kudos

Hi Raghavendra,

Please follow the instructions in the documentation "Installing NuGet" to download the packages from NuGet gallery.

Best Regards,


0 Kudos

Thank You very much prathiba :smile: :smile: