cancel
Showing results for 
Search instead for 
Did you mean: 

Help with UDF code ...

Former Member
0 Kudos

I got the below code. It returns the FileName from File sender adapter. Works fine when running the complete scenario, but when running it from the mapping test utility it FAILS. Obviously because there is no filename since I am testing in my mapping but how to code it so I can run it during my testing of the graphical mapping?

-


UDF ->

String tomstreng = ingenting[0];

//write your code here

DynamicConfiguration attrib =

(DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

//to create key

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

String navnpaafil = attrib.get(fileKey);

if (navnpaafil |= null)

{

result.addValue(navnpaafil);

}

result.addValue("");

Accepted Solutions (1)

Accepted Solutions (1)

sunilchandra007
Active Contributor
0 Kudos

You can't test it independently in test tab. Need to run the full scenario for testing the mapping.

Regards,

Sunil Chandra

Shabarish_Nair
Active Contributor
0 Kudos

>

> You can't test it independently in test tab. Need to run the full scenario for testing the mapping.

>

> Regards,

> Sunil Chandra

you can always use a try catch to handle the code and thus help test it independently - refer my blog

Answers (1)

Answers (1)

Shabarish_Nair
Active Contributor
0 Kudos

/people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name

do refer the code in this blog to help you.

Former Member
0 Kudos

Thx