on 03-31-2006 6:34 AM
I am having a IDOC to file scenario where I have to right align a couple of fields in the output flat file. I am unable to find an appropriate solution. Please help.
I feel you should handle that in your mapping itself.
Write a Java function to handle the same.
ShaBZ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
Use this simple code.
This will work.
return "<Spaces for Actual length of target field>" .substring(0,<Actual length of target field>-a.length()).concat(a);
Regards,
Dhana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can define a user defined function in your graphical user mapping..code that I generally use for padding is
String rJustify(String input, int len) {
StringBuffer sBuf= new StringBuffer(input);
while (sBuf.length() < len) {
sBuf.insert(0,' ');
}
return sBuf.toString();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you could write a java function which pads the required value with space.
<source>-> addspacefunction-> <target>
in the addspacefunction:
output value = " "+ inputvalue;
This should do the trick.
Regards,
Smitha.
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 | |
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.