on 01-12-2016 5:39 PM
Hello SAP PI gurus
I am not a java programmer and am trying to play with it.
I want 2 integers or decimal values to be sent to UDF and in return the UDF should send the sum of those two values.
Please see the attachment for the UDF details.
When I try to activate it fails with the following error
Message was edited by: Ram Hebbalalu Source text of object Message Mapping: TRAINING_VendorToAccounts_XYZ | http://mpc.com/TrainingByRam has syntax errors: Function Total, Line 2: incompatible types found : int required: java.lang.String return DiscountedPrice; ^ Note: D:\usr\sap\XID\J00\j2ee\cluster\server1\.\temp\classpath_resolver\Map79c76e19b95311e5be950000002d515f\source\com\sap\xi\tf\_TRAINING_VendorToAccounts_XYZ_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
Why don't you use the standard Arithmetic "subtract" function for this?
If you want to use UDF, then change the input value type form Int to Float as you may have decimal values and use the below code.
return Float.toString(var1-var2);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Hareesh and Raghuraman
I tried both the suggestions and both worked .
Thanks a lot. I appreciate it.
Ram
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 | |
10 | |
9 | |
9 | |
7 | |
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.