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

select statement

Former Member
0 Likes
645

Hi experts,

I have a select statement and it is taking lot of time.

How can i reduce it?


  select aufnr xloek kzear into corresponding fields of table
      t_det from resb for all entries in t_comp
                                 where aufnr = t_comp-aufnr.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
625

arrenge field in iternal table.....

select aufnr xloek kzear into table

t_det from resb for all entries in t_comp

where aufnr = t_comp-aufnr.

Message was edited by: kishan negi

5 REPLIES 5
Read only

Former Member
0 Likes
626

arrenge field in iternal table.....

select aufnr xloek kzear into table

t_det from resb for all entries in t_comp

where aufnr = t_comp-aufnr.

Message was edited by: kishan negi

Read only

abdul_hakim
Active Contributor
0 Likes
625

Hi Kaki,

use my below code..

data: begin of wa,

aufnr like resb-aufnr,

xloek like resb-xloek,

kzear like resb-kzear,

end of wa.

data itab like table of wa.

if not t_comp is initial.

select aufnr xloek kzear from resb into table itab for all entries in t_comp where aufnr = t_comp-aufnr.

endif.

Regards,

Abdul Hakim

Read only

Former Member
0 Likes
625

Hi Kaki,

i hope t_det has only 3 fields, that are aufnr,xloek,kzear in the same order of select.

if not t_comp[] is initial.
  select aufnr
         xloek
         kzear 
   into  table t_det 
    from resb for all entries in t_comp    
   where aufnr = t_comp-aufnr.
endif.

regards

vijay

Read only

0 Likes
625

Thanks for all the replies.

points alloted

cheers

kaki

Read only

Former Member
0 Likes
625

If RESB is large, since you aren't using an index, this SELECT will always take a long time.

Rob