cancel
Showing results for 
Search instead for 
Did you mean: 

How to Filter excess 0's in an Alphanumeric ID

Former Member
0 Kudos

Hi, experts

There is an account ID that leads with letters then goes to numbers. such as YDEP00001148595.

How can I remove the Zeros before the 5. I am trying to do this through a conversion file but the javascript js:parseInt(%external%) and it does not work. I am working on BPC 10.1 NW

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Use substring!

js:parseInt(%external%.toString().substring(5)).toString()

Vadim

Former Member
0 Kudos

What Should I do if the length Varies.

Former Member
0 Kudos

Hi,

if you have ABAP resource you can use end routine to remove the 0s.

Or you can use conversion file with something like

????000000*

????00000*

????0000*

????000*


then remove 0 for each line, just a work around.


Andy

Answers (2)

Answers (2)

Shrikant_Jadhav
Active Contributor
0 Kudos

Hi

If number of zero's and length of ID is fixed then use


ACCOUNT=0GL_ACCOUNT(1:4)+0GL_ACCOUNT(9:15)

Shrikant

Former Member
0 Kudos

The ID length is not fixed. It varies.

former_member186338
Active Contributor
0 Kudos

The character part of the ID has to be fixed length for this formula - "YDEP"

"What Should I do if the length Varies." - you have to explain the requirements from the very beginning!

Vadim

Former Member
0 Kudos

Hi,

Is it a compounded info object?

try split the ID first, then parseInt the number part, then join again.

Andy