on 10-17-2008 12:30 PM
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.
Hi
Function type Void is not going to return value. It has be String type to return value. Check the function again
Also this documents provides good info on mapping in PI 7.1
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi !
Just an idea...store the filename and directory name values in a global container (of the whole mapping program) and then create another UDF whose main purpose is read that global container and return its value.
Regards,
Matias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.