Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Function library in PI 7.1 - retrieval of filename

Hi,

I am trying to use the function library functionality in PI 7.1 but struggling a bit.

Basically, I want a function for the retrieval of the filename - pretty easy in goold old UDF days but not so easy now everything has moved to the function library world in PI 7.1

I have defined the following code in the "init" Function and Java Areas:

DynamicConfiguration conf = (DynamicConfiguration) container.getParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

//For getting filename

DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

//For getting directory

DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");

// Retrieve the filename

String FileName = conf.get(key1);

// Retrieve the directory

String Directory = conf.get(key2);

This is working ok - but I want to return these values so they can be used in mapping.

when I try to add the statement return FileName; , the compiler then complains with the following error:

cannot return a value from method whose result type is void return FileName;

But where do you define the result type for a method ????? I guess it has something to do with the signature variables but I am a bit lost.

Any help greatly appreciated.

Thanks

Colin.

Not what you were looking for? View more on this topic or Ask a question