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

Background job

Former Member
0 Likes
1,021

when i executed a job in background got the error message as "ABAP/4 processor: BCD_ZERODIVIDE".This error is occured for only one of the given selection criteria,for other cases its getting executed.How to correct it.?What ar the reasons for it?

1 ACCEPTED SOLUTION
Read only

hymavathi_oruganti
Active Contributor
0 Likes
964

Hi,

Given your selection criteria, at some point you should be getting a situation where some value is divided by zero.

Try debugging it online if possible.

The value which is becoming 0 for division, put a catchable exception there.

Hi,

Given your selection criteria, at some point you should be getting a situation where some value is divided by zero.

Try debugging it online if possible.

The value which is becoming 0 for division, put a catchable exception there.

6 REPLIES 6
Read only

Former Member
0 Likes
964

Hi,

Your dividing component is zero. because of that BCD_ZERODIVIDE error is occured. make sure your dividing component is not sure.

Please refer this link.....

http://help.sap.com/saphelp_nw04/Helpdata/EN/cf/f2bbce142c11d3b93a0000e8353423/content.htm

Hope it will helps

Read only

Former Member
0 Likes
964

Hi

When ever your dividing, pls make sure the dividing component is not zero.

When you try to divide by zero, you will get the error.

Pls change the program accordingly

Regads

MD

Read only

hymavathi_oruganti
Active Contributor
0 Likes
965

Hi,

Given your selection criteria, at some point you should be getting a situation where some value is divided by zero.

Try debugging it online if possible.

The value which is becoming 0 for division, put a catchable exception there.

Read only

0 Likes
964

How to put a catachable exception..Can you tell one sample

Read only

Former Member
0 Likes
964

Hi Hema,

1) check the steps in your job using sm37

2) one of your step may be throwing this error which has come across the statement dividing by zero for your specified selection criteria.

3) debug that step i.e program which is added as a step by specifying your selection criteria

3) modify the program by adding try and catch blocks to handle run time exceptions.

Please refer to the link below which explains you how to handle run time exceptions

http://help.sap.com/saphelp_nw70/helpdata/en/cf/f2bbce142c11d3b93a0000e8353423/content.htm

Thanks,

Naveen Kumar.

Read only

Former Member
0 Likes
964

Hi,

Example Program....


REPORT demo_catch_endcatch.

DATA: result TYPE p DECIMALS 3,
      number TYPE i VALUE 11.

CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 5.
  DO.
    number = number - 1.
    result = 1 / number.
    WRITE: / number, result.
  ENDDO.
ENDCATCH.

SKIP.

IF sy-subrc = 5.
  WRITE / 'Division by zero!'.
ENDIF.

The program calculates the quotients tens time from 1 and number until the runtime error BCD_ZERODIVIDE occurs. This belongs to the exception group ARITHMETIC_ERRORS, and is caught in the example using this class.

Hope it will helps