2010 May 26 9:45 AM
SELECT SINGLE ALNUM INTO P_ITAB-ALNUM_AL FROM MAEX
JOIN MARC ON MARCMATNR = MAEXMATNR
JOIN T001W ON T001WWERKS = MARCWERKS
WHERE MAEX~MATNR = P_VBPLP-MATNR
AND MARC~WERKS = T_VBDPL-WERKS
AND MAEXALAND = T001WLAND1
AND MAEX~GEGRU = 'DE'.
can any one suugest the best way to modify the above statement to improve the performence.
Thanks,
khasim.
2010 May 26 10:26 AM
Hi,
SELECT SINGLE ALNUM INTO P_ITAB-ALNUM_AL FROM MAEX
JOIN MARC ON MAEX~MATNR = MARC~MATNR
JOIN T001W ON MAEX~ALAND = T001W~LAND1
WHERE MAEX~MATNR = P_VBPLP-MATNR
AND MAEX~GEGRU = 'DE'.
AND MARC~WERKS = T_VBDPL-WERKS
AND T001W-WERKS = T_VBDPL-WERKS.I have made the WHERE clause free from the comparison of two table fields and changed the second JOIN. The selection criteria, however is same as the SELECT query provided by you.
Try this query and positively let me know about its performance.
Regards,
Jayesh
2010 May 26 10:15 AM
Hi,
you´re extracting information from MAEX only, so why do you read from MARC and above all from T001W ?? No wonder you have performance problems.
Select single ALNUM
into p_itab-alnum
from MAEX
where MATNR = P_VBPLP-MATNR
and ALAND = 'DE'
and GEGRU = 'DE'.You still have to explain where you get the information about the departure country for ALAND.
2010 May 26 10:26 AM
Hi,
SELECT SINGLE ALNUM INTO P_ITAB-ALNUM_AL FROM MAEX
JOIN MARC ON MAEX~MATNR = MARC~MATNR
JOIN T001W ON MAEX~ALAND = T001W~LAND1
WHERE MAEX~MATNR = P_VBPLP-MATNR
AND MAEX~GEGRU = 'DE'.
AND MARC~WERKS = T_VBDPL-WERKS
AND T001W-WERKS = T_VBDPL-WERKS.I have made the WHERE clause free from the comparison of two table fields and changed the second JOIN. The selection criteria, however is same as the SELECT query provided by you.
Try this query and positively let me know about its performance.
Regards,
Jayesh
2010 Nov 25 4:13 PM