Skip to Content
Technical Articles
Author's profile photo Gautham Krishna

Message Mapping Simulation in SAP Cloud Platform Integration

What is Message Mapping

SAP Cloud Platform Integration provides message mapping, where you can map fields between two messages  . Message mapping is one of the widely used message transformation steps in an integration flow.  Here’s how the message mapping step looks like in the WebUI:

Message mapping gives you an output payload corresponding to the mapping that is done and the input payload that is provided. If the developer needs to get the output payload from the mapping, then he has to deploy the existing integration flow and check the output. To perform an end-to-end validation of an iFlow, the only way is to deploy the iFlow and get the result. For that, the iFlow must be completely modeled.  Since mapping takes a long time, an instant test feature will make it easier for you to test the mapping.

Why Simulate in Message Mapping

As mentioned earlier, modeling an entire integration flow & deploying it to test mapping is a time consuming task. Mostly modelling the mapping consumes more time and message mapping cannot be tested alone. Therefore, there is a need to have a test environment which will give the instant result of the mapping.

Since mapping is a complicated step, it is good if the mapping is tested before the iFlow is deployed. If a mistake occurs in the mapping step of a big integration flow, the deployment will fail. The developer will be unsure of the reason for this failure & he has to check all the steps in the integration flow, which is very time consuming. Verification of the mapping step before iFlow deployment will completely negate the factor of the iFlow failing due to mapping step. By providing a Simulate option, we have reduced the possibility of an integration flow deployment failure due to mapping errors. The Simulate action will simulate the execution the mapping and gives developer the output payload instantly.

How to Use Simulate

Here’s how the simulate page looks like in the WebUI:

If you are in edit mode in message mapping page, you will get to see the Simulate button on top of the mapping page. Simulation of mapping will create a virtual bundle, execute your mapping, and give back your output. On clicking the Upload Input button, you will be provided with the option to upload your input payload.

As shown in the above figure, the input table is at the left and the output table is at the right side. You can only upload XML payloads as input. Once the payload is uploaded, then it is populated in the input table. Now you can test the input payload against your mapping. Once you select the “Test” button, your mapping is simulated and you will get an output.

Once the execution is completed, the output table is populated with the test result. You have the option to download the output as well. You can repeat the same steps with different payloads also.

If you want to edit the input payload values, you need not upload the edited input file again. You can directly edit the input payload in the mapping simulator. You just need to click on the input values in the simulate dialog and enter your values there.

What are the Common Mistakes while Simulating Message Mapping

Here’s one of the commonly seen errors:

This error is thrown because the input payload has some missing entities while the target message expects a value.

By using the Simulate option, you can save a lot of time in by avoiding mapping errors. This would go a long way in helping you become more productive, especially if you are an extensive user of the mapping feature.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Apu Das
      Apu Das

      Hi Gautham,

      Thanks for sharing this.

      But, still lots more to do by SAP. It's not even provide same kind of flexibility as we get in PI/PO message mapping.

      Thanks,

      Apu

      Author's profile photo Former Member
      Former Member

       

      Hi Gautham,

      Thanks for the blog. I am stuck at this since last couple of days with the same error you have shown. Please check the question I posted on the same and suggest how can I proceed.

      https://answers.sap.com/questions/303703/how-to-convert-iot-data-via-odata-into-an-idoc-in.html

      Regards

      Amitabh

      Author's profile photo SAKRIYANAIK NK
      SAKRIYANAIK NK

      Hi Gautham,

      Thank you for your blog- very nice. i am facing very strange issue in CPI mapping simulator – error occured during testing – but in trace mapping step is executed successfully without any errors. can you please check attached screenshot and advise?

       

       

      Best Regards,

      Krushi.

      Author's profile photo Deepak Govardhanrao Deshpande
      Deepak Govardhanrao Deshpande

      Hi Krushi,

      Can you try testing with Display Queue option at the different function/operation level? At least you will be able to narrow down to the step where the error occurs and further check the input data payload at that step?

       

      Thanks

      Deepak

      Author's profile photo SAKRIYANAIK NK
      SAKRIYANAIK NK

      Hi Deepak,

       

      we have verified with different data payloads loading by XML files in mapping simulator but still it throws the same error. Error occurred during testing.

       

      Best Regards,

      Krushi.

      Author's profile photo Gautham Krishna
      Gautham Krishna
      Blog Post Author

      Hi Krushi,

      It looks like your issue needs to be investigated in detail. Can you please raise a ticket under the component mentioned here? Our team will look into it & get back to you.

      Thanks & Best Regards, Gautham

      Author's profile photo Rolf Hoven
      Rolf Hoven

      I'm able to load "Test Input File", and I can see data on the screen.

      When I press "Test" button, no errors occurs, but "Test Output" structure is blank.

      Any idea ?

      Regards Rolf