100% found this document useful (1 vote)
851 views45 pages

SAP Integration With Concur Solutions - Best Practices Integration Via SAP Process Orchestration

Uploaded by

Jyotsna Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
851 views45 pages

SAP Integration With Concur Solutions - Best Practices Integration Via SAP Process Orchestration

Uploaded by

Jyotsna Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

PUBLIC

SAP Integration with Concur Solutions


Best Practices: Integration via SAP Process Orchestration

Version December 2018


TABLE OF CONTENTS
PRELIMINARY REMARKS ......................................................................................................................... 3
STEP-BY-STEP CONFIGURATION ............................................................................................................ 4
Sender Channel ......................................................................................................................................... 5
Receiver Channel ......................................................................................................................................11
Configuration enhancements for Credit Card Detokenization scenario.................................................16
Integration Flow ........................................................................................................................................18
Determine Integration Flow End Point URL .............................................................................................24
CONCUR INTEGRATION SETUP AND MONITORING ..............................................................................25
Create Connection ....................................................................................................................................25
Check Connection ....................................................................................................................................31
TRANSACTIONS .......................................................................................................................................33
Employee Master Data Export ..................................................................................................................33
Cost Center Export ...................................................................................................................................36
Importing Concur Documents (FI Posting) ..............................................................................................40

2
The communication between Concur and SAP ERP or SAP S/4HANA is a simple communication running in
a sort of Point-to-Point (P2P) mode. All communications are triggered by the SAP system, so there are only
outgoing calls from SAP to Concur. Since there is no mapping nor content-based routing required, the
scenario can run in a direct mode without the need of any middleware. However, this integration can also run
in a mediated mode in case client’s internal policy requires the usage of a middleware.

Currently, SAP Cloud Platform Integration is the only middleware being supported out-of-the-box. The usage
of any other middleware is possible, however the customer is responsible to build up the content required to
mediate the integration between Concur and SAP system.

This document provides best practices showing how to setup and run the integration between SAP ERP with
Concur Solutions using SAP Process Orchestration / SAP Process Integration as middleware.

Note: This is not part of SAP’s product shipment. SAP takes no liability for this best practices template.

PRELIMINARY REMARKS
The current document shows how to setup mediated integration between SAP systems and Concur
Solutions using SAP Process Orchestration as middleware. SAP Process Orchestration is used as pass-
through whereas the following requirements need to be met:
· The request from SAP Financial has to be passed as is to Concur.
· The response from Concur has to be returned to SAP Financial as is.
· The following HTTP methods need to be supported: GET, POST, PUT, DELETE.
· The pass-through Integration Flow needs to be document type agnostic, i.e., it needs to support the
exchange of any document type including the token service call.
· The communication is synchronous.
· The Integration Flow needs to accept all HTTP header fields that are sent by SAP System which are as
follows:
- targetURL
- targetAuthorization
- content-type
- X-ConsumerKey
- companyId
- Accept
- concur-correlationid
· The Concur target URL needs to be set dynamically based on the HTTP header attribute targetURL.
· The HTTP header attribute targetAuthorization needs to be mapped to the HTTP header attribute
Authorization.
· The rest of the HTTP header attributes as listed above need to be passed through.

Prerequisites:
· SAP Process Integration or SAP Process Orchestration, release 7.31 SP21 / 7.4 SP16 / 7.5 SP07 and
above (see SAP notes 2408216, and 2487421 for more details)
· SAP recommendation is to keep your system on the latest SP

3
STEP-BY-STEP CONFIGURATION

In order to configure the routing rules on SAP Process Orchestration / SAP Process Integration, you do have
two options: either using the SAP Process Integration Designer perspective in the NetWeaver Developer
Studio (NWDS) or using the Integration Builder (Java WebStart UI). On SAP Process Orchestration, the
recommendation is to use the NWDS, on a SAP Process Integration dual-stack / dual-usage type system
however, only the Integration Builder is supported. Besides this, the choice of tool depends on your
preferences. At the end, the same runtime artifacts are created. In the following, we will show you the first
option using the SAP Process Integration Designer perspective only. For the second option, i.e., via the
Integration Builder, the channel configuration is identical. Here, instead of an integration flow you need to
create an Integrated Configuration Object.

