2007 Aug 02 4:17 AM
Hi,
My program outputs the detail of GL accoung details for selected month
Its working fine for every month except 9, 11 and 12
if i gave 9 month its throwing me to short dump showing the error
COMPUTE_BCD_OVERFLOW
CX_SY_ARITHMETIC_OVERFLOW
Please tell me what will be the error
Points will be given
<b>
Thanks & Regards,
Azhar</b>
2007 Aug 02 4:21 AM
Hi,
Look this code, you can easily understand what BCD overflow
PARAMETERS fact TYPE i.
DATA: fact_save TYPE i,
res(16) TYPE p.
*** ARITHMETIC_ERRORS contains COMPUTE_BCD_OVERFLOW ***
CATCH SYSTEM-EXCEPTIONS ARITHMETIC_ERRORS = 5.
res = fact_save = fact.
SUBTRACT 1 FROM fact.
DO fact TIMES.
MULTIPLY res BY fact. "<- COMPUTE_BCD_OVERFLOW
SUBTRACT 1 FROM fact.
ENDDO.
ENDCATCH.
IF sy-subrc = 5.
WRITE: / 'Overflow! Factorial of', fact_save,
'can not be calculated.'.
ELSE.
WRITE: / 'Factorial of', fact_save, 'gives', res.
ENDIF.
aRs
Points are always welcome
2007 Aug 02 4:21 AM
Hi Azhar,
Can you paste your code. and also tell the place where the dump occuring by looking in ST22.
Regards,
Atish
2007 Aug 02 4:21 AM
Hi,
Look this code, you can easily understand what BCD overflow
PARAMETERS fact TYPE i.
DATA: fact_save TYPE i,
res(16) TYPE p.
*** ARITHMETIC_ERRORS contains COMPUTE_BCD_OVERFLOW ***
CATCH SYSTEM-EXCEPTIONS ARITHMETIC_ERRORS = 5.
res = fact_save = fact.
SUBTRACT 1 FROM fact.
DO fact TIMES.
MULTIPLY res BY fact. "<- COMPUTE_BCD_OVERFLOW
SUBTRACT 1 FROM fact.
ENDDO.
ENDCATCH.
IF sy-subrc = 5.
WRITE: / 'Overflow! Factorial of', fact_save,
'can not be calculated.'.
ELSE.
WRITE: / 'Factorial of', fact_save, 'gives', res.
ENDIF.
aRs
Points are always welcome