on 06-28-2007 11:24 AM
hi.
here in my scenario i have to sum all individual amounts in sender file and i have to compare with trailer sum.
for this i have created my sender mtype amount and i have checked with sum(statistical function) and i compared with trailer info.
its working with integers but when there are amounts with decimals then the sum is not showing correct value.
im my scenario the sum is supposed to be 40843.55 but the sum(statistic function) is showing like 40843.555.
can any body tell what changes i have to do for this.
waiting for u r well anser.
regards.
seeta ram.
seeta ram,
adding to the comments you can set the context of the sum field to correspodning parent node and using udf u can addup. lateron using comparssion node u wud be able to take this on
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi thanks for your help.
bit i think it can be possible if we try the checking of sum of amounts with trailer infoby graphicalmapping using sum(statistic) function i tried it using this graphical mapping but iam getting problem with decimalvalues .
if the amount values are decimals then iam getting difference with sum(statistical) and trailer info.
waiting for u r response.
bye.
regards.
seeta ra,.
Hi
Here is what you need to do
To perform the switch to BigDecimal instead of float you should go to ExchangeProfile edit page, look for property
com.sap.aii.mappingtool.flib3.bigdecimalarithmetic under the IntegrationBuilder node, and set it to true.
If the property does not exist yet, create it. Set the same property under the node IntegrationServer to true, or create it, if appropriate.
After the property is set, go to AIIProperties view page, and press Refresh button.
regards
krishna
https://websmp205.sap-ag.de/notes goto this link and put in the note number provided by krishna. There it will give you the description of wht is needed to be done to solve your problem. You dont have to raise a note. the note mentioned above has all the details to solve your issue. Ask your basis to help you in this regard.
Hi
http://<Message server>:<Port>/exchangeProfile/index.html
You can change the option only if you are on SP 18 in XI 3.0
regards
krishna
Here is the fix for you
The reason for the error is that arithmetic and statistic functions in Message-Mapping use Java's primitive type float to perform calculations, which can yield incorrect results because of the nature of binary floating point computations.
Starting from Support Package 18 of the component XI TOOLS 3.0 and Support Package 09 of the component XI TOOLS 7.0 there is a possibility to switch underlying calculations to class java.math.BigDecimal.
<b>To perform the switch to BigDecimal instead of float you should go to ExchangeProfile edit page, look for property
com.sap.aii.mappingtool.flib3.bigdecimalarithmetic under the IntegrationBuilder node, and set it to true.
If the property does not exist yet, create it. Set the same property under the node IntegrationServer to true, or create it, if appropriate.
After the property is set, go to AIIProperties view page, and press Refresh button.</b>
regards
krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
check OSS note 958486
regards
krishna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you can use custom function mapping here...
Go about it like this...
Give all your input prices as arguments to a custom function..
Convert into type double by using
double value = Double.parseDouble(argument);
add up all the values and store in into another double varuable say sum
now declare String sumStr = sum.toString()
and return sumStr;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try;
public void chkAmountSum(String[] a,String[] b,ResultList result,Container container){
//write your code here
double tempAmt = 0;
double tempSum = 0;
double tempRes = 0;
double temp = 0;
double count = 0;
try{
for (int j = 0; j<a.length; j++)
{
temp =Double.parseDouble(a[j]);
tempAmt = tempAmt + temp ;
}
for (int j = 0; j<b.length; j++)
{
tempSum = Double.parseDouble(b[j]);
}
tempRes = tempAmt - tempSum;
if (tempRes != 0)
{
a[0] = "Not equal";
result.addValue(a[0]);
}
else
{
a[0] = "Is Equal";
result.addValue(a[0]);
}
}catch(NumberFormatException e)
{
a[0] = "Exception";
result.addValue(a[0]);
}}
helosir.
sorry i tried it but it is too complicated.
so cont we try using graphical mapping like amout->sum(statistical function) and then compare with trailer information idid like this its working but there is only problem when the detailed amounts r like 120.89,340.54 etc like this.
waiting for u r reply.
cheers.
seeta ram.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.