Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

With the PI 7.31 release, the Eclipse tooling also became available.  In NWDS, we can now design and develop artifacts in the ESR by using the Eclipse tool.  Even though the Java Swing tool will continue to be available, the direction for SAP is toward the Eclipse tools.  This is not just for PI, but also for ABAP development.

One of the artifacts in the ESR is the Message Mapping, and the ability to test the mapping easily.  In NWDS, the mapping tool is also GUI driven, with drag-n-drop and point-n-click. With PI 7.31 SP4, the Eclipse tool is based on XPath expression.  With PI 7.31 SP6, a GUI mapping tool, similar to Message Mapping, will also be available in NWDS.  Disregard to the type of mapping tool, we are still interested in the ability to test the mapping easily.  In this blog, I will show how we can test the Message Mapping in NWDS, whether it is based on XPath or the GUI mapping tool.

This blog assumes that you are already familiar using NWDS to work with the ESR.  If not, please reference the blog: Eclipse Tool for ESR in NW PI

Unlike the Swing tool in the ESR, where a "Test" tab is available to test the mapping, the NWDS tool requires a different process.  Although, initially, we may consider this process to be more cumbersome, but it is really not bad to use.  There are a couple of steps involved:

  1. Create a file containing the source XML document.
  2. Create a configuration, which consists of the Message Mapping program and the test file in #1.

With these 2 steps, we can run the test and a resulting XML will be created.  During testing, we can re-use the file created in #1 and the configuration created in #2.

To show the steps for mapping test in NWDS, I have already created a simple Message Mapping.  Basically, this mapping calculates the total amount based on the units purchased and the cost for each unit.  There can be 1 or more "order_items".

Steps in NWDS to test Message Mapping:

  1. Create the source XML:
    1. Right-click on the Message Mapping:  Select "Generate" --> "XML File..."
    2. Select a project and provide a name for the source XML file:

      If no project shows up or you want to use a new project, you can go to the main/top menu and create a general project.
    3. Enter the data for the source in the new tab:  (example below)

      Save the file.
  2. Create the mapping configuration:
    1. Right-click on the Message Mapping:  Select "Run As" --> "Run Configuration..."
    2. Right-click on ESR Message Mapping:  select "New" or an existing configuration if one exists
    3. Enter the configuration:
      1. Enter a configuration name
      2. Select the Message Mapping by clicking on "Browse..."
      3. Select the test source file from the project created in step #1, by clicking on "Workspace..."
      4. Click on "Apply" to save the configuration
  3. Test the mapping by clicking: "Run"
    A new tab will be created with the mapping test result.

As you can see, this is not bad at all.

I found that by creating a new project to organize all my mapping tests makes testing quite convenient, especially when I have to re-test my mapping programs.

13 Comments