cancel
Showing results for 
Search instead for 
Did you mean: 

Erron while using DynamicConfiguration in UDF

Former Member
0 Kudos

Hi All,

I have create an UDF ,which imports com.sap.aii.mapping.api.*; package adn performs the following:

/* UDF */

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

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

String AgiFileName ="MSIPl_"+ paddedAgi+".dat";

conf.put(key, AgiFileName);

AbstractTrace trace = container.getTrace();

trace.addDebugMessage("FileName"+AgiFileName);

/End of UDF/

I am getting the following error,during run time .Plz advice

RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns1:AddMaterial/LEGAL_REGULATIONS/Legal_Regulation. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._Select_Material_to_AddMaterial_ method Syn_FileName_Directory$[000000000000101960, com.sap.aii.mappingtool.tf3.rt.Context@492f5aa1]

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member200962
Active Contributor
0 Kudos

Check with this UDF:

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String AgiFileName ="MSIPl_"+ paddedAgi+".dat";
conf.put(key, AgiFileName); 
return "";

Why are you using

AbstractTrace trace = container.getTrace();

trace.addDebugMessage("FileName"+AgiFileName);

Any specific reason??

Not quite sure but check if you need com.sap.aii.mapping.lookup.* jar also......

Regards,

Abhishek.

madanmohan_agrawal
Contributor
0 Kudos

Hi Mohan,

It seems that the error is due to directory data. Please change the UDF as below.


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

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

String AgiFileName = "MSIPl_" + paddedAgi + ".dat";
String dir = "/outgoing";

conf.put(key, AgiFileName); 
conf.put(key_dir, dir);

AbstractTrace trace = container.getTrace();
trace.addDebugMessage("FileName" + AgiFileName);

Hope it will help.

Regards,

Madan Agrawal

Edited by: Madan Agrawal on Jul 3, 2009 3:14 PM

Edited by: Madan Agrawal on Jul 3, 2009 3:25 PM