← Blog

Migrating SAP PI message mappings with function libraries

How to migrate SAP PI message mappings that use function libraries to Cloud Integration, with SAP’s new function library object or Groovy, using Figaf.

July 19, 2023 · 3 min read

Message Mapping from your SAP PI/PO system represents great value. The more mappings migrated, the better because it will save time. In many mappings, you have Function Libraries (FL) which have been complicating the migration to Cloud Integration.

Sometimes you should redesign the integration entirely because leveraging the new platform will be a better approach.

SAP has, in July 2023 released a new object, Function Libraries, where you can import the Function Libraries into Cloud Integration. Currently, you can only use it manually in the Message Mapping you create in Cloud Integration. Check SAP’s documentation for how its migration tool handles function libraries today.

Watch on YouTube SAP PI to Cloud Integration Function Library in Messsage Mappings

Import the function library

The Function Library object in Cloud Integration can contain many FL that are imported. You can have the same FL in multiple FL objects. It would help if you considered how your naming conversion for it.

My idea is to create a package for all your FLs and then create an FL object with just one FL for each PI object.

Here is my sample FL

The original function library OrderFunctions26 in the SAP PI Enterprise Services Repository
The Original FL
The imported function library OrderFunctions26 in SAP Integration Suite, with its Java source
The imported FL module where name of Object and Library is the same

Some limitations with the current FL

It seems the Function Library import has some limitations. The ones we currently know about are

  • Parameters
  • All value of a queue
  • Function without any input

If a Function Library has one of the above, then the import will not work.

Migration of mappings

With the Figaf tool, we select an ICO that we want to migrate. Then we define we want to use FL for the mapping. We also support Groovy functions, where we have written our own conversion to avoid some limitations. But Groovy also has some challenges, so it is good to have two options.

Figaf PI to CPI migration of an ICO, with the CPI agent, package, iFlow name and profile type
In Figaf, selecting the Iflow and package where the migration should be migrated to.
Cloud Integration resources for the migration, with the option Use migrated CPI function library for the function library
Here we select the resource to switch between Groovy(Shared artifact) or the CPI function Lib. Default it to use our Groovy functions but it may change later. If you change the structure of an existing mapping you need to overwrite the mapping and not reuse the existing.
The migrated iFlow in SAP Cloud Integration, with the mapping in a local process
Once you hit migrate, you will be able to open the iflow with all the mapped artifacts.
A message mapping in Cloud Integration using the migrated function withLine
In the message mapping, you can then see the migrated artifacts. If you click the code to it you will open the FL in a new tab.

Experiences

I have tried with a somewhat complicated function it seems like it tackles Global Container pretty well.

You should of cause be testing the functionality which can be easily done with the Figaf tool. I would expect that there will be places where you can find a difference and it is better to be able to test this early and then consider if you need a different approach.

Figaf test results comparing the expected and actual IDoc, where only a timestamp differs
Here we see the test result a lot of the functions originate the the FL in different ways. The time difference can easily be ignored with two clicks.

Try it out

Function library support is now part of the Figaf Migration Tool. Sign up for the free Migration Edition, and you will get 10 migrations for free, so you can test the functionality with both Groovy functions and function libraries.

We have added transports of the new FL objects which is crucial for the migration aspect.

This post covers these products

Capabilities covered

More from the blog

All posts →

See this working in your landscape

No credit card required.

Integration cost calculator →

Start your free trial

No credit card required

Try Figaf DevOps Suite free for 30 days. It takes less than an hour to get started, and we send everything you need by email.

Join our newsletter

Get the latest about Figaf, SAP and anything relevant to SAP integration, every week in Figaf Weekly.