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

Sum statement.

former_member225631
Active Contributor
0 Likes
1,459

Hi Friends,

I have one field in internal table with type p decimals 2. When sum statement is executed, this field causes short dump with the message "he values are too large for the designated field". How to solve this?

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,249

when you are getting the dump by declaring the type p decimals 2 then try to calculate the sum in acharacter field.

data : tot(30).

sort itab by <your itab field(s)>.

loop at itab.

tot = tot + itab-amt.

at end of <your control break field>

write : / tot.

clear tot.

endat.

endloop.

it may fulfill your requirement.

regards

shiba dutta

11 REPLIES 11
Read only

Former Member
0 Likes
1,249

Debugg the report and check which value are actually sum by report. That's the easy option to get rid of such errors.

if sum = sum + value then check what is value data type and which value it contains at runtime.

Read only

Former Member
0 Likes
1,249

Hi,

Increase the size of the packed decimal data type ..Might be the length is less and value is not fitting into it././

rewards if its solved.

regards

nazeer

Read only

Former Member
0 Likes
1,249

Hi,

Increase the size of the variable where you are storing the result of the sum statement.

Also check for its data type.

Reward if useful.

Thanks and regards,

Prerna

Read only

former_member225631
Active Contributor
0 Likes
1,249

data:field type p decimals 2.

At last.

sum.

write itab-field.

endat.

I changed to type p decimals 14. Still it goes to short dump when sum statement is executed.

Read only

0 Likes
1,249

Give the length.

ex: field(20) type p decimals 2.

Read only

former_member225631
Active Contributor
0 Likes
1,249

I tried field(16) type p decimals 2, still it gives short dump.

Read only

0 Likes
1,249

HI,

Can you write your code and the dump error?.

regards,

nazeer

Read only

0 Likes
1,249

hi,

try with float instead of packed decimals.

reward if useful

ravi

Read only

former_member225631
Active Contributor
0 Likes
1,249

"the values are too large for the designated field".

( first i have mentioned.)

Read only

Former Member
0 Likes
1,250

when you are getting the dump by declaring the type p decimals 2 then try to calculate the sum in acharacter field.

data : tot(30).

sort itab by <your itab field(s)>.

loop at itab.

tot = tot + itab-amt.

at end of <your control break field>

write : / tot.

clear tot.

endat.

endloop.

it may fulfill your requirement.

regards

shiba dutta

Read only

former_member225631
Active Contributor
0 Likes
1,249

Hi Mr. Shibu it is working fine. Rewarded points. Thanks