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

Error

Former Member
0 Likes
645

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>

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
612

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

2 REPLIES 2
Read only

Former Member
0 Likes
612

Hi Azhar,

Can you paste your code. and also tell the place where the dump occuring by looking in ST22.

Regards,

Atish

Read only

former_member194669
Active Contributor
0 Likes
613

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