Skip to Content
0
Former Member
Jul 31, 2009 at 05:08 AM

regarding select query

20 Views

hi gurus,

iam using one select query with joins... but it fetches data from table that having lakhs of data... so the query is giving performance issue, so what select query i will write to solve this issue...

THE CODE IS IS GIVEN BELOW

SELECT ABLDAT ABUDAT ACPUDT BMATNR SUM( BMENGE ) BBWART

INTO TABLE ITAB FROM MKPF AS A

INNER JOIN

MSEG AS B

ON BMBLNR = AMBLNR AND BMJAHR = AMJAHR

WHERE A~BLDAT IN ZDATE AND

B~BWART IN ('131', '132') AND

B~LGORT = 'FG01' AND

BKZBEW = 'F' GROUP BY ABLDAT ABUDAT ACPUDT BMATNR BBWART.

LOOP AT ITAB.

CNT = CNT + 1.

ITAB2-CNT = CNT.

ITAB2-BLDAT = ITAB-BLDAT.

ITAB2-BUDAT = ITAB-BUDAT.

ITAB2-CPUDT = ITAB-CPUDT.

ITAB2-MATNR = ITAB-MATNR.

ITAB2-MENGE = ITAB-MENGE.

ITAB2-BWART = ITAB-BWART.