‎2008 Apr 29 1:41 PM
Hi all....
Iam having one internal table with five fields and 10 records...
Now iam going to add one more record to that internal table in my program by using append statement...
itab-f1 = ' '.
itab-f2 = ' '.
itab-f3 = ' '.
itab-f4 = 'india '.
itab-f5 = ' '.
append itab.clear itab.
with above syntax i have to get four spaces and one entry....
but i am getting 0 for the last field, which is the numeric field...
how to avoid that zero...
there is no chanse to change numeric as char or others....
and
one more thing is iam dispalying this internal table by using table control, not with normal reporting!!!!
thank you,
naveen.
‎2008 Apr 29 1:56 PM
hi Naveen
do this it will work
define ur last field in this way when ur declaring an internal table ok
data :
f5(5) type numc .
now after this do this
itab-f5 = ' '.
now append ok so it will resolve problem.
plz reward .
thanku
snehi chouhan
‎2008 Apr 29 1:45 PM
Hi,
Please refer example below:
WRITE: '000123',
/ '000123' NO-ZERO.
Thanks,
Sriram Ponna.
‎2008 Apr 29 1:50 PM
Hello,
For numeric fields the initial value is zero. Check if you can change the field type to character.
Regards,
‎2008 Apr 29 1:50 PM
hye naveen,
Declare in the structure of internal table for the fifth coloumn as char. otherwise the defualt for an integer is 0.
Reward if helpful.
Thanks.
‎2008 Apr 29 1:56 PM
hi Naveen
do this it will work
define ur last field in this way when ur declaring an internal table ok
data :
f5(5) type numc .
now after this do this
itab-f5 = ' '.
now append ok so it will resolve problem.
plz reward .
thanku
snehi chouhan
‎2008 Apr 30 5:16 AM
hi...
thank you for your answer....
but here there is no chanse to declare that field as you said, because it was database table field and using in some otherr reports and also in this report for different conditions(calculating)....
showing error like...
LENGTH SPECIFICATION NOT ALLOWEDWITH TYPE '<f5>'.
??????
(any way you wl get marks but solve my problem completely for max...)
Thank you,
Naveen.
‎2008 Apr 30 5:48 AM
hi,
i have a example top suit your requirement
modify according to your need.
while your using write statement use no-zero addition with numeric field. i feel that solves your prob
ex : write itab-f5 no-zero.
data :begin of itab occurs 0,
a(3) type c,
c(3) type c,
b(3) type n,
end of itab.
itab-a = ''.
itab-c = 'abc'.
itab-b = '' .
append itab.
itab-a = 'ABC'.
itab-c = ''.
itab-b = '123'.
append itab.
loop at itab.
write : / itab-a,
itab-c,
itab-b no-zero.
endloop.
REWARD IF HELPFUL
prasanth
‎2008 Apr 30 6:07 AM
Well we have two solutions:
1) Well it seems you are Using STD DDIC Structure/Table
eg. tables: table or
data: Stru1 type table1
Well in that case you have define the structure manually
i.e with
begin of stru
All stru conponents (make sure you difine urr numeric field as char or num c)
and your remaining code will remain as it is or
2) create anothe stucture of same type excpet that field and use move command before display
i.e
move numberic to char.
and displlay..
No Rewards Plz