Bring SAP Concur Data to SAP Datasphere (Part-1)
|Blog post series to understand how to bring SAP Concur Data to SAP Datasphere.
SAP Concur is a SaaS solution that provides customers the travel and expense management services. It enables businesses to reinvent travel, expense, and invoice management, simplify everyday processes, and provide employees with better experiences.
More specifically, you can capture your spend from multiple sources and make spending decisions based on accurate data, reimburse employees more quickly, and simplify the expense reporting process for everyone. SAP Concur can help us to
- View all your expense data in one place
- Configure expense processes according to your business needs
- Easily enforce and change spending policies
- Automatically capture receipts and process reports
You can read and understand more about SAP Concur in the following links:
SAP Concur solutions centralize all spend data to help back-office staff. To examine and evaluate a business’s expenses, determine the cost structure of the business, and identify areas for cost reduction, expense analysis is required.
Expense Analysis in SAP Concur enables businesses to compare expenses with budgets to ensure they are not overspending or indulging in wasteful expenditures. It can provide valuable insights into a business’s cost structure and help identify improvement areas. Regular expense analysis can help businesses remain competitive and maximize profitability.
For analyzing data, SAP Datasphere is a flexible, scalable, and cost-effective solution; with Integrated tools and data governance, and Self-service analytics, you can easily cleanse, enrich, and visualize your data. It provides a large set of default connections to access data from a wide range of sources, which might be in the cloud as well as on-premises, or from SAP as well as from non-SAP sources or partner tools.
To extend connectivity beyond SAP Datasphere standard remote connectivity and cover additional data sources we can create a connection to a partner tool and generate an Open SQL schema in SAP Datasphere. When data is pushed by the source via created database users with an Open SQL schema, you can directly import a table in the Data Builder which is then deployed as a local table.
As you can see in the architecture below, you will try to bring the SAP Concur Data using SAP Integration Suite and store it in SAP Datasphere so we can use it in Data Builder to model and enrich the business expenses data sets.
In this blog post, we will have a short overview of SAP Concur API and how easy to access it using the VSCode rest client extension. we will also look into how to access it using the integration flow which will help you to bring SAP Concur data to SAP Datasphere
You need to have SAP Business Technology Platform setup and ensure that you already provisioned SAP Integration Suite and have experienced capabilities offered by SAP Integration Suite like creating and deploying an integration flow and sound knowledge of integration packages, adapters, and flow steps. To set up the SAP Integration Suite you can follow the tutorial Get onboarded to the SAP Integration Suite trial account.
You should have SAP Concur cloud travel and expense system. you need to register an application with SAP Concur. Once you have registered an application, you will receive a clientId, clientSecret, and geolocation. you will be using this credential to obtain tokens for the application. To register your application you can follow the excellent blog by Tim Chapman : Introduction to Web Services for Concur Expense – Authentication
SAP Concur API Overview
SAP Concur APIs allow clients or partners to access data and functions within the SAP Concur product ecosystem. Several business problems and reporting requirements can be resolved by utilizing these available endpoints and functionalities, including:
- For comprehensive reporting services, pull data from SAP Concur.
- Compare your data with SAP Concur data to check or reconcile your records.
- Upload new data into SAP Concur to enable information production via programming.
- To match the data in your system, update the existing information in SAP Concur.
To call a SAP Concur API, you need to obtain an accessToken on behalf of the Application you created earlier. There are multiple ways of obtaining an accessToken through various grants. for simplicity, you can use the Password grant flow.
- A refreshToken is returned the first time an accessToken is requested. A refeshToken has a default lifetime of six months and can be compared to a password. This worth needs to be safeguarded. Ideally, this value should only be known by the program.
- When an access token expires, you will utilize the refreshToken in the subsequent call to obtain a new one. An access token is used by the APIs to communicate with Concur Expense and has a default lifetime of one hour.
You can now start making calls to a SAP Concur API using the accessToken. With this access token, you can use the relevant base URI to retrieve the Expense Report. An existing expenses report can be read and modified using the SAP Concur Expense Reports API. This API can be used to simplify expense reporting and get more visibility into spending.
Using VS Code extension you can make these API calls easily by giving the references to the required response objects in the first call and using them in the next call.
We are going to use the same service to fetch expense report(Expense v3/Reports v3) entries using the integration flow.
Discover & Design Integration flow
SAP delivers rich pre-packaged integration content out of the box that enables you to get started quickly. These integration packages are created for some of the commonly used integration scenarios. They contain integration flows, value mappings, documentation, and so on. By using this content, you can easily get started with minimal integration developer effort.
To accelerate the integration scenario, we will use the pre-packaged integration content that helps us to connect to SAP Concur API by providing a way to authenticate and send the request to the SAP Concur API. For more information, refer to Connect to SAP Concur API.
It should be used as a subprocess integration flow that is called by another Integration flow on the SAP Cloud integration to retrieve data from any SAP Concur API with a GET request.
You can find this pre-packaged content in the Discover section. you can search for “Connect to SAP Concur API”. Copy the package SAP Concur API Integration with SAP Cloud Integration. After you’ve successfully copied your integration flow package you need to configure and deploy this Integration flow we need the additional information
- Concur Credential Store: A SAP Cloud Integration OAuth2 Client Credential Artifact. We know SAP Concur APIs use the OAuth2 framework. To connect to a SAP Concur API we need to deploy an OAuth2 Credentials artifact.
- Concur RefreshToken: which we have already used in the VS Code extension API Calls.
You can configure the Concur Credential Store and Concur RefreshToken on the Manage Security Material page.
you can update the integration flow you have copied recently with Concur Credential Store and Concur RefreshToken. It is a Consumer Integration Flow using a ProcessDirect adapter and is to be consumed from other integration flows.
Now you can create a new time-based Integration flow to execute the integration flow immediately after you deploy the integration flow. To know more about the available timer configurations is available in the help documentation.
Add the Request-Reply integration pattern with a ProcessDirect adapter and update it with the Connection detail of “Connect to SAP Concur API” recently copied.
To print the payload add the Groovy Script from the integration palette you can specify the script according to the requirements of your scenario. For an overview of the classes and interfaces supported by the Script step, see SDK API. For more information on how to use the dedicated interfaces and methods for specific use cases, refer to Script Use Cases.
Finally, your integration flow looks as it appears in the screenshot below.
Save and then Deploy your integration flow. first-time deployment might take some time before the changes are fully deployed. Since the integration flow was designed as a Run immediate timer-based integration the flow will be executed as soon as it is deployed. Select the Completed Messages tile to view the successfully executed integration flows. In case of any failure, it will appear under Failed Messages.
Check the status of the newly created integration flow from the Monitor Message Processing. If the status changes to Completed then the Attachments Tab Response payload able to show Concur Expense Report API
So, now in this article, you get an overview of SAP Concur APIs and how they allow clients or partners to access data and functions within the SAP Concur product ecosystem and for integration scenario, we understand how the pre-packed package helps to connect SAP Concur API with minimal integration efforts.
In the next blog article, we’ll understand how we will push this SAP Concur Expense data to the SAP Datasphere for further analysis to build analytical applications.
Keep your anticipation high for the upcoming blog posts. Stay curious!
Reference & Further Reading
Travel and Expense Management
Integration Flow – ProcessDirect Adapter
Integration Flow Design Guidelines – Timer-Initiated Scenario
Use Prepackaged Integration Content Provided by SAP
For more information and related blog posts on the topic page for SAP Datasphere.