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

Overflow error.

Former Member
0 Likes
1,269

HI evryone,

my table field is as follows

filedname type

PER QUAN length 3 decimal 2

i am assigning a value to this in program. it may be possible value to assign will be 1000.91. that time overflow dump is coming.

please help how to handle the error in program.

my code is as follows:-

assign component g_index of structure g_t_mspupld to <fs>.

move : g_t_excel_data-value to <fs>. " this statement is giving error.

6 REPLIES 6
Read only

Former Member
0 Likes
772

Here lenght should be atleast 7.

the 'length' specification refers tothe total length and not the length beofre the decimals.

Regards,

ravi

Read only

Former Member
0 Likes
772

length 3 decimal 2

and u assign e 1000.91(6 decimal 2) deffinatly it gives eror...

Read only

0 Likes
772

My requirement is 3digits plus 2 decimals.

at database level i maintained Quan 5,2.

Value i am not assisgning it is coming at run time.

Read only

0 Likes
772

just defind field as 13 decimal 2.

or like stsndared data element (vbrk-netwr) of quantity field.

Read only

0 Likes
772

Hi,

You can try with the Catch , here you can handle that error.

what is the exact (exception)error you got in the dump.

REPORT  ZTEST_OVERFLOW_CATCH    message-id ZZ  .
DATA : a type i .
data: b type i,d type menge.

data: c type i.
CATCH SYSTEM-EXCEPTIONS COMPUTE_INT_TIMES_OVERFLOW  = 1.
a = 1000000.
b = 9000000.
c = a * b.
ENDCATCH.
IF sy-subrc = 1.
  Message i000 with 'Overflow Error' .
ENDIF.

if you don't handle CATCH

REPORT  ZTEST_without_CATCH    message-id ZZ  .
DATA : a type i .
data: b type i,d type menge.

data: c type i.

a = 1000000.
b = 9000000.
c = a * b.

Just test these in your system (just copy paste it and see).

Regards

vijay

Read only

Former Member
0 Likes
772

Hi,

The way what you have declared and moving to the varibale is not correct.

In your question the destination is smaller than the source. So it will give error.

Regs,

Venkat Ramanan