on 02-01-2011 11:35 AM
Hi All,
I am working on a proxy to jdbc scenario in which we have to throw validation errors to NWPM(Net Weaver Process Monitor Tool)
I am following the below steps,
step 1 - In message mapping a UDF is created to catch errors and store them in a variable using dynamic configuration
step 2 - writing abap mapping for handling this thrown exception and im reading the dynamic configuration in the abap class and raising exception.
I was using DynamicConfiguration odject as "Conf"
and DynamicConfigurationKey object as "Key".
I wrote below code for Dynamic cofiguration in UDF.
String error="";
error=error+ "missing required field"
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
//DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/Error", "ERROR");
DynamicConfigurationKey keyHeader1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Error", "ERROR");
conf.put(keyHeader1, error);
but while i am trying to test the data in message mapping it will show one error at the time of runtime .
"Runtime exception when processing target-field mapping /ns0:MT_DB2_SourcePlant/Record/SourcePlant; root message: Exception:java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.put(com.sap.aii.mapping.api.DynamicConfigurationKey, java.lang.String) of an object loaded from local variable .
I am using addInfo method inAbstractTrace class.Using this i find error at conf.put(keyHeader1, error);
before the conf.put(keyHeader1, error);its working correctly.
Could you please help in finding the solution for getting currect error message from ABAP class?
> String error="";
> error=error+ "missing required field"
> DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
add this statement here:
if (conf != null) {
> //DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/Error", "ERROR");
> DynamicConfigurationKey keyHeader1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/Error", "ERROR");
>
> conf.put(keyHeader1, error);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Experts,
My scenario is IDoc to CSV where the part of target folder varies according to a field value in input payload to PI, I have written UDF with type as "Single Values"
public String DynDir(String inp, Container container) throws StreamTransformationException
{
String str = "/Dump/testop/"+inp+"/" ;
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
conf.put(key1,str);
return str ;
}
Where the Target folder should be determined according to the input value say /Dump/testop/BG for input WERKS value in IDoc BG001.
When I execute the code it throws an error:
Where DynDir is UDF name and I mapped the input value and UDF to root node of Target structure.
But I get an error code like:
Thanks,
Nithin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Thank you for reply
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.