2007 Jul 23 4:11 AM
Hi experts,
I have a problem with regards with the select from QMEL table, it takes too long to execute. Your input is very much appreciated.
IF i_sales_orders[] IS NOT INITIAL.
SELECT qmnum
vbeln
FROM viqmel
INTO TABLE i_viqmel
FOR ALL ENTRIES IN i_sales_orders
WHERE vbeln EQ i_sales_orders-vbeln.
ENDIF.
Regard,
Ng
Hi experts,
I have a problem with regards with the select from QMEL table, it takes too long to execute. Your input is very much appreciated.
IF i_sales_orders[] IS NOT INITIAL.
SELECT qmnum
vbeln
FROM viqmel
INTO TABLE i_viqmel
FOR ALL ENTRIES IN i_sales_orders
WHERE vbeln EQ i_sales_orders-vbeln.
ENDIF.
Regard,
Ng
2007 Jul 23 4:17 AM
Hi Ng,
In your case you are selecting from a DB view which is created by 3 tables and you are not using any key to retrieve the data.
In such cases there is not much to improve performance if you don't have all the keys, but you can try to use PACKAGE SIZE in your query so that it will not time out.
Regards,
Atish
2007 Jul 23 4:19 AM
2007 Jul 23 4:22 AM
Hi,
Still I think you can just use PACKAGE SIZE.
Regards,
Atish
2007 Jul 23 4:31 AM
Hi,
Create a secondary index for vbeln for QMEL after consultation with basis.
( For you info. Creating additional indexes will get affect the database performance )
aRs
2007 Jul 23 5:02 AM
Table QMEL appears to have an index by cuatomer/sales org/distrib channel/division/...etc (index MCK).
If what you are looking for is sales order data, then you should be able to read these fields from VBAK into your i_sales_order internal table first (primary key - should be quick), and then read a smaller volume of data from QMEL:
IF i_sales_orders[] IS NOT INITIAL.
SELECT qmnum
vbeln
FROM qmel
INTO TABLE i_viqmel
FOR ALL ENTRIES IN i_sales_orders
WHERE kumun = i_sales_orders-kunnr
AND vkorg = i_sales_orders-vkorg
AND vtweg = i_sales_orders-vtweg
AND spart = i_sales_orders-spart
AND vbeln EQ i_sales_orders-vbeln.
ENDIF.
2007 Jul 23 5:04 AM
Try using more constarints like notification type,matnr etc in where clause...mat be viqmel gives more performance than qmel...