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

Loops

Former Member
0 Likes
562

Is it possible to catch an illegal assignment to a data

object inside a loop and continue? Or does this type of

exception cause the termination of the loop?

I want to process records within a loop and ignore those

records which throw exceptions.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
527

hi Gregory,

Check this, it will catch the system exceptions which will cause by data problems.

CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4

OTHERS = 8.

<<YOUR CODE>>

ENDCATCH.

Thanks and Regards

Pavan Kothapalli

3 REPLIES 3
Read only

Former Member
0 Likes
527

use continue statement.

loop at iatb.

if cond ne 4.

continue.

endif.

endloop.

continue statement - it skip that record and go for further record in that loop

Read only

Former Member
0 Likes
528

hi Gregory,

Check this, it will catch the system exceptions which will cause by data problems.

CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4

OTHERS = 8.

<<YOUR CODE>>

ENDCATCH.

Thanks and Regards

Pavan Kothapalli

Read only

Former Member
0 Likes
527

Hi Gregory,

Use <b>CONTINUE</b>

The continue statement is coded within a loop. It acts like a goto, passing control immediately to the terminating statement of the loop and beginning a new loop pass. In effect, it causes the statements below it within the loop to be ignored and a new loop pass to begin.

The following points apply:

• continue can only be coded within a loop.

• continue has no additions.

Reward points if helpful.

Thanks

Aneesh.