Guideline for setting up exchange rates within SAP

Estimated read time 7 min read

In our globalized world, accurate and regular synchronization of exchange rates is a crucial factor for business success. That’s why we created a guideline to simplify the setup of exchange rates using IDocs within SAP — in both production and test systems. 💻

❗Important Notes

To ensure the guideline is applicable, make sure the following prerequisites are met before you start:

Both systems are configured as logical systems within the ALE environment.

Communication links (RFC connections) between the source and target systems are established and tested.

The source system has authorizations for transactions BD64, WE20 and OB08; the target system has permissions for WE57, BD50, BD52 and WE20.

Configuration in the Source System

1. Create a distribution model (Tcode BD64)
– Switch to edit mode.
– Select an existing model or create a new one via Create Model.

2. Register the BAPI in the model
– Highlight the node and go to Edit → Add BAPI.
– Enter ExchangeRate as Object/Interface and SaveReplica as Method.

From the Guide

3. Adjust outbound partner profile
– Go to Environment → Change Partner Profile (Tcode WE20).
– Partner Type LS: Select the target system.
– Under Outbound Parameters, create an entry:

Message Type: EXCHANGE_RATE

Basic Type: EXCHANGE_RATE01

📝Note: IDocs can be sent immediately or once a defined package size is reached. In our case, we set the size to 1 so IDocs are sent immediately.

4. Configure the outbound parameter
– Under Exchange Rate, finalize the configuration as needed.

Changes were made in the configuration of the output parameter ‘Exchange Rate’

5. Deploy the distribution model
– Return to BD64, select Edit → Model View → Distribute.
– Highlight the recipient and start distribution.
– A successful distribution will be visible in the log; the IDoc model is now active.

Additional Configuration

– Activate change indicators for message type EXCHANGE_RATE using Tcode BD50.

Configuration in the Target System

1. IDoc FM Mapping (Tcode WE57)
– In Cross-Client settings, create the mapping:

Message Type: EXCHANGE_RATE

IDoc Type: EXCHANGE_RATE01

Function Module: BAPI_EXCHANGERATE_SAVEREPLICA
– In our case, an existing FM BAPI_IDOC_INPUT1 was already in place.

2. Adjust inbound parameter (Tcode WE20)
– Partner Type LS, Partner Number = Source system.
– Under Inbound Parameters, create an entry:

Message Type: EXCHANGE_RATE

Process Code: BAPI

✅After saving, the target system is ready to receive exchange rate IDocs.

Test Run

1. Change exchange rates in the source system
– Use transaction OB08 to modify a value for testing purposes.

With the modification in transaction OB08

2. Trigger IDoc creation
– Run report RFALEX00 in the source system (via SE38) to generate and send IDocs.

Don’t forget to specify your target system!

Don’t forget to specify your target system!

3. Check log messages
– Ensure success confirmations are displayed in the log

4. Verify results in the target system
– Open OB08 or review relevant currency tables to confirm receipt and application of new rates.

Monitoring and Troubleshooting

Use BD87 for reprocessing inbound IDocs.

Check IDoc status and segments with WE02 / WE05.

Errors? Use BD87 to reprocess failed IDocs

From the Guide

Automation via Background Job

To automate the execution of RFALEX00:

1. Create job (Tcode SM36)
– Name: Z_EXCH_RATE_SYNC (or follow internal naming convention)
– Job Class: e.g., C

2. Define job step
– Step Type: ABAP Program
– Program: RFALEX00
– Variant: set via SE38

3. Set job schedule
– Go to Start Condition tab.
– Define interval (e.g., monthly at 06:00).

Here the job is executed at the beginning of earch month

4. Release job
– Save and activate.

5. Monitor job execution (Tcode SM37)
– Check logs to confirm successful job runs and IDoc transmission.

Reference: Original Guide „Exchange Rate Sync using IDoc“, SAP Community

https://community.sap.com/t5/technology-blogs-by-sap/exchange-rate-sync-using-idoc/ba-p/13385134

