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_member36535
Associate
Associate

Introduction


SAP Cloud Integration version 6.40.**, one of the capabilities of SAP Integration Suite, comes with a feature enhancement to import SAP PI/PO Function Library, also referred in some context of UDFs (user defined functions). If you have Function Libraries in your PI/PO Enterprise Service Repository (ESR), you can connect and import them into your SAP Cloud Integration tenant.

This feature is available only in SAP Integration Suite standard and above service plans.

SAP Cloud Integration version 6.40. ** software update is planned on start/mid of Jun 2023  (date and time subjected to change).

Function Library


Function libraries are objects where mapping user can create/use user defined functions (UDF) in SAP PI/PO, ESR system. This blog will not cover the details of Function Libraries as topic. It only covers its import feature in Cloud Integration. There are many SAP Blog Posts and documentation (e.g. https://help.sap.com/doc/saphelp_nw73ehp1/7.31.19/en-US/4b/fb45f766d33de4e10000000a42189e/frameset.h... ) on Function libraries, you can refer them for more information.

ESR System Configuration


Objects import from ESR into Cloud Integration tenant is not a new topic. This support has been enabled in the past for, e.g., PI/PO Message Mappings from ESR system. If you are aware of this, then it all starts with configuration of your ESR system details in Cloud Integration Settings page. If you are not aware about this, you can check Cloud Integration documentation at https://help.sap.com/docs/integration-suite/sap-integration-suite/configuring-connectivity-to-es-rep... link on ESR configuration in your Cloud Integration tenant.

Importing Function Library


In SAP Cloud Integration, you first create a Function Libraries artifact, as below.


 


Function Libraries artifact gets created.


Click on the row to open the editor


In the editor click on Edit and Upload, this shall open up the ES Repository connection dialog.



Click on Connect, once the connection is successful, you will see set of function libraries available in that ESR system.



 

Filter the function library of your choice in the filter field, select the row, click on Select button. This will import selected function library


Once it gets imported in the Resources tab, click on it, function library code editor will be opened, as shown in the screenshot below.



 

Observe the auto generated comment, which state that key property not to be tempered. And also, all the custom methods/user defined functions are listed.

From the imported function library, the method (udf) tailString will be taken as example for assignment and usage in the Cloud Integration Message Mapping artifact.



Using Function Library in Message Mapping


Once the function library is imported, you can consume this in message mapping. For this, open any existing message mapping or create a new message mapping in Cloud Integration.

In the Resources section, References tab, select the function library artifact - in which you have imported function library- and refer it.




Clicking on Function Libraries, it will list the function libraries artifacts of the current integration package, as shown below


Select the artifact, and click on OK.


You will see the function libraries artifact appearing in the References section.


Now, select the mapping definition line, which opens up the expression editor in the bottom section of canvas of message mapping editor, click on Assign icon/button as shown below.


Click on the Referenced Resources tab, and select the UDF/Function library as shown in below screenshot and click on OK button


Once you assign, the UDF will start appearing in Custom Functions list of expression editor as shown below.



 

As you observed above, the tailString function is available. You can click/drag-and-drop in expression editor to use it.


 

Since the function is available in the expression editor, you can use that function/UDF, and message mapping story continues from here ( I am not going to explain the rest of the story, because information on how to create/use message mapping in Cloud Integration is already covered as part of other blogs).

Finally, you can refer this message mapping in integration flow. Deploy Function Libraries artifact, Message mapping artifact and Integration flow and trigger the message as per your integration scenario.

Next steps


We plan to address the below limitations in upcoming releases.

  1. Limitations - Currently there are some limitations on importing of function library from PI

    1. Methods having executionType value 'ALL_VALUES_OF_QUEUE', having 'paramCategory' value as 'Parameter' will not be supported.

    2. argument other than GlobalContianer will not be supported for init and cleanUp method

    3. Category and Title combination for a function library method should be unique in a function library class

    4. Function library with referene to imported archives are not supported.



  2. Importing of PI/PI Message Mapping along with referenced Function Library in one-go : Currently, there is no support for importing message mapping along with referenced function library together at one-go from PI/PO.


 

Summary


SAP Cloud Integration - with version 6.40.** release - opens up the opportunities for you to bring your PI/PO re-usable function library objects into Cloud Integration and enrich your integration scenarios 🙂 .

 
14 Comments