‎2008 Dec 19 10:31 AM
Hello All,
There is a performance issue with the below select query.
Select kunnr vtweg vtwku
from knvv into gt_knvv where kunnr = s_kunnr
and vkorg = gt_int-vkorg
and vtweg = gt_int-vtweg.
Gt_int is sorted by the primary keys and fields in "where" are in proper order.
But since there is no value in s_kunnr , the above statement is consuming 95% of the execution time.
Can any one of you suggest how to improve the performance?
Regards,
Sindhuri Vajjala
‎2008 Dec 19 10:46 AM
I think u are selecting large no of data that why it take more time.
to improve performance you can check with secondary index also.
‎2008 Dec 19 11:14 AM
did you ever hear about indexes ??? It is not more complicated than a telephone, know the name
get the telephone, know only first name and you will not find anything ... in reasonable time.
I can not see you table knw, but check SE11, how many records are in this table
what are the key fields
are there other indexes
Which fields of indexes appear in your where clause?
Siegfried
‎2008 Dec 19 11:27 AM
Hi
first of all check whether u are using key fields, indexes or not.
‎2008 Dec 23 3:52 AM
>
> Hello All,
>
> There is a performance issue with the below select query.
>
> Select kunnr vtweg vtwku
> from knvv into gt_knvv where kunnr = s_kunnr
> and vkorg = gt_int-vkorg
> and vtweg = gt_int-vtweg.
>
> Gt_int is sorted by the primary keys and fields in "where" are in proper order.
>
> But since there is no value in s_kunnr , the above statement is consuming 95% of the execution time.
>
> Can any one of you suggest how to improve the performance?
>
> Regards,
> Sindhuri Vajjala
One question, what is gt_int? Do you loop at gt_int?
I'm asking this because i can not see any for all entries in the select statement and wondering where does gt_int value came from.
Regards,
Abraham
‎2008 Dec 31 7:18 AM
Hi.
The issue is with your where condition vkorg = gt_int-vkorg and vtweg = gt_int-vtweg only. Instead GT_INT use some variables or constants in the select query.
Regards
Balaji.G
‎2009 Jan 02 1:38 AM
Hello Poornima,
Table KNVV Customer Master Sales Data & where clause is using index key fields.
Is s_kunnr variable of selection screen field?
If yes then you should have used where kunnr IN s_kunnr (not the equal sign = )
Gt_int an internal table should be used as 'for all entries', pls ref link for code example-
http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3a1f358411d1829f0000e829fbfe/content.htm
search for word 'Tabular Conditions'.
Once you modify select query let us know how is the result and will assist if any issue.
Thank You,
Nishikant.
‎2009 Jan 02 7:56 AM
Hi,
Use IN operator with S_KUNNR.
Is GT_INT is internal Table with Header Line? If yes, does Header Line got some values.
Instead of using GT_INT fields , better use some temp var's and transfer the values in that Temp var's.
‎2009 Jan 02 9:40 AM
HI....
1. When ever u r using select options use IN in where condition.
2. FInd out what r key fileds in the table and filter selection by adding all possible fields.
3. INTO TABLE clause is mandatory.
4. try to make selection options and parameters using in this SELECT mandatory.
‎2009 Jan 02 10:53 AM
Hi Poornima,
Please follow up with Siegfried Boes answer.
Regards,
Jyothi CH.