cancel
Showing results for 
Search instead for 
Did you mean: 

Padding a value with zeros

Former Member
0 Kudos

Hi,

I am trying to pad a field with leading zeros during mapping. I am going from an IDOC to a flat file. Is there a function in the message mapping of XI that will help me do this?

For example: the value of "91423" is passed in to a field of length 10. i want the value to look like this on the flat file "0000091423".

Is this possible?

Thanks,

Nate

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi Nathan,

yes this is possible:

one way - create a user defined function

with one input value (your field)

and check it's length and add (10 - length) zeros

second way - without user defined function

and use length and concat functions (build into graphical mapping functions) and if statement

if length = 9 then string concat 0

else if length = 8 then string concat 00 ...

the first way it better but if you don't want to use java you can use the second one

Regards,

michal