This is a pad utility in the WmEDI package if you happen to have this package:
wm.b2b.edi.util:pad
I usually create two wrapper services that call this particular utility. One that pads numbers (left with zeros); one that pads strings (right with spaces).
The wrapper utilities expect inputs of string, totalLength and type.
Then, it figures out based on number or string which way to pad, what to pad with and how many padded locations are needed.
For example, a string, whose length is 6, but requires a total amount of 12 spaces for the document would have 6 char(32) spaces concatenated to the end of the string. So, the string ‘wmuser’ would appear as 'wmuser '. For the number 123, whose whole length is 10, it would appear as ‘0000000123’.
This is assuming that you are padding left with zeros for numbers and padding right for strings with spaces.
HTH
Ray
#Integration-Server-and-ESB#Flow-and-Java-services#webMethods