‎2006 Jun 27 12:03 PM
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.
‎2006 Jun 27 12:05 PM
Here lenght should be atleast 7.
the 'length' specification refers tothe total length and not the length beofre the decimals.
Regards,
ravi
‎2006 Jun 27 12:05 PM
length 3 decimal 2
and u assign e 1000.91(6 decimal 2) deffinatly it gives eror...
‎2006 Jun 27 12:14 PM
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.
‎2006 Jun 27 12:16 PM
just defind field as 13 decimal 2.
or like stsndared data element (vbrk-netwr) of quantity field.
‎2006 Jun 27 12:19 PM
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
‎2006 Jun 27 12:15 PM
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