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: 

Need help on Repeating Function

Former Member
0 Kudos
95

Hi Guys,

I am having trouble with my code.

Ex.

loop at i_table into wa_table.

Perform get_exposion tables i_out

using wA_table-field1

wa_table-field2.

endloop.

LOOP at i_out into wa_out.

IF wa_out-date NE s_date.

Perform get_exposion tables i_out

using wA_out-field1

wa_out-field2.

ENDIF.

DESCRIBE TABLE i_out LINES v_line.

if v_line = 0.

<b>repeat from loop at i_out into wa_out. until record needed is found</b>

endif.

How can I jump back to the line loop at i_out into wa_out? Because I need to repeat the process until I find what I need. the value of i_out changes everytime it enters the perform. Thanks! your help will be really appreciated.

Regards,

Mike

2 REPLIES 2

Former Member
0 Kudos
71

Hi Mike,

You can write your code in

DO

ENDDO

And use CONTINUE in it.

When you foind record use EXIT to come out.

Regards,

Atish

naimesh_patel
Active Contributor
0 Kudos
71

Try this code:


LOOP at i_out into wa_out where date NE s_date.
Perform get_exposion tables i_out
using wA_out-field1
wa_out-field2.

DESCRIBE TABLE i_out LINES v_line.
if v_line <> 0.
  exit.
endif.
endloop.

Regards,

Naimesh Patel