Skip to Content
0
Former Member
Jan 07, 2009 at 08:04 AM

Performance tuning of Select -- Endselect with aggregate functions.

50 Views

Hi all,

Please give any direction in tuning performance of following query.

First select statement can be easily separated whereas for second one if we use for all entries then

aggregate functions are not supported. Please give any probable solution.

SELECT * FROM TABLE1 INTO WA_1 WHERE A = P_A

AND B IN S_B

AND C = ' '

AND D IN S_D

AND ( E EQ 'HST'

OR E EQ 'HSN' ).

IF SY-SUBRC <> 0.

MESSAGE E050.

ENDIF.

APPEND WA_1 TO I_1.

SELECT A F D G B H

SUM( I ) SUM( J )

SUM( K ) SUM( L ) SUM( M )

APPENDING TABLE I_2

FROM TABLE2 WHERE D = WA_1-D

AND B IN S_B

AND H IN S_H

GROUP BY A E D G B H

.

ENDSELECT.