on 12-11-2006 9:25 AM
I want to create a mapping like the ABAP function:
CONVERSION_EXIT_MATN1_INPUT
for example:
1 => 000000000000000001(add zeros if input value is
numeric)
Z => Z(no change if input is not numeric)
The standard function "formatnum" works well from 1 => 000000000000000001.But it causes a java exception from Z => Z.
How to solve it?
Must i develop a UDF?
thanks
Deleted content.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if i understood your requirement, you need to do padding(left) for your input. In that case use this UDF to help you out;
int len = 10 ; // the maximum length of the field in your target.
StringBuffer sBuf= new StringBuffer(a);
while (sBuf.length() < len) {
sBuf.insert(0,'0');
}
return(sBuf.toString());
Message was edited by:
Shabarish Vijayakumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.