cancel
Showing results for 
Search instead for 
Did you mean: 

PI71 RFC lookup function cannot be cached in UDF

DG
Active Contributor
0 Kudos

Hi,

I have created an RFC lookup which retrieves the content of a table in the SAP ERP backend. The RFC returns a table of conversion values. I would like to save thise key/values so I can use the keys to convert the to the values, in later mapping steps.

The RFC works and I get a list of all the values that I need for my translation.

I have created a screenshot of the queues and the Java user defined function.

[Screenshot|http://screencast.com/t/ZTI5NTVjMDU]

It is weird that the Java function only can see the first line in the key array, when there is suppose to be many. Have anybody experienced this and know how to solve the problem.

It just seems to be a problem when I had the RFC function.

I'm using PI 7.11.

Accepted Solutions (0)

Answers (2)

Answers (2)

mdingle
Explorer
0 Kudos

Although this thread is marked as answered, I thought it was appropriate to add an improvement on the solution that was mentioned in the thread.

Colleagues of mine hit this same problem. They solved it by processing the output of the RFC call, before passing it into the UDF which was intended to cache the data.

To accomplish this, they created a separate "fixing" UDF which was placed between the RFC and caching UDF. The sole action of this "fixing" is to read in a queue and write it directly out to the ResultList.

For whatever reason, this has the effect of presenting a queue to the caching UDF which the UDF is able to successfully process.


	public void fixList(String[] input, ResultList result, Container container) throws StreamTransformationException {
		for (int i = 0; i < input.length; i++) {
			result.addValue(input<i>);
		}
	}

Former Member
0 Kudos

Hi Daniel,

Maybe it has sthg to do with the scope of the UDF ? What did you choose (queue ? context ? etc) ?

Rgds

Chris

DG
Active Contributor
0 Kudos

I have tried all settings for the UDF with the same luck.

Former Member
0 Kudos

strange ! Have you tried using PI built-in value mapping features ... I know it is possible to retrieve values from a backend, but it may require more effort to implement it !

According to your screenshot, UDF seems only to take 1st and last occurence of the input key/value pairs !

Chris

Edited by: Christophe PFERTZEL on Feb 17, 2010 11:19 AM

DG
Active Contributor
0 Kudos

I'm using the build in RFC lookup functions of the PI system, and that is when my queues turn wierd.

I have now converted to a name value string from the RFC. Not the ideal solution, but it seems to work.

Daniel Graversen

[Figaf|http://piarchitecture.com]

Edited by: Daniel Graversen on Feb 17, 2010 12:17 PM

DG
Active Contributor
0 Kudos

I changed the RFC to deliver a comaseperated list in a text field. Then I could cache those values. Not an optimal solution.

Later this was changed to an PI Valuemapping, because the values did not change a lot.