Find a shorter Version of this Guideline on LinkedIn: https://www.linkedin.com/feed/update/urn:li:activity:7328297016768307201

 

 

 

​ In our globalized world, accurate and regular synchronization of exchange rates is a crucial factor for business success. That’s why we created a guideline to simplify the setup of exchange rates using IDocs within SAP — in both production and test systems. 💻❗Important NotesTo ensure the guideline is applicable, make sure the following prerequisites are met before you start:Both systems are configured as logical systems within the ALE environment.Communication links (RFC connections) between the source and target systems are established and tested.The source system has authorizations for transactions BD64, WE20 and OB08; the target system has permissions for WE57, BD50, BD52 and WE20.Configuration in the Source System1. Create a distribution model (Tcode BD64)– Switch to edit mode.– Select an existing model or create a new one via Create Model.2. Register the BAPI in the model– Highlight the node and go to Edit → Add BAPI.– Enter ExchangeRate as Object/Interface and SaveReplica as Method.From the Guide3. Adjust outbound partner profile– Go to Environment → Change Partner Profile (Tcode WE20).– Partner Type LS: Select the target system.– Under Outbound Parameters, create an entry:Message Type: EXCHANGE_RATEBasic Type: EXCHANGE_RATE01📝Note: IDocs can be sent immediately or once a defined package size is reached. In our case, we set the size to 1 so IDocs are sent immediately.4. Configure the outbound parameter– Under Exchange Rate, finalize the configuration as needed.Changes were made in the configuration of the output parameter ‘Exchange Rate’5. Deploy the distribution model– Return to BD64, select Edit → Model View → Distribute.– Highlight the recipient and start distribution.– A successful distribution will be visible in the log; the IDoc model is now active.Additional Configuration– Activate change indicators for message type EXCHANGE_RATE using Tcode BD50.Configuration in the Target System1. IDoc FM Mapping (Tcode WE57)– In Cross-Client settings, create the mapping:Message Type: EXCHANGE_RATEIDoc Type: EXCHANGE_RATE01Function Module: BAPI_EXCHANGERATE_SAVEREPLICA– In our case, an existing FM BAPI_IDOC_INPUT1 was already in place.2. Adjust inbound parameter (Tcode WE20)– Partner Type LS, Partner Number = Source system.– Under Inbound Parameters, create an entry:Message Type: EXCHANGE_RATEProcess Code: BAPI✅After saving, the target system is ready to receive exchange rate IDocs.Test Run1. Change exchange rates in the source system– Use transaction OB08 to modify a value for testing purposes.With the modification in transaction OB082. Trigger IDoc creation– Run report RFALEX00 in the source system (via SE38) to generate and send IDocs.Don’t forget to specify your target system!Don’t forget to specify your target system!3. Check log messages– Ensure success confirmations are displayed in the log4. Verify results in the target system– Open OB08 or review relevant currency tables to confirm receipt and application of new rates.Monitoring and TroubleshootingUse BD87 for reprocessing inbound IDocs.Check IDoc status and segments with WE02 / WE05.Errors? Use BD87 to reprocess failed IDocsFrom the GuideAutomation via Background JobTo automate the execution of RFALEX00:1. Create job (Tcode SM36)– Name: Z_EXCH_RATE_SYNC (or follow internal naming convention)– Job Class: e.g., C2. Define job step– Step Type: ABAP Program– Program: RFALEX00– Variant: set via SE383. Set job schedule– Go to Start Condition tab.– Define interval (e.g., monthly at 06:00).Here the job is executed at the beginning of earch month4. Release job– Save and activate.5. Monitor job execution (Tcode SM37)– Check logs to confirm successful job runs and IDoc transmission.Reference: Original Guide „Exchange Rate Sync using IDoc“, SAP Communityhttps://community.sap.com/t5/technology-blogs-by-sap/exchange-rate-sync-using-idoc/ba-p/13385134Find a shorter Version of this Guideline on LinkedIn: https://www.linkedin.com/feed/update/urn:li:activity:7328297016768307201     Read More Technology Blog Posts by Members articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author