on 02-04-2016 8:48 AM
Hi.
Got an interface where we get a value for bonuses payed out every quarter of the year and every year bonus.
I some time gets a negativ value and from SAP it arrives as follow.
66955.00-
Ofcourse the amonut can differ so it will not be fixed position.
The target system would like to have the value like this.
-66955.00
How will I solve this?
Do I need an UDF and how would it look in that case?
Regards Andreas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mark,
Better to put this in UDF because this is a common requirement when we work with IDOCs, because from ERP the minus sign is placed in right side of the amount.
In my project i have created the UDF for this in common function library under common software component and i used it in the all the mappings where i need this requirement.
Regards,
Praveen.
Hi Andreas,
Use below UDF
Execution Type : Single Values
public String moveMinusSignToLeft(String amount, Container container) throws StreamTransformationException{
int index = amount.indexOf("-");
if (index > 0) {
return ("-" + amount.substring(0, index));
} else {
return amount;
}
}
Regards,
Praveen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.