Open the NWDS, and switch to the SAP Process Integration Designer perspective by selecting Window à
Perspective à Open Perspective à Other from the main menu of the NWDS.

In the upcoming dialog, select entry SAP Process Integration Designer, and click on OK.

In the SAP Process Integration Designer perspective, select the connect icon to logon to the Integration
Directory of the SAP Process Orchestration / SAP Process Integration system.

4
In the upcoming logon screen, enter your user credentials, and click on OK.

Sender Channel

We assume that you have created the sender and receiver communication component already. First, we will
create a new sender channel of type REST. Navigate to the sender communication component, and select
New Channel from the context menu.

5
In the upcoming dialog, enter a channel name, and click on Finish.

On the General tab, select adapter type REST, and direction Sender.

Switch to tab General below tab Adapter-Specific. Communication is always synchronous, so select Quality
of Service Best Effort. We do use the very same channel to exchange any data format. Right now, the REST
adapter supports the data formats JSON and XML. Since we just pass through the message without the
need to transform nor access the payload, it usually wouldn’t matter which data format we maintained in the
channel. However, for XML as data format the REST adapter obviously parses the XML payload, so if the
actual payload is in JSON format, the message exchange will fail. This is not the case when choosing JSON
as data format, here both will work, i.e., payload in JSON or XML format. So, select JSON as data format for
both the input message format (request) and the output message format (response).

6
Switch to tab Channel Selection. Select check box Specify Endpoint, and maintain endpoint as
/concur/passthrough/allobjects.

Switch to tab REST Resources. Select Custom Pattern as URL Pattern, and set the Pattern as /.
In order to store the HTTP header elements of the incoming call in the XI message header, define the
following dynamic attributes. For keeping the target URL, select from the drop down the pre-defined REST
Service (service) entry. For the rest of the attributes, select Custom Attribute as Dynamic Attribute, maintain
the Custom Attribute Name as listed in the table below, select HTTP Header Variable as Value Source, and
maintain the HTTP Header Element as listed in table below. Furthermore, it is important that all attributes are
defined as optional, because depending on whether the Concur token service is called or actual business
data is exchanged, not all HTTP header elements are passed to SAP Process Orchestration. So, for each
dynamic attribute select the Optional check box.
Note: for the target URL we used a pre-defined dynamic attribute. You may also create your own custom
attribute.

7
Type Dynamic attribute name HTTP header variable
Pre-defined REST Service (service) targetURL
Custom attr_targetAuthorization targetAuthorization
Custom attr_contentType content-type
Custom attr_consumerKey X-ConsumerKey
Custom attr_accept Accept
Custom attr_companyId companyId
Custom attr_correlationid concur-correlationid

8
9
We like to store the HTTP Operation of the incoming call in the XI message header. Switch to tab REST
Operation, and select HTTP Operation as Value Source. This will store the HTTP Operation in the
predefined attribute named operation.

We like to pass through the content type of the response. Switch to tab Result HTTP Header. Create a new
HTTP Result Header element. Select Message Attribute as Value Source, and maintain Content-Type for
both the Message Attribute and the Header Name.

Save the channel, and select Activate from the context menu.

10
Receiver Channel

Next, we will create a new receiver channel of type REST. Navigate to the receiver communication
component, and select New Channel from the context menu.

In the upcoming dialog, enter a channel name, here PassThrough_REST_Receiver, and click on Finish.

On the General tab, select adapter type REST, and direction Receiver.

11
Switch to tab General below tab Adapter-Specific. You may have to maintain a proxy depending on your
network policies.

Switch to tab REST URL. We need to maintain the target URL pointing to the Concur service and the HTTP
header for the actual call. For this, we need to define a set of placeholders, here called pattern elements,
based on the dynamic attributes that we have set in the REST sender channel.
For each of the dynamic attributes, create a new pattern element. For the target URL, select Adapter Specific
Attribute as Value Source, maintain the Pattern Element Name as listed in the table below, and select the
pre-defined Attribute REST Service (service). For the rest of the pattern elements, select Adapter Specific
Attribute as Value Source, maintain the Pattern Element Name as listed in the table below, select Custom
Attribute as Adapter Specific Attribute, and maintain the Attribute Name as listed in the table below.

