Financial Management Blogs by Members
Dive into a treasure trove of SAP financial management wisdom shared by a vibrant community of bloggers. Submit a blog post of your own to share knowledge.
cancel
Showing results for 
Search instead for 
Did you mean: 
alrikx
Participant
1,684

Problem

In the finance area a lot of market data like currency exchange rates, interest rates or spreads are needed in SAP to keep the finance processes running smooth. As these market data is volatile, it needs to be updated with high frequency in SAP Finance, e.g. daily.

These data is provided by suppliers like Refinitiv, Oanda or even the European Central Bank. 

In the on-premise version of SAP S/4HANA or in Business Suite we saw a lot of custom reports running as application jobs using BAPIs or FMs to update the market data in the system with data provided by suppliers. 

If you want to or must stick to ABAP Cloud, these artifacts are not available to you and there are no Push APIs available. 

Solution

There are three ways in S/4HANA Cloud explained in here: How to Maintain Exchange Rates in SAP S/4HANA Clou... - SAP Community, two are manual which is not efficient in most cases due to the high frequency the updates needed to be done. The third option is a fully automated option, we'll share here now:

Architecture

Architecture.png

Building blocks are:

Setup

1.Service Market Rates Management (MRM) on BTP

First you must decide on a Market Rates Service data option.

Then go to your BTP and create a service instance and a service key as descript in here Getting started with SAP Market Rates Management - SAP Community

The result looks something like this:

alrikx_1-1721901924924.png

The service key has all relevant information like URLs and secrets.

2.Testing MRM Service with Postman

Go to SAP Market Rates Management, Bring Your Own Rates data option | SAP Help Portal and download the postman collection if you use BYOR, in case of Refinitiv go to SAP Market Rates Management, Refinitiv data option | SAP Help Portal.

alrikx_2-1721907380986.png

in Postman you fill the url, clientsecret, clientid, uploadUrl and downloadUrl variables with the values from your service key. The service key looks like this:

 

{
  "LPSCallbackDependencyName": "...",
  "downloadUrl": "https://....cfapps.eu10.hana.ondemand.com/downloadMarketData",
  "saasregistryappname": "...",
  "saasregistryenabled": ...,
  "uploadUrl": "https://....cfapps.eu10.hana.ondemand.com/uploadMarketData",
  "uaa": {
    "tenantmode": "dedicated",
    "sburl": "https://internal-xsuaa.authentication.eu10.hana.ondemand.com",
    "subaccountid": "...",
    "credential-type": "...",
    "clientid": "...",
    "xsappname": "...",
    "clientsecret": "...",
    "serviceInstanceId": "...",
    "url": "https://....authentication.eu10.hana.ondemand.com",
    "uaadomain": "authentication.eu10.hana.ondemand.com",
    "verificationkey": "...",
    "apiurl": "https://api.authentication.eu10.hana.ondemand.com",
    "identityzone": "...",
    "identityzoneid": "...",
    "tenantid": "...",
    "zoneid": "."
  }
}

 

 

alrikx_4-1721907558225.png

Then you use the first call from the collection to generate a JWT. The response is put in variable generated_access_token. The key expires after some time, in this case generate a new one.

alrikx_0-1721908355638.png

Now you can use the other calls in the collection to upload and download market rates.

3.Automatic Data Provisioning to MRM Service

In case you are using Refinitiv option, you can skip this section the data is automatically provided to your instance.

You case use any middleware, e.g. Cloud Integration to provide data from your own data provider into the MRM service with the calls you see in the postman collection at your own schedule.

4.SAP S/4HANA CBC Portal

In CBC tenant add Item 1S4 to your scope and deploy it to your S/4HANA Cloud tenant.

5.SAP S/4HANA Cloud (focus on currency exchange rates)

App Maintain business roles + Maintain Business Users

Create a copy of SAP_BR_TREASURY_SPECIALIST_BOE and assign the role to your user.

App Communication Systems

Create a communication system that represents the MRM service instance.

fill in a meaningful system id and name and provide the url from the service key.

alrikx_3-1721920624769.png

In the communication system create a user for outbound communication, put the clientid from service key in and use the clientsecret as password.

alrikx_4-1721921107134.png

Make sure you hit save and not leaving it in draft.

App "Communication Arrangements"

create a new communication arrangement (CA) based on scenario SAP_COM_0203, give it a meaningful name and select the communication system from the previous step.

alrikx_0-1721912121207.png

Some fields get filled correctly and automatically. Fill property universal resource indicator with the downloadUrl from the service key. In the end save your CA, it will look like:

alrikx_6-1721921926379.png

now, you can check the connection (section outbound service), you should get:

alrikx_7-1721922030750.png

App Assign Currency Notations - Data Feed

select data provider Y001 and create the pairs of currencies you need, here an example:

alrikx_8-1721922287773.png

make sure that:

-"marketDataProperty" (json) matches "property" (screen) 

-"marketDataSource" (json) matches "Data source" (screen)
 
App Request Current Market Data - Datafeed
This way you can download the Market data manually:
alrikx_9-1721922855537.png

a successful execution looks like this:

alrikx_10-1721922921445.png

App Currency Exchange Rates

You can see the new values here.

alrikx_11-1721923013716.png

6.Automation of Synchronization 

Go to App "Application Jobs" in your S/4HANA tenant.

alrikx_0-1721912524716.png

hit "Create" and select template "Request Current Market Data" 

alrikx_1-1721912596519.png

In step two you select the schedule, e.g. daily at 5 AM.

and in step three you have the options from App "Request current market data", fill it and schedule.

alrikx_2-1721912710456.png

You can check the result in the Job log and in app Currency Exchange Rates.

Conclusion and further remarks

  • There are multiple ways to update market data in SAP, but only one option for automation, there you need one of the mentioned BTP-services.
  • You can use the BTP service for on-premise systems too.
  • Make sure to batch requests where possible for upload and download, as there is a limit of 6000 requests/month in BYOR data option and the REVINITIV is paid per request block right now.

If you like this post or it helped you, don't hesitate to give kudos.

1 Comment
JoergAldinger
Active Contributor
0 Kudos

I just went through this whole process yesterday without having seen this blog. If I only had found this a little sooner, my life would have been a lot easier!

Good job on getting everything together! The only thing you didn't mention that I stumbled over is the fact that the BYOR BTP service is currently only offered in the AWS - Europe (Frankfurt) region. So make sure to create a subaccount in that region if you want this service. For us in the Americas this is usually not the first choice...

Keep up the good work!