Skip to Content
0
Former Member
Nov 08, 2006 at 02:36 PM

ABAP Code performance

55 Views

Hi Guys,

The following code seems to be taking considerable time in production. Is there a better way to optimize theis code.

LOOP AT I_T_DATA...

SELECT SINGLE BUKRS

INTO (l_bukrs)

FROM T001K

WHERE T001K~BWKEY = I_T_DATA-WERKS.

SELECT SINGLE TARGET1 TARGET2

INTO (l_salesorg, l_dischan)

from ZDERIV

where VALID_FROM le sy-datum

and SOUR3_FROM le I_T_DATA-prctr

and SOUR3_TO ge I_T_DATA-prctr

and SOUR2_FROM le l_bukrs

and SOUR2_TO ge l_bukrs

and SOUR1_FROM = 'C100'

and SOUR1_TO = 'C100'.

CASE sy-subrc.

when 0.

SELECT SINGLE PRODH

INTO I_T_DATA-zzPRODH

from mvke

where matnr eq I_T_DATA-matnr

and vkorg eq l_salesorg

and vtweg eq l_dischan.

WHEN 4.

Clear: l_salesorg, l_dischan.

ENDCASE.

Thanks