on 11-13-2008 4:30 PM
Hi,
I am writing one UDF in which based on the input value, the target file name has to be changed. For example if the input value is "1120" then the target file name should be "1120.txt" and if the input value is null then ".txt" should be the file name. My code is working fine if the input contains value and if the input value is null, then it is giving run time exception "Base run time error in message mapping". My requirement is the empty file ".txt" has to be created. Can you please help me to handle the situation.
Thanks,
Naresh
PI uses traget field mapping. That is if the source is not present or empty nothing is done. Maybe you can change your mapping with if-else. If source value is not present, assign ".txt" as constant, else call your UDF.
Regards,
Volker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
fileName = endResult + ".txt"; // this endResult is the RFC output
DynamicConfiguration objDynConf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey objKey1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
objDynConf.put(objKey1, fileName);
container.setParameter(StreamTransformationConstants.DYNAMIC_CONFIGURATION, objDynConf);
This message was moderated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry experts,
I can not use variable substitution.. here i am giving my error and code.. Please help me out..
Runtime exception during processing target field mapping /ns0:MT_InternalOrder/Record/E_IbuyEntity. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_INF00083_02_SAP_to_IBUY_ method Dynamic$[114S.txt, com.sap.aii.mappingtool.tf3.rt.Context@735c735c] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:MT_InternalOrder/Record/E_IbuyEntity. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_INF00083_02_SAP_to_IBUY_ method Dynamic$[114S.txt, com.sap.aii.mappingtool.tf3.rt.Context@735c735c]
MappingTrace importanttrace;
importanttrace = container.getTrace();
importanttrace.addWarning(a);
DynamicConfiguration objDynConf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey objKey1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
objDynConf.put(objKey1, a);
container.setParameter(StreamTransformationConstants.DYNAMIC_CONFIGURATION, objDynConf);
return (a);
Thanks,
Naresh
Test if your variable "endResult" is initial:
if (endResult.trim().equals("")) {
...
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
paste ur UDF logic here.. else check for null condition in the code. I think it is throwing NPE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Naresh,
You can put a simple logical check in UDF for emoty value and assign it some default name.
Else if you want to use graphical mapping, use string function Compare, to check if this is empty, then assign it default name else proceed.
Thanks
-Kulwant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.