10-10-2007 6:43 AM
hi all,
i am doing sorting of an internal table on start-of-selection event. The minimum value when i am trying to write top-of-page event then it always gives 0.
why it is so???
my code is like below...................
loop at it_bom.
x = a/t.
itab-f1 = x.
append itab.
endloop.
sort itab by f1 ascending.
read table itab index 1.
min = itab-f1.
top-of-page.
write:/ 'minimum value', min.
10-10-2007 6:48 AM
hi,
you must have declared x as integer so if it is in decimals i.e 0.9 then it will show you 0. check wat is the value first of operation a/t. like if it is 5/2 then value to be displayed should be 2.5
for that declare x as:
data: x type p decimals 2.
and itab-f also as f type p decimals 2
and min also the same.
10-10-2007 6:48 AM
hi,
you must have declared x as integer so if it is in decimals i.e 0.9 then it will show you 0. check wat is the value first of operation a/t. like if it is 5/2 then value to be displayed should be 2.5
for that declare x as:
data: x type p decimals 2.
and itab-f also as f type p decimals 2
and min also the same.
10-10-2007 6:48 AM
Hi,
When u start the programe top-of page will be triggered first.
that is the reason u r getting values as zero.
U putbreak-point and see the flow how it isgoing on, so that u can see the value
there.
Assign points if useful.