Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Decimal error

Former Member
0 Likes
608

Hi friends ,

This sounds weird anyways here is the issue . I am calculating a value and appending it to an internal table say itab1 . Later I move the value from itab1 to output_table for printing in the report . When the value is in itab1 it shows as 0.22 but now when the value is in output_table the value is 0.000022. How is this possible when I defined the value in both internal tables as same . Please advise .

Here is a sample code .

Begin of itab1 .

'

'

value TYPE p DECIMALS 2,

end of itab1.

Begin of output_table.

.

.

value TYPE p DECIMALS 6,

end of output_table.

Start of selection

'

'

'

Append itab1 to output_table .

..

..

end of selection .

Thanks ,

Hari

1 ACCEPTED SOLUTION
Read only

sridhar_k1
Active Contributor
0 Likes
566

try move-corresponding itab1 to output_table and append output_table .

regards

Sridhar

4 REPLIES 4
Read only

sridhar_k1
Active Contributor
0 Likes
567

try move-corresponding itab1 to output_table and append output_table .

regards

Sridhar

Read only

Former Member
0 Likes
566

Hi Hari,

Maintain same type declaration for VALUE in both internal tables ITAB1 and OUTPUT_TABLE.

Change the type declaration of OUTPUT_TABLE for VALUE as in bold.

Begin of itab1 .

'

'

value TYPE p DECIMALS 2,

end of itab1.

Begin of output_table.

.

.

*value TYPE p DECIMALS 6,

<b>value TYPE p DECIMALS 2,</b>

end of output_table.

Thanks,

Vinay

Read only

Former Member
0 Likes
566

i think ur final table has been declared as some database field which has 6 decimals....u need to declare this field as type P decimals 2...

so when u move it moves 0.22 and report shows as 0.22

Read only

Former Member
0 Likes
566

Hi hari,

Make field type same in both itab1 and output_table.

Then u will get ur required o/p.

If it helps, close the thread by giving points to all useful answers.

Regards,

Kumar