Other Configurations > Connect ThingWorx Navigate to SAP
  
Connect ThingWorx Navigate to SAP
Your users can access data from SAP Netweaver Gateway using these tasks in ThingWorx Navigate:
View Parts List
View Part Properties
View Part Structure
Connect to the server to get information for parts, CAD documents, or both. In the package of PLM files you imported to install the ThingWorx Navigate View PLM App Extension, there is also an extension package, SAPProviders_ExtensionPackage. It includes all the components you’ll need. The setup requires some connection steps in ThingWorx Composer:
Define the connection to SAP
First, we’ll set up the connector between the SAP server and ThingWorx Navigate.
1. Search for this connector: ptc-SAP-OData-connector.
2. Click Configuration. The Configuration page opens.
3. Under Generic Connector Connection Settings, under Authentication Type, select SSO.
4. Authorization Server ID — The ID defined in sso-settings.json for SAP.
5. Under Authorization Server Scopes Settings, add the SAP scope. For more information about scopes, see PTC Product Single Sign-on Architecture and Configuration Overview.
6. Under OData Connector Connection Settings, click Add, and then add the tw.friendly-names.ServiceRootRelativeURL for SAP.
7. At the bottom of the page, under HTTP Connector Connection Settings, provide this information for your system:
Username and Password—Leave these boxes blank.
Base URL—Provide the path to the SAP server.
Relative URL — Leave this box blank.
Connection URL—Enter the location that provides REST web services
8. Click Save.
Check your connection, and then edit the services
In this step, define the type of information that your users receive from a search.
1. Open ptc-SAP-OData-connector, and then click Services.
* 
Before you edit your services, we recommend that you check your Base URL and Connection URL:
a. Find the ValidateConnection service.
b. Click the play button, and then click Execute. On the right, under Output, the results appear.
2. Select the GetProductSet service, and then edit it.
3. Under Route Info > Endpoint, select your organization endpoint. This ensures that your users get the correct information, such as a material or a product, for the search criteria in SAP.
4. Click Done, and then click Save.
5. To validate that the GetProductSet service is correctly configured and provides the correct information, execute it.
Edit the data shape
You use this data shape to define which SAP attributes appear on the ThingWorx Navigate tailoring pages.
1. Search for SAP_DATA_SHAPE.
2. Click Field Definitions. Edit the list to include all the attributes your organization needs, such as SAPQuantity, SAPCurrency, and SAPMaterialCost.
* 
After you define the list of field names, you can also define localization tokens for each field.
3. Click Save.
Map the attributes in the resource provider
Now that you have defined the fields to appear in ThingWorx Navigate, we’ll make sure that they’re mapped to the corresponding attributes from SAP.
1. Search for SAPPartResourceProvider, and then open it.
2. Click Configuration. The Configuration page opens.
3. Click Add to add each field that you defined in the data shape. In our example, these were SAPQuantity, SAPCurrency, and SAPMaterialCost. The field names appear in the Normalized column.
4. Under Original, map each field to its corresponding attribute name in SAP. For example, SAPMaterialCost may correspond to MovingPr in SAP.
5. In addition to the fields you defined, add these two required fields to the Normalized list:
Id
Number
6. Map both the Id and Number fields to the SAP attribute that your users will query on. For example, Material or ProductID.
7. In Resource Provider Configuration table, add the connector ptc-SAP-OData-connector.
8. Click Save.
Add tags to the SAP fields
You’re almost finished with the setup. In this step, add SAP tags to the fields using these resource providers:
CompositePartResourceProvider—Supports part information
CompositeEPMDocumentResourceProvider—Supports CAD document information
The tags help you distinguish which attributes come from SAP. Any field without this prefix searches Windchill for the data.
1. Search for CompositePartResourceProvider, and then open it.
2. Click Configuration. The Configuration page opens.
3. Add all the fields you defined and mapped in the previous steps. In our example, these were SAPQuantity, SAPCurrency, and SAPMaterialCost, plus the two required additional fields, Id and Number. As you add them, the field names appear in the Normalized column.
4. In the Original column, add this tag as a prefix, including the hyphen, to each field name: SAPPartResourceProviderTag-. So, for example, SAPMaterialCost in the Normalized column should be SAPPartResourceProviderTag-SAPMaterialCost in the Original column.
5. In Expand Terms table, add the tag name SAPPartResourceProviderTag.
6. Click Save.
7. Repeat steps 1–5 for CompositeEPMDocumentResourceProvider.
Your connection to the SAP server is complete. On the tailoring pages, your business administrator can choose SAP attributes to show your end users.