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

Loop break in an Internal table

Former Member
0 Likes
586

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
Read only

suresh_datti
Active Contributor
0 Likes
545

use continue ie

if vendor_abc is "incorrect

CONTINUE.

endif.

~Suresh

Read only

Former Member
0 Likes
545

Loop at internal table

if vendor_abc is "incorrect".

CONTINUE.

endif.

endloop.

Regards,

Amey

Read only

Former Member
0 Likes
545

Hi,

You can also use CHECK statement..

LOOP AT ITAB.

CHECK error_flag = 'N'.

ENDLOOP.

Thanks,

Naren

Read only

Former Member
0 Likes
545

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.