Skip to Content
-1

select in afru table is slowly

Jan 08, 2017 at 07:41 AM

87

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raymond Giuseppi
Jan 09, 2017 at 07:24 AM
2

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

Share
10 |10000 characters needed characters left characters exceeded