on 01-17-2011 6:31 AM
Hi,
Case:
Input Field Value: " 12345-"
Output Value: " - "
if the last character value " -", need to map with "-" and for any value need to map with "+".
I have used "endsWith" function and if condition...its giving some Runtime Exception like "cannot cast decimal value"
Can anybody help me for the same.
-Stallin
Input-->endswith(Constant(-)) --> ifWithElse (Constant(-) --> Then; Constant(+) --> Else) --> target
the above is working for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
or test tab mapping
i used source and target fields as decimals (and even string)....the mapping gets executed successfully for me.
You can use the UDF...but i still feel that it should have been done with standard functions.
can you try with " 12345678+" as a input value...its throwing an runtime exception for me.
yes i used something similar....123456- and 123465+
Edited by: abhishek salvi on Jan 17, 2011 12:40 PM
Hi,
How to pick the message based on the field names in the recordset for file 2 file adapter.
Regards,
Chakrapani
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its is not giving any kind of runtime exception FOR ME .
execution is also successful.
Please paste the error for the clear understading
Edited by: vippab on Jan 17, 2011 8:03 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@ Abhishek / Ram
I have used the input value as " 1" ( 13 spaces prefix with 1) and used the same logic you mentioned, getting the same runtime exception'
"Runtime exception when processing target-field mapping /ns0:MT_RDNReceiver/RECORD/ITEM/XCPT_QTY; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Cannot cast '1' to decimal number] in class com.sap.aii.mappingtool.flib7.Arithm method formatNumber[ 1, java.text.DecimalFormat@674dc, ., com.sap.aii.mappingtool.tf7.rt.Context@558b5349"
\
help me out for the same.
-E
Hello,
You can use this mapping
Source --> removeContext --> UDF --> Target
UDF type is of context type
Argument: input
for(int a=0;a<input.length;a++){
String temp = input[a].substring(input[a].length()-1,input[a].length());
if(temp.equals("-"))
result.addValue("-");
else
result.addValue("+");
}
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.