Overview:


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


Pre-requisites:


  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 https://www.nuget.org/ 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.

Configurations:


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.

Credentials Pop up.jpg.png

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

WorkflowApp.jpg.png

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

Workflow App details.jpg

  • 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

Code.JPG

  • 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.jpg

  • 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”.

Sample Workflow_Start_End_Date.jpg

Sample Workflow_Start_End_Date_Container.jpg

  • “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

Sample Workflow.jpg

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

Start_End_Date.jpg

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

WorkItem Id.jpg

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


SBWP.jpg

Workflow Log.jpg

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

New Mail_Waiting_for_Approval.png

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

Workflow App details.jpg

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

Approved.jpg

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

Completed.jpg

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

Status in Backend.jpg

Status in Backend1.jpg

Additional Resources

SCN Spaces

SAP Gateway

SAP Gateway for Microsoft

Downloads

How to Download SAP Gateway for Microsoft?

(http://service.sap.com/patches -> Support Packages and Patches -> G -> GWPAM -> GWPAM 1.0 )


Demos & Videos

Lectures & How-Go Guides

Self Paced Learning

SAP Documentation

help.sap.com

SAP Product Availability Matrix

Release Note Note

FAQ

GWM @ SAP.com

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 |

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

  1. Bindu Chinnasamy

    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.

    Thanks,

    Bindu

    (0) 

Leave a Reply