on 12-02-2008 6:20 AM
Hi,
SAP send value to XI as 100.00-
In XI, I send this to standard subtract function where it expect this as -100.00
Which is the good way to move the negative sign to the left ?
Please do note there coould be situation where this value can come as positive so I have to take care of both situations.
Thanks in advance.
Hi,
Check with the below mapping
src--------------\
Constant[-]-----| replaceString-----neg------
Constant[]----/ |
|
then
src---------------\endswith-------------->if --------->tgt
Constant[-]-------/ else <---------src
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.
write a UDF
int indexNeg = str1.indexOf("-"); //str1 is input to UDF
if (i == -1)
return str1;
else {
str1 = str1.replace('-','');
str1 = "-" + str1
return str1;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check if indexOf "-" is not -1. If it is -1, then it means that no - sign is present. If its present, you may replace it with blank "" and concat it in the front. This would also work for positive numbers.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
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.