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

BCD_ZERODIVIDE

Former Member
0 Likes
9,635

Hi all,

the program on execution, throws an error " BCD_ZERODIVIDE ".

This is due to the fact that, a line in the program has attempted to divide by Zero.

eg:

V_PERCENT = ( A / B ) * 100.

Here,

the value of B is zero, and hence this ABAP runtime.

What are the logics could be implied, when B is zero. I have no option to throw an error mmessage, because it is a report,, am really unaware what even the report is doing.. suggest the ways to handle this situation.

thanks in adv..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,648

Hi,

Just change code as

<b>IF B IS NOT INITIAL.

V_PERCENT = ( A / B ) * 100.

ENDIF.</b>

Regards,

Atish

2 REPLIES 2
Read only

Former Member
0 Likes
4,649

Hi,

Just change code as

<b>IF B IS NOT INITIAL.

V_PERCENT = ( A / B ) * 100.

ENDIF.</b>

Regards,

Atish

Read only

former_member386202
Active Contributor
0 Likes
4,648

Hi,

Before that statement check B should not be initial.

EX.

If not b is initial.

V_PERCENT = ( A / B ) * 100.

endif.