Remove initial 0 values and find the first number
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
U can either use this function module also
SHIFT <yourField> LEFT DELETING LEADING '0'
try NO-ZERO option of WRITE statement
Another way is to create another variable of type I and assign the value into it
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