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

Summation problem in ALV

Former Member
0 Likes
1,515

Hi,

The Current report had 3 fields which have decimals, The report is using ALV. Requirement is to eliminate the decimals for a certain country. i.e if the o/p shows 104.34, then the changed value should be 10434. I have resolved this by moving the data to a character field. But the problem now is that those 3 fields are also summed using ALV. This cannot be obtained since i am using Type 'C'.

Can anyone throw some light on it.

Thanks & Regards,

Sathu

Hi,

The Current report had 3 fields which have decimals, The report is using ALV. Requirement is to eliminate the decimals for a certain country. i.e if the o/p shows 104.34, then the changed value should be 10434. I have resolved this by moving the data to a character field. But the problem now is that those 3 fields are also summed using ALV. This cannot be obtained since i am using Type 'C'.

Can anyone throw some light on it.

Thanks & Regards,

Sathu

13 REPLIES 13
Read only

Former Member
0 Likes
1,454

Hi

Declare ur numeric fields like this.......not sure ..but try it

check pc261

V_NUM LIKE PC261-SEQNR..

Read only

0 Likes
1,454

Hi R.K,

My field Length is 13 with 2 decimal places. The field SEQNR has only 5 characters.

Read only

0 Likes
1,454

hi,

just keep data type like the orginal one.

domnt make it char.

multiply ur old nalue by 100.

thus u can remove decimels.

try it.

rgds

Anver

if hlped pls mark points

Read only

0 Likes
1,454

Multiplying with 100 will probably not solve the problem cos i have checked it again and ,whats happening is that the field is declared as

field(13) type p decimal 5

Read only

0 Likes
1,454

Remove (13) after field.

Read only

Former Member
0 Likes
1,454

Instead of type C field declare type I column and display it on the screen. Before displaying just mulitply by 100,

itab-new = itab-old * 100.

Read only

0 Likes
1,454

Hi Tomasz,

I tried with type I, But it is rounding-off the value. i.e instead of displaying 10435 it is displaying 104.

Read only

0 Likes
1,454

multiply by 100.

itab-new = itab-old * 100.

Read only

0 Likes
1,454

hi,

i think the length of that field is 3.

make it 5 and try the multiplication

rgds

anver

Read only

Former Member
0 Likes
1,454

Hi,

I suppose in all record a field has always the same number of decimals.

Before fill the alv, can you multiply the value for 100 (in your example you have 2 decimals).

An idea.. but is possible it's a currency problem??

bye

enzo

Read only

former_member283648
Participant
0 Likes
1,454

Hi,

I am not clear on your requirement. Say you dont want to display decimals to country like Japan (Japanese currency dont have currencies with decimal notation). then better you create a reference by populating reference currency field in the field catalogue(field is CFIELDNAME).

Let me know if my understanding is wrong...

Read only

Former Member
0 Likes
1,454

Hi,

Simple logic what i can think is for specfic country in your internal table mulitply the value by 100 and then you will not have any issue...

This is because you don't want remove decimals.

Atul

Read only

Former Member
0 Likes
1,454

declare d field as numner/integer....

do not declare it as CHAR

in field catalog u can u can make decimals

wa-fieldcatalog-DECIMALS_OUT = '0'

or

multipy field with 100 ...

Regards.

Ramesh.