Application Development 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: 

solvae this issue

Former Member
0 Kudos

Field too small when calculating totals in internal table.

In the internal table "\PROG=ZSDR003\DATA=TAB[]", a SUM statement is used to

calculate

totals.

However, the values are too large

for the designated field.

The name of the field is "KURSK".

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

Change the field type as,

data: l_p(32) type p decimals 2.

Regards,

Naimesh

8 REPLIES 8

naimesh_patel
Active Contributor
0 Kudos

Change the field type as,

data: l_p(32) type p decimals 2.

Regards,

Naimesh

Former Member
0 Kudos

Sukumar,

If the field size doesn`t fit your requirement, change the corresponding field length and retain its property.

Reward points if helpful.

Regards

Former Member
0 Kudos

hi Sukumar,

The only way to solve this is to increase the field size.

For calculating the total if the size is smaller than you have to use the field of same type with somewhat greater lentht.

suppose if it is the case with weight field with properites 13 and 2 decimal. and the size is smaller for your requirement than for totals, you can use similar field with properties 18 and 2 decimals.

Regards,

Richa

Former Member
0 Kudos

Increase the size of the amount fields in that internal table

Former Member
0 Kudos

TOTAL_AMT(16) TYPE P DECIMALS 5,

KURSK LIKE VBKD-KURSK,

this are the datas declared.

i got a error like

price = price * kursk

total_amt = qty * price

i use sum in at the end of statement

at that time it gives the error

0 Kudos

Increse the total amount length to 25 and try

TOTAL_AMT<b>(25)</b> TYPE P DECIMALS 5.

Message was edited by: Chandrasekhar Jagarlamudi

0 Kudos

increase the length for total_amt to 20.

Secondly, please check if it is due to the total_amt field or other. Because sum would try and sum all the numeric fields.

Regards

Anurag

Former Member
0 Kudos

Hi Sukumar,

the situation is not quite clear for me.

The field KURSK should contain an exchange rate, so do you really intend to sum it? Do you really want to calculate: sum (amount) * sum (exchange rate) ?

At least the average rate is needed, but it's not calculated by the SUM statement.

Before any change consider if the dump is right, did'nt?