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: 

select in afru table is slowly

former_member210823
Participant
0 Kudos

my query is it, but is not fast enough :

OPEN CURSOR WITH HOLD l_cursor FOR
select afru~RUECK afru~aufnr budat
from afru join CRHD ON AFRU~ARBID = CRHD~OBJID
join afpo on afru~aufnr = afpo~aufnr
where ARBPL in WS and
( AUERU = 'X' ) and ( SATZA = 'V40' )
and afru~STZHL = 00000000 and STOKZ = space
and budat in dat and afpo~matnr in MATERIAL.

WHILE NOT l_cursor IS INITIAL.
FETCH NEXT CURSOR l_cursor
appending TABLE it_conf
PACKAGE SIZE 5000.

IF sy-subrc EQ 0.
ELSE.
CLOSE CURSOR l_cursor.
ENDIF.

ENDWHILE.

1 REPLY 1

raymond_giuseppi
Active Contributor

You chould check if the standard index AFRU~3 and some customer index (?) on AUFNR on AFPO are active on your system. But first execute a SQL trace with ST05 and analyze the execution plan to find the access that cause the delay, also consider adding other tables to get better performance using available indexes.
Regards,
Raymond