Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Remove initial 0 values and find the first number

Hi ,

I have different numbers in my records, they vary from 1 digit to 9 digit . I also have some letters in these records . Relevant field is 10 character length and if it fills initial free spaces with '0' to make record 10 digit. I want to find first digit after '0' values.

For example I have records like :

000123456S I want to find '1'

0000000081 I want to find '8'

Thanks for your helps

Erkan

Tags:
Former Member
Former Member replied

U can either use this function module also

CONVERSION_EXIT_ALPHA_OUTPUT

or

SHIFT <yourField> LEFT DELETING LEADING '0'

or

try NO-ZERO option of WRITE statement

or

Another way is to create another variable of type I and assign the value into it

example:

DATA: L_NUMC(08) TYPE N.

DATA: L_INT TYPE I.

L_NUMC = '00000018'.

L_INT = L_NUMC.

Result will be = 18.

Hope this helps

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question