2006 Jun 30 6:52 AM
Hi everyone,
I have to align data based on decimal point.
eg :- right now my values are coming as follows
99.01
7.19
100.00.
I want all dots on the same column.
how i will do that?
2006 Jun 30 6:59 AM
REPORT Z3TEST .
data : P1 type p decimals 2 value '99.01',
P2 type p decimals 2 value '7.19',
P3 type p decimals 2 value '100.00'.
write : / P1,
/ P2,
/ P3.
Its looking fine.
2006 Jun 30 7:02 AM
Hi Use RIGHT-JUSTIFIED Addition with write.
WRTIE: value RIGHT-JUSTIFIED .
Regards,
Wasim Ahmed
2006 Jun 30 7:05 AM
Use 'right-justified' with your 'write' command. Your problem would be resolved.
Regards,
Subhasish
2006 Jun 30 7:06 AM
Hi,
Change the data type to quan or curr. It will automatically align the figures according to decimal point.
Regards,
Shashank
2006 Jun 30 7:10 AM
Hi,
if your data type is P then it'll print fine.
data : begin of i_tab occurs 0,
val(10) type p decimals 2,
end of i_tab.
i_tab-val = '10.99'.
append i_tab.
i_tab-val = '1.99'.
append i_tab.
i_tab-val = '100.99'.
append i_tab.
loop at i_tab.
write : / i_tab-val.
endloop.
else if your data type is C use right-justified.
data : begin of i_tab occurs 0,
val(10) ,
end of i_tab.
i_tab-val = '10.99'.
append i_tab.
i_tab-val = '1.99'.
append i_tab.
i_tab-val = '100.99'.
append i_tab.
loop at i_tab.
write : / i_tab-val right-justified.
endloop.
Regards,
sumit.
2006 Jun 30 7:11 AM
Hi Shefali,
Try this it works for me.
DATA: ws_value1 TYPE p DECIMALS 2,
ws_value2 TYPE p DECIMALS 2.
ws_value1 = 200 + ( 200 / 1000 ).
ws_value2 = 10 + ( 200 / 1000 ).
WRITE: / ws_value1,
/ ws_value2.
<b> o/p:</b>
200.20
10.20
Reward if helpful.
Regards,
Tushar