Skip to Content
0
Former Member
May 13, 2009 at 06:53 PM

Please validate my logic performance point of view:

11 Views

Please validate my logic performance point of view:

logic I wrote :

LOOP AT i_mara INTO wa_mara.

*-----For material description, go to makt table.

SELECT SINGLE maktx

FROM makt

INTO l_maktx

WHERE matnr = lwa_mara-matnr

AND SPRAS = 'E'.

IF sy-subrc = 0.

wa_mara-MAKTX = l_maktx.

ENDIF. " IF sy-subrc = 0.

*-----For Recurring Inspection, go to marc table.

SELECT prfrq

FROM marc

INTO l_prfrq

UP TO 1 ROWS

WHERE matnr = lwa_mara-matnr.

ENDSELECT.

IF sy-subrc = 0.

wa_mara-prfrq = l_prfrq.

ENDIF. " IF sy-subrc = 0.

MODIFY TABLE i_mara FROM wa_mara

TRANSPORTING maktx.

CLEAR : wa_mara.

ENDLOOP. " LOOP AT i_mara INTO wa_mara.

Or is it better below : ?

To SELECT all the maktx values from makt and all prfrq values from marc

in two internal tables and

Loop at i_mara.

LOOP at all maktx itab

and pass corresponding maktx values into i_mara table

and pass corresponding prfrq values into i_mara table

ENDLOOP.

OR

is there any better performance logic you suggest ?

THANKS IN ADVANCE.