on 2005 Jul 20 9:02 AM
Hi,
I have the problem, that I have to fill up several fields with leading 0. I wrote a User-Defined Function for this. But the function doesn't know how long this element is, so I have to give the function the length of the element.
Is it possible to determine the length of the current element in an extended User-Defined Function
Yours
Thomas
Hi Thomas,
Of course you have to provide the metadata for the length of the field. But this has to be done anyway. How should the system know the length of the field?
Unfortunately it's not possible in message mapping to get the metadata from the message type definition.
Best regards
Joachim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
I think an easy solution for this is, just have a simple function with two arguments. The first is the element, the second is a constant, where you put the length.
It is not possible to access the length of the field from the xsd.
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
>use a simple user defined function with the desired
>source element as input and give the following code...
>int k = a.length();
>String len = Integer.toString(k);
>return len;
That function will only give me the actual lenght of the input element, what I need is the max lenght of the target element...
>You can also use the built-in FormatNumber function to
>insert leading 0s.
How can I use this function to add leading zeros?
"'000'#" ? But there I have to do this for every element
>I think an easy solution for this is, just have a
>simple function with two arguments. The first is the
>element, the second is a constant, where you put the
>length.
Well I have this function. But I am looking for way to the safe the second argument ;o)
Thank you all for your help
Thomas
Hello Thomas,
> How can I use this function to add leading zeros?
> "'000'#" ? But there I have to do this for every
> element
Simply add the number of "0" you want to add. So if you e.g. 123 -> FormatNum(00000) -> 00123. This is the easiest and savest way to resolve this kind og problems.
Best regards
Joachim
Hello Thomas,
You can also use the built-in FormatNumber function to insert leading 0s.
Best regards
Joachim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.