Skip to Content
0
Former Member
Jun 26, 2007 at 02:48 PM

perfomance tuning

28 Views

hi,

can any one can give alternative code for select statement in the code, to increase the perforamnce i have

to change it.

plz forward the code.

SELECT maramatnr marcwerks maramtart maramatkl mara~meins

marcdismm marcdispo marcdisgr marcmmsta marc~perkz

marc~periv

FROM mara

INNER JOIN marc

ON maramatnr = marcmatnr

INTO CORRESPONDING FIELDS OF TABLE it_alv

WHERE mara~matnr IN so_matnr

AND mara~matkl IN so_matkl

AND mara~mtart IN so_mtart

AND marc~werks IN so_werks

AND marc~disgr IN so_disgr

AND marc~dismm IN so_dismm

AND marc~dispo IN so_dispo.

DESCRIBE TABLE it_alv LINES w_nbitems.

l_count = 0.

LOOP AT it_alv INTO is_alv.

l_tabix = sy-tabix.

l_count = l_count + 1.

PERFORM sr_progress_bar USING l_count

w_nbitems

text-m02.

  • Read last stock movement for selected material

SELECT mkpfbudat mkpfmblnr mkpfmjahr msegzeile mseg~bwart

msegmenge msegkostl mkpfusnam msegwempf

UP TO 1 ROWS

FROM mseg

JOIN mkpf

ON mkpfmblnr = msegmblnr

AND mkpfmjahr = msegmjahr

INTO (is_alv-budat, is_alv-mblnr, is_alv-mjahr, is_alv-zeile,

is_alv-bwart, is_alv-menge, is_alv-kostl, is_alv-usnam,

is_alv-wempf)

WHERE mseg~matnr = is_alv-matnr

AND mseg~werks = is_alv-werks

AND mseg~bwart IN so_bwart

ORDER BY MKPF~BUDAT descending.

ENDSELECT.

IF is_alv-budat >= w_startdate. " OR is_alv-budat IS INITIAL.

DELETE it_alv INDEX l_tabix.

CONTINUE.

ENDIF.

*Message was edited by:

Mohammed Toufeeq

Message was edited by:

Mohammed Toufeeq