cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in LPAD for numeric val in calculated column

Former Member
0 Kudos

Hi ,

I have a requirement to write a logic in calculated column to apply padding to kunnr ,if kunnr value is non numeric else add 20 char padding .

syntax Used :  lpad("KUNNR",strlen("KUNNR")+10,'0')

this is adding padding but how to check kunnr is numeric or string before adding padding

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

Hello Rohitasya,

at the moment unfortunately there exists not "IS_NUMERIC" function which can be used. One workaround is to use "ltrim" and "chars" functions. For more details please have a look to the answer I gave in discussion .

Best Regards,

Florian

Former Member
0 Kudos

Many Thanks Florian Pfeffer,

It helped a lot .


Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Rohitasya,

With SPS09, we have several REGEXPR functions available.

Check if you can use them.

Regards,

Sunny

pfefferf
Active Contributor
0 Kudos

That is right for SQL, but not for expressions used for calculated columns in e.g. calculation views.

Regards,

Florian