Pattern element name Dynamic attribute type Dynamic attribute name


var_targetURL Pre-delivered REST Service (service)
var_targetAuthorization Custom attr_targetAuthorization
var_contentType Custom attr_contentType
var_consumerKey Custom attr_consumerKey
var_accept Custom attr_accept

12
var_companyId Custom attr_companyId
var_correlationid Custom attr_correlationid

Define the URL Pattern as {var_targetURL}. During runtime, the placeholder will be replaced by the actual
value.

13
Switch to REST Operation. We need to set the operation of the Concur service call. As Value Source select
Adapter Specific Attribute, and REST Operation (operation) as attribute. Since we simply pass through the
operation, we define an identical mapping between the operation attribute and the HTTP operation.

14
Switch to tab Data Format. Select JSON for both the request format and the response format.

Switch to tab HTTP Headers, and define the HTTP header elements using the placeholders defined before
as listed in table below.

HTTP header element name Value pattern


Authorization {var_targetAuthorization}
Content-Type {var_contentType}
X-ConsumerKey {var_consumerKey}

15
Accept {var_accept}
companyId {var_companyId}
concur-correlationid {var_correlationid}

Configuration enhancements for Credit Card Detokenization scenario

The credit card detokenization scenario behaves in some extend different compared to the rest of the
scenarios. For both, the token service call to request for a bearer token as well as the actual exchange of the
credit card number, the path for exchanging business data can be used. So, there is no need to change the
xpath conditions, however we need to enhance the receiver channel for exchanging business data. In the
following the enhancements are shown for the integration flow only, the configuration using the Integration
Directory is pretty much the same.

When checking the connection in transaction code CTE_SETUP, a dummy credit card number XXX is used
and hence the actual call results into a bad request with http status code 400. The response may look like
below:

{"timestamp":"2018-05-11T11:07:42.046+0000","httpStatus":"400 - Bad Request","errorMessage":"Bad


request [creditCardGUID] received.","errorId":"BAD_REQUEST","path":"/detokenizer/v1/company/a83afcbd-
4d68-406a-a052-5f3bfb9c08ed/creditcard/XXX"}

The Concur add-on in the SAP ERP system can handle the http 400, however the REST adapter results into
a message processing error. So, we need to fetch the error to be able to pass the response to the SAP ERP
system. This can be done via the error handling feature of the REST adapter.

In the SAP Process Integration Designer perspective of the NWDS, open the channel
PassThrough_REST_Receiver, and switch to tab Error Handling. Add a new result handler as follows:
· As source choose JSON Expression
· As JSON Element maintain errorId
· As Expression maintain BAD_REQUEST
· As action choose Custom Result
· As message content maintain {http_result}. The parameter http_result contains the response of the
service call.

16
This will set the delivery state to successful (http 200), and returns the service call response.

For the actual call to gather the credit card number, encoding of the url leads to an http 500 error. By default,
the REST adapter encodes the whole url. So, we need to switch off the encoding of the url. See SAP Note
2215187 - Options for URL encoding of query strings with PI REST adapter.

In the PassThrough_REST_Receiver adapter switch to the Modules tab, and add a new parameter to the
RESTAdapterBean as follows:
· Parameter name: EncodeURL
· Parameter value: false

Save the channel, and select Activate from the context menu.

17
Integration Flow

Create a new point-to-point Integration Flow with REST adapter channels on both sender and receiver side.
As sender and receiver interfaces, simply maintain dummy interfaces. To group your configuration objects,
you can use folders. Assuming that you have created a folder already, select the same, and select New
Integration Flow from the context menu.

In the upcoming dialog, select the Point-to-Point Channel pattern, maintain an integration flow name, and
click on Finish.

18
This will create an integration flow stub. Select the sender component, and select Assign System from the
context menu.

19
In the dialog box, select the sender system, and click on OK.

The system has been assigned. Next, we will maintain the sender interface. Select the Interface shape.

In the Properties of the Interface, select the Define Dummy Interface icon in the top right corner.

In the upcoming dialog box, maintain name and namespace of the dummy interface, here allobjects with
namespace http://concur.sap.com, then click on OK.

20
Click on the line between the sender system and the integration flow pool, and select Assign Referenced
Channel from the context menu.

In the upcoming dialog, select the beforehand created REST sender channel, and click on OK.

Assign the receiver communication component, the receiver interface, and the REST receiver channel
PassThrough_REST_Receiver on the receiver side accordingly. When done, the integration flow should look
like below.

21
Save the integration flow, and select Activate from the context menu in the navigation pane.

Once activated, select Deploy from the context menu.

22
The deployment of the integration flow will be triggered. Once done, in the deployment log the integration
flow should have the status Finished.

23
Determine Integration Flow End Point URL

When we run the Concur Integration setup in SAP ERP, we need to maintain the end point URL. Switch to
the SAP Process Integration Runtime perspective. Select the Integration Flow from the navigation pane, and
select Show Runtime Properties from the context menu.

In the upcoming dialog, the HTTP as well as the HTTPS end points are displayed. Based on our channel
configuration, the end point should be defined as follows:
http://<host>:<http port>/RESTAdapter/concur/passthrough/allobjects/
https://<host>:<https port>/RESTAdapter/concur/passthrough/allobjects/

24
CONCUR INTEGRATION SETUP AND MONITORING
In the following we will setup the integration between SAP System and Concur via the previously configured
Integration Flow on SAP Process Orchestration. For detailed information about the Concur integration setup
in SAP ERP, refer to the Concur Setup Guide at the SAP Service Marketplace, accessible from
http://service.sap.com à Products à Installation & Upgrade Guides à Cloud Solutions from SAP à SAP
Integration with Concur Solutions.

Create Connection

Open the SAP ERP system, and start the Concur integration setup via transaction code CTE_SETUP.
In the Concur integration setup, select Create Connection from the System menu.

In the upcoming dialog, select Continue.

25
On the next screen, select the radio button Middleware, and maintain an RFC destination name and
description. The Concur Host www.concursolutions.com is preset. Maintain the SAP Process Orchestration
host and port, and the path prefix of the REST service end point created before. To authenticate to the SAP
Process Orchestration system, maintain user and password. Depending on your network policy you may
have to maintain proxy settings. Then click on Continue.

On the next screen, maintain Consumer Key, Secret, and Concur Company ID of your Concur system. Then
click on Continue.

26
On the next screen, maintain User and Password to authenticate to your Concur system. Then click on
Continue.

27
On the final screen, all settings are displayed. Click on Complete. This will create a new destination of type G
(HTTP Connection to External Server). Furthermore, the overall configuration is used to gather an access
token from the Concur token service.

28
Open the message monitor of SAP Process Orchestration, and switch to tab PI Messages. For demo
purposes I have switched on logging of the synchronous communication. Furthermore, I have defined a user
defined message search filter based on the operation attribute (not shown above). So, two new entries
should be displayed, the request and the response of the Concur token service call. The operation is GET.

29
In the message details of the request, the dynamic attributes are displayed. You can see that the Concur
token service is called. To authenticate to the token service, user credentials for basic authentication and
your consumer key are provided. The content type is not required and hence empty.

In the message details of the response, the payload contains the access token as well as the refresh token.

30
Check Connection

In the Concur integration setup, select Check Connection from the System menu.

A couple of checks such as ping and actual transactions were carried out. The result of the checks are
displayed in the upcoming logs.

Open the message monitor of SAP Process Orchestration, and switch to tab PI Messages. In the message
monitor you should see 9 new messages, i.e., for each message a request and a response, so 18 entries in
total. So, during the checks actual messages are exchanged between SAP System and Concur via SAP
Process Orchestration.

31
32
TRANSACTIONS
In the following we will show:
· The export of master data from SAP ERP to Concur via SAP Process Orchestration. For demo
purposes, we will just show the Employee Export (XML format) and Cost Center export (JSON
format).
· The import of Concur documents from Concur to SAP FI system (FI Posting).

Employee Master Data Export

In the Concur integration wizard, set up the export of the Employee data. For detailed information about the
setup of the export, refer to the Concur Setup Guide. Once you have run through the configuration wizard,
you can trigger the export. For demo purposes we have chosen a manual export. To export employee data,
select Manual Export from the Employee menu.

On the next screen, maintain the selection criteria, and then select the Execute button.

33
The log indicates that the export was successful.

Open the message monitor of SAP Process Orchestration, and switch to tab PI Messages. In the message
monitor, you should see a new message. The operation is POST.

34
In the message details of the request, the dynamic attributes are displayed. You can see that the Concur
user service is called. To authenticate to the Concur service, OAuth is used. The content type is
application/xml. The consumer key is not required and hence empty.

In the message details of the response, you can see that the content type is set based on the response from
Concur, i.e., equals application/xml.

35
When switching to the Payload tab, you can see that the payload is XML. Here, the content type is given as
application/json. This is due to the JSON format setting of the REST adapter channel. However, the content
type will be actually overwritten by the correct value application/xml of the dynamic attribute.

Cost Center Export

In the Concur integration wizard, set up the export of Cost Center data. For detailed information about the
setup of the export, refer to the Concur Setup Guide. Once you have run through the configuration wizard,
you can trigger the export. For demo purposes we have chosen a manual export. To export cost center data,
select Manual Export from the Cost Center menu.

36
On the next screen, maintain the selection criteria, and then select the Execute button.

The log indicates that the export was succesful.

37
Open the message monitor of SAP Process Orchestration, and switch to tab PI Messages. In the message
monitor, you should see a new message. The operation is PUT.

In the message details of the request, the dynamic attributes are displayed. You can see that OAuth is used.
The content type is application/json. The consumer key is not required and hence empty.

38
In the message details of the response, you can see that the content type is JSON.

39
Importing Concur Documents (FI Posting)

Now that we have exported employee and cost center, we are able to perform FI posting. In Concur, we
create and submit an expense report. Once approved, the expense report is ready to be imported from
Concur into SAP FI system. For the import to work, the customizing of FI posting should be set up. For
detailed information about the import/posting of Concur documents, refer to the Concur Setup Guide.

Open Concur travel and expense, and create a new Expense Report. Now let’s submit the report and get it
approved.

Let’s remember the report id (E0DADDCBAF5E4028BAFB) of our report accessible from the report header.

Once the report has been submitted and approved, we jump back to SAP FI system and import the expense
report using our integration wizard. In the Concur Integration Setup, select Concur Documents from the
Financial Posting menu.

40
In Concur Documents, select Feedback Loop à Step-By-Step à Import Documents from Queue.

Select the Single Document radio button, and enter the Concur report ID.

41
Once done, you get a message that the report has been successfully imported.

Checking the message monitor in SAP Process Orchestration, we see that there are two new successfully
processed messages, the request and the response. When selecting the request message, we see in the
message log that the operation is GET. Furthermore, you can see that the target URL contains the Concur
report ID.

42
Now let’s take a closer look at the response message. In the payload you find the reference to the Concur
report ID (E0DADDCBAF5E4028BAFB) of the expense report that we imported via the integration wizard.

43
Downloading the payload, will show you the whole JSON file

44
www.sap.com/contactsap

© 2018 SAP SE or an SAP affiliate company. All rights reserved.


No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP affiliate company.

The information contained herein may be changed without prior notice. Some software products marketed by SAP SE and its distributors contain proprietary software components of other software vendors.
National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for informational purposes only, without representation or warranty of any kind, and SAP or its affiliated companies shall not be liable
for errors or omissions with respect to the materials. The only warranties for SAP or SAP affiliate company products and services are those that are set forth in the express warranty statements
accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

In particular, SAP SE or its affiliated companies have no obligation to pursue any course of business outlined in this document or any related presentation, or to develop or release any functionality
mentioned therein. This document, or any related presentation, and SAP SE’s or its affiliated companies’ strategy and possible future developments, products, and/or platform directions and functionality are
all subject to change and may be changed by SAP SE or its affiliated companies at any time for any reason without notice. The information in this document is not a commitment, promise, or legal obligation
to deliver any material, code, or functionality. All forward-looking statements are subject to various risks and uncertainties that could cause actual results to differ materially from expectations. Readers are
cautioned not to place undue reliance on these forward-looking statements, and they should not be relied upon in making purchasing decisions.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other
countries. All other product and service names mentioned are the trademarks of their respective companies. See www.sap.com/copyright for additional trademark information and notices.

You might also like