Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

[Performance Tuning] Select from QMEL

Former Member
0 Likes
1,474

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

6 REPLIES 6
Read only

Former Member
0 Likes
1,115

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

Read only

Former Member
0 Likes
1,115

Hi experts,

My mistake its from QMEL not VIQMEL

Read only

0 Likes
1,115

Hi,

Still I think you can just use PACKAGE SIZE.

Regards,

Atish

Read only

former_member194669
Active Contributor
0 Likes
1,115

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

Read only

Former Member
0 Likes
1,115

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.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,115

Try using more constarints like notification type,matnr etc in where clause...mat be viqmel gives more performance than qmel...