cancel
Showing results for 
Search instead for 
Did you mean: 

Global Funtion Library map element in synchronous request MM to response

Former Member
0 Kudos

I have an element in my rfc import that I am sending from PI to SAP ECC.

I need to put that element in my target structure in the response. The RFC structure response does not contain this element.

I built a function to set this element in the function library when I import the element. I built a getter to return that string from the function library. I am using the setter in the message map on the import.

I am using the getter on the response to populate this element in the target.

For some reason the String variable in the function is null when I try to get it.

The string is defined in the Attributes section of the library.

The setter is working and it is saving the element in my variable. My import is working.

In my get function I test for the null value of my string and return "Missing" instead to the value I need.

This is SAP PI 7.1 EHP1.

Is this the right way to use the global function library?

Does anyone know why the value is not preserved for use in my response mapping?

Is there a different way to pass variables from the the request to the response?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The global memory is only persisted per message mapping. That means, if you populate some variable in the global memory in a message mapping, it wil only persist for that instance of the map. when the message mapping is completed, the global memory is refreshed. Since the resqust and response message mappings are 2 seperate mappings, you will not have a common global memory between them. Each mapping will have its seperate global variables.

The only way to pass a variable from request to response would be to return it in the RFC structure.

Also, a function library acts as a repository of UDFs. So, if you need a similar UDF for two seperate message mappings, you can write this UDF in a function library, thus eliminating the need to write the UDF seperately in each map.

You can not pass data from one mapping to another using function library.

Regards