‎2006 Sep 08 2:58 PM
Hello friends,
I have to delete leading zeros and condense it and i am using the below code,
w_aubel = it_out-aubel.
w_len = ( STRLEN( w_aubel ) ).
DO w_len TIMES.
IF w_aubel+w_ctr(1) = '0'.
w_aubel+w_ctr(1) = ' '.
w_ctr = w_ctr + 1.
ELSE.
CLEAR w_aubel+w_ctr(1).
CLEAR w_ctr.
EXIT.
ENDIF.
ENDDO.
CONDENSE w_aubel.
For Eg - w_aubel = 005246,
my output should be 5246,
but i am getting 246.
I have looked into the debug mode and is a problem because of the clear statement.
Any help on this will be appericiated,
Shejal Shetty.
‎2006 Sep 08 2:59 PM
Hi ,
Just use pack statement to delete the leading zeros.
Pack w_aubel to w_aubel.
Hope this helps.
‎2006 Sep 08 2:59 PM
Hi ,
Just use pack statement to delete the leading zeros.
Pack w_aubel to w_aubel.
Hope this helps.
‎2006 Sep 08 3:13 PM
Hello Imtiaz i was doing something wrong,
The problem is solved by the way u have specifies.
Thanks again for your help.
Shejal.
‎2006 Sep 08 3:01 PM
‎2006 Sep 08 3:08 PM
Thanks Rich,
The problem solved.
Hello Ahmed i have tried the method i u specified but it deleates everything and the result is just a 0.
Thanks all for the quick reply,
Shejal Shetty.
‎2006 Sep 08 3:04 PM
just try the below
WRITE w_aubel to laubel no-zero no-gap.
Shift laubel left deleting leading space.
Message was edited by: Anurag Bankley
‎2006 Sep 08 3:06 PM
Hi Shejal,
Please try this.
REPLACE ALL OCCURRENCES OF '0' IN W_AUBEL WITH ' '.
CONDENSE W_AUBEL NO-GAPS.Regards,
Ferry Lianto
‎2006 Sep 08 3:09 PM
Hi,
write:/ aubel no-zero. <<removes leading zeroes>>
write:/ aubel+2. <<to ignore leading spaces>>
Regards,
sowjanya.