{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":25855,"path":"it-asset-management/software-asset-management/add-sap-connection-oauth.md","title":"Establish an SAP connection using OAuth 2.0","bundle":null,"doc_type":null,"release":"australia","body":"\n# Establish an SAP connection using OAuth 2.0\n\nCreate a connection profile to establish a connection between your SAP system and your ServiceNow instance using OAuth 2.0 authentication.\n\n## Before you begin\n\nBefore establishing a connection between SAP and your ServiceNow instance, make sure that the following conditions are met:\n\n-   Verify if your SAP system network is accessible to external applications like ServiceNow.\n-   If external connections are blocked, install a MID Server. A MID Server enables communication and data movement between a ServiceNow instance and external applications or data sources. For instructions, see [Installing the MID Server](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/mid-server-installation.md).\n\nIf you already have a MID Server installed in the network and connected to your ServiceNow instance, this SAP connection automatically uses it.\n\nRole required: sam\\_admin\n\n## Procedure\n\n1.  Navigate to **All** &gt; **SAP Compliance and Optimization** &gt; **Connection Setup** and select **New**.\n\n2.  On the form, fill in the fields.\n\n<table id=\"table_llt_dlc_hfb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nName of connection profile.\n\n</td></tr><tr><td>\n\nDefault price list\n\n</td><td>\n\nDefault price list that should be considered for reconciliation.\n\n</td></tr><tr><td>\n\nConnection type\n\n</td><td>\n\nValues include:-   Basic Auth\n-   OAuth 2.0\n\n\n</td></tr><tr><td>\n\nConnection URL\n\n</td><td>\n\nThe base URL to connect to the SAP instance.\n\n</td></tr><tr><td>\n\nOAuth Client ID\n\n</td><td>\n\nClient ID for your SAP connection.\n\n</td></tr><tr><td>\n\nOAuth Client Secret\n\n</td><td>\n\nClient secret for your SAP connection.\n\n</td></tr></tbody>\n</table>    **Note:** You can get the OAuth Client ID and Client Secret at the time of registering your SAP application.\n\n3.  Select **Submit**.\n\n    The initial connection is established.\n\n4.  Select the SAP connection and review the fields on the record.\n\n<table id=\"table_vzk_fwb_qfb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nName of the connection profile. The value is generated in the SAP Connection Setup form.\n\n</td></tr><tr><td>\n\nDefault price list\n\n</td><td>\n\nDefault price list that should be considered for reconciliation. The value is generated in the SAP Connection Setup form.\n\n</td></tr><tr><td>\n\nUse USMM Role Optimization\n\n</td><td>\n\nThe option to specify USMM role-based optimization that must be applied during reconciliation.\n\n</td></tr><tr><td>\n\nLast run\n\n</td><td>\n\nDate and time when the data was last pulled for the SAP connection.\n\n</td></tr><tr><td>\n\nREST message\n\n</td><td>\n\nREST message that contains the SAP API information.\n\n</td></tr><tr><td>\n\nOAuth entity profile\n\n</td><td>\n\nThe OAuth entity profile that contains the credentials for the connection.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nOption that indicates that the SAP connection is active.\n\n</td></tr><tr><td>\n\nConnection type\n\n</td><td>\n\nThis field is automatically populated based on your connection type.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nUser Mapping\n\n</td></tr><tr><td>\n\nSAP user field\n\n</td><td>\n\nSAP users across different clients that are mapped to a corresponding ServiceNow user.\n\n</td></tr><tr><td>\n\nUser field\n\n</td><td>\n\nServiceNow user field.**Important:** Changing the values in the User Mapping fields after data is pulled results in the loss of the mapping between discovered users and system users. The mapping between discovered users and the **Rights used by** and **Rights needed by** fields is also lost.\n\n</td></tr><tr><td colspan=\"2\">\n\nConfiguration\n\n</td></tr><tr><td>\n\nFetch roles\n\n</td><td>\n\nControls the data pull from SAP for roles data.\n\n</td></tr><tr><td>\n\nFetch engine usage\n\n</td><td>\n\nControls the data pull from SAP for engine usage data.\n\n</td></tr><tr><td>\n\nFetch digital access usage\n\n</td><td>\n\nControls the data pull from SAP for digital access usage data.\n\n</td></tr><tr><td>\n\nFetch activity\n\n</td><td>\n\nControls the data pull from SAP for user activity and web activity data.\n\n</td></tr><tr><td>\n\nFetch user transactions\n\n</td><td>\n\nControls the data pull from SAP for user transaction activity data.\n\n</td></tr></tbody>\n</table>5.  Generate an access token by selecting the **Get OAuth Token** related link.\n\n    **Note:** You must be in the local network of SAP to generate the access token.\n\n    1.  Log in using your SAP credentials.\n\n    2.  In the Access Permission Request dialog box, select **Allow** for the scopes that you had added during the application registry.\n\n        A message is displayed on the SAP Connection form indicating that the OAuth refresh token is available.\n\n6.  If you're running the latest version of the ABAP program, test your SAP connection by selecting the **Test SAP Connection and Version** related link.\n\n    **Note:** If you upgrade your ServiceNow instance, you must download and deploy the compatible version of the ABAP program and reconfigure a service provider with the SOA Manager.\n\n7.  Send a request to the custom ABAP program to collect the SAP data into the custom tables again by selecting the **Refresh data in SAP** related link.\n\n8.  If the SAP data you pulled is corrupted, view current data by selecting the **Pull all SAP Data to ServiceNow** related link.\n\n    SAP data is scheduled to be pulled regularly.\n\n9.  Update connection information by selecting the **Update connection** related link.\n\n10. Select **Submit**.\n\n11. View SAP clients in the **SAP Clients** related list.\n\n    The SAP clients are generated when SAP data is pulled during the scheduled job.\n\n12. Select **Update**.\n\n\n## Result\n\nThe SAP connection is established.\n\n## What to do next\n\nYou can start creating software models and entitlements.\n\n**Parent Topic:**[Software Asset Management publisher pack for SAP](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-asset-management/software-asset-management/sap-publisher-pack.md)\n\n**Related topics**  \n\n\n[Tables installed with the SAP publisher pack]()\n\n[Set up SAP integration to establish a connection with SAP]()\n\n[Establish an SAP connection using basic authentication]()\n\n[Create entitlements for SAP]()\n\n[Create software models for SAP]()\n\n[Create a custom SAP named user type]()\n\n[Map a role to a named user type]()\n\n[Create custom SAP price lists]()\n\n[Import custom SAP named user types]()\n\n[Import custom SAP price lists]()\n\n[SAP USMM-based optimization]()\n\n[User transaction activity for named user types]()\n\n[Self-declaring SAP engine license usage]()\n\n[Software Publisher Analytics dashboard for SAP in Software Asset Management classic]()\n\n[Publisher overview for SAP in the Software Asset Workspace]()\n\n"}}