‎2007 Jan 30 10:50 PM
Hi all,
I have an internal table in which some fields contain zeros only. i want to remove the zeros, and make the fields blank.
Please help me..
Thanks
Pranati
‎2007 Jan 30 11:09 PM
Hi,
Try this..
DATA: V_NUMC(3) TYPE N VALUE '000'.
CLEAR: V_NUMC WITH space.
Thanks,
Naren
‎2007 Jan 30 10:54 PM
If you mean you don't want to write the zeros when you use the WRITE statement then:
WRITE: itab-field1 no-zero.
‎2007 Jan 30 10:57 PM
Hi,
You can use SHIFT.
DATA: V_CHAR(10) VALUE '00000'.
SHIFT V_CHAR LEFT DELETING LEADING '0'.
Thanks,
Naren
‎2007 Jan 30 11:06 PM
Hi Naren,
Thanks for your reply.. it worked. is there any way we can make it work using 'clear' ?
I tried using...
CONSTANTS hex(1) TYPE x VALUE IS INITIAL.
CLEAR f with hex.
but it was giving me syntax error.
Thanks
Pranati.
‎2007 Jan 30 11:10 PM
Yes you can use CLEAR aswell.
itab-a = '000'.
append itab.
loop at itab.
<b> clear itab-a.</b>
modify itab.
endloop .
Thanks,
Santosh
‎2007 Jan 30 11:01 PM
Sorry. Yes its possible with SHIFT. I didnt know that.
May be you can do something like this:
data: begin of itab occurs 0,
a type c,
end of itab.
itab-a = '0'.
append itab.
loop at itab.
shift itab-a left deleting leading '0'.
modify itab.
endloop.
write itab.
Thanks,
Santosh
null
‎2007 Jan 30 11:09 PM
Hi,
Try this..
DATA: V_NUMC(3) TYPE N VALUE '000'.
CLEAR: V_NUMC WITH space.
Thanks,
Naren
‎2007 Jan 30 11:16 PM
Hi all,
problem solved..so i am closing the thread.. thanks everyone for helping me out..
Cheers
Pranati