Skip to Content

Background

Within my organization, within our homegrown loyalty system, we maintain both live card holders and test card holders. The latter is used for testing offers before they are rolled out to the larger audience. These two types of card holders are maintained in separate databases within our landscape. The addition and subtraction of test card holders is completely contained within that organization.

Moving forward, we will be accepting an offer activation through our SAP PI system. This means that we will have to segregate the live card holders from the test card holders. Given that the number of test card holders is very small, and we did not want to do a database look up each message, we decided to use a value mapping. This raised the question of how to keep our SAP PI system in sync with our test loyalty system.

We currently use SAP Data Services for our batch jobs. Therefore I decided to look for a solution that would integrate our Data Services system with our SAP PI system. Given that it is web-service based, this solution could be adapted to fit whatever tools are in use at your organization.

Value Mappings

Within SAP PI, value mappings are maintained within the Integration Builder or via the Process Integration Run-time in NWDS. Value mappings combine two scheme agency id’s and scheme id’s to create a unique relationship. Behind the scenes, SAP PI assigns a guid called a value mapping id. When updating or deleting a value mapping, the value mapping is required. Also, consistent with all changes within SAP PI, value mappings must be activated from a change list.

In order to create a value mapping, launch the integration builder and choose value mapping from the Tools menu.

/wp-content/uploads/2014/12/value_mapping_menu_614144.png

Then specify the scheme agency id and scheme id for both the source and target. You will use these values both from within the SAP PI mapping and within Data Services.

/wp-content/uploads/2014/12/select_agency_and_schema_614145.png

Then you can maintain the values that correspond for each agency.

/wp-content/uploads/2014/12/value_mapping_view_614146.png

When you are done, you can save and activate your change list.

Automation Approach

In order to automate this process we will use built-in web services provided by SAP PI. You can find the services within your SAP PI system by going into NetWeaver Administrator and choosing the SOA profile.

From there, navigate to Single Service Administration

soa single service.png

Then you go just click go to open all of the services currently available. For this specific scenario, we will use the services associated with changes lists and value mapping as shown below.

Change Lists

change list wsdl.png

Value Mapping

Value mapping wsdl.png

Automation Approach

First, we will use the Query operation on the value mappings to read the value mapping id’s that meet our requirement (e.g. group). Then, using these value mapping id’s, use the read operation to read the actual mapping values. We will store these for later comparison when creating, updating, and deleting entries.

Next, we will read from our data source within Data Services to stage the value mappings to be migrated to SAP PI.

Then we will create a change list, via the create operation of the change list service. Using this change list and the staged data, we will compare the staged data to the values read from SAP PI to generate change, create, and delete messages via the change, create, and delete value mapping operations, respectively.

If these are successful, we will activate the change list via the activate operation, or, in the event of an error, revert the change list via the revert operation.

What’s in Store For Next Time

In part 2, we will explore the setup and integration with Data Services.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply