Application Development 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: 

Loop break in an Internal table

Former Member
0 Kudos

Hello,

I have an internal table with many vendors and each vendor may have multiple line items. Now if a line item has incorrect data then that vendor shudnt get created and move on to the next vendor..As i show here

v1,12,ea,3444

v1,12,ea,3445

v1,12,ea,3446

v2,12,ea,3448

v2,12,ea,3447

If 3445 is incorrect then I shud move on to next vendor v2..How do i do this in an internal table.

Thanks

Viky

4 REPLIES 4

suresh_datti
Active Contributor
0 Kudos

use continue ie

if vendor_abc is "incorrect

CONTINUE.

endif.

~Suresh

Former Member
0 Kudos

Loop at internal table

if vendor_abc is "incorrect".

CONTINUE.

endif.

endloop.

Regards,

Amey

Former Member
0 Kudos

Hi,

You can also use CHECK statement..

LOOP AT ITAB.

CHECK error_flag = 'N'.

ENDLOOP.

Thanks,

Naren

Former Member
0 Kudos

Hi,

You can make use of the AT control statements, something like this:


Loop at itab.

Check if the line item is ok.
IF OK.
  flag = Y.
ELSE.
  CONTINUE.
ENDIF.

AT END OF <vendor>.
 check flag = Y.
 Send vendor details.
ENDAT.

Endloop.

Hope this helps,

Sumant.