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

looping time..

Former Member
0 Likes
386

DATA : BEGIN OF ITAB2 OCCURS 0,

KEY(10),

END OF ITAB2.

There are about 8000 lines in the ITAB2

LOOP AT ITAB2.

SELECT name FROM EMP

APPENDING TABLE IT100

WHERE KEY = ITAB2-KEY

ENDLOOP.

so this loop program is processing for a long time.

Could you show how to query at once?

Message was edited by:

jake

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
351

Use the following code..

if not itab2[] is initial.

select name from emp into table it100

for all entries in itab2

where key = tab2-key.

endif.

~Suresh

3 REPLIES 3
Read only

suresh_datti
Active Contributor
0 Likes
352

Use the following code..

if not itab2[] is initial.

select name from emp into table it100

for all entries in itab2

where key = tab2-key.

endif.

~Suresh

Read only

raja_thangamani
Active Contributor
0 Likes
351

Use FOR ALL ENTRIES as follows:

SELECT name FROM EMP
   TABLE IT100
     FOR ALL ENTRIES IN itab2 
          WHERE KEY = ITAB2-KEY.

Raja T

Message was edited by:

Raja Thangamani

Read only

Former Member
0 Likes
351

CHECK NOT ITAB2[] IS INITIAL.

SELECT NAME

FROM EMP

INTO TABLE IT100

FOR ALL ENTRIES IN ITAB2

WHERE KEY EQ ITAB2-KEY.

Thanks,

Santosh