on 11-26-2015 5:56 AM
Hi All,
I am facing an issue that we get a one of the field "Amount", where we get '-' value succeeding.
eg: Exactdata: if Amount = -999, in SAP we get that as 999-, which is incorrect and gets fail at the PI level, which is not able to accept by the DB side at the other end.
So, can we replace this value with the exact once at the PI level using graphical mapping or using UDF we can achieve it..If so, help me..
eg: exact data: -44, but data in SAP occurs as 44-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ram,
Please can you try this
public static String minusSign(String s)
{
if(s!="" || s!=null)
{
int len=s.length();
if(s.charAt(len-1)=='-')
{
s="-"+s.substring(0,len-1);
}
}
return s;
}
output
---------
String input=44-
Output=-44
String input=6777-
Output=-6777
String input=-67
Output=-67
String input=67
Output=67
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ram,
Yes you can replace the value in graphical mapping
e.g.
Value --> If ends with (Text function) - --> Then replace - with blank and concate with - in the start
Else --> Pass the source value
Please let me know if it is difficult for you to visualise the function.
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
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.