Skip to Content
0
Former Member
Jan 22, 2007 at 11:41 AM

Increase performance of the following SELECT statement.

422 Views

Hi All,

I have the following select statement which I would want to fine tune.

CHECK NOT LT_MARC IS INITIAL.

SELECT RSNUM

RSPOS

RSART

MATNR

WERKS

BDTER

BDMNG FROM RESB

INTO TABLE GT_RESB

FOR ALL ENTRIES IN LT_MARC

WHERE XLOEK EQ ' '

AND MATNR EQ LT_MARC-MATNR

AND WERKS EQ P_WERKS

AND BDTER IN S_PERIOD.

The following query is being run for a period of 1 year where the number of records returned will be approx 3 million. When the program is run in background the execution time is around 76 hours. When I run the same program dividing the selection period into smaller parts I am able to execute the same in about an hour.

After a previous posting I had changed the select statement to

CHECK NOT LT_MARC IS INITIAL.

SELECT RSNUM

RSPOS

RSART

MATNR

WERKS

BDTER

BDMNG FROM RESB

APPENDING TABLE GT_RESB PACKAGE SIZE LV_SIZE

FOR ALL ENTRIES IN LT_MARC

WHERE XLOEK EQ ' '

AND MATNR EQ LT_MARC-MATNR

AND WERKS EQ P_WERKS

AND BDTER IN S_PERIOD.

ENDSELECT.

But the performance improvement is very negligible.

Please suggest.

Regards,

Karthik