Skip to Content
author's profile photo Former Member
Former Member

Performance issue

hi friends,

the below given select query is taking more time is there any way we can bring down the execution time

FORM z_select_data_bseg .

SELECT * FROM bseg

INTO CORRESPONDING FIELDS OF TABLE t_ref_bseg

FOR ALL ENTRIES IN t_payr

WHERE augbl EQ t_payr-vblnr

AND augdt EQ p_date

AND belnr NE t_payr-vblnr

AND bukrs EQ p_bukrs.

  • AND gjahr = t_payr-gjahr

  • AND lifnr IN s_lifnr.

IF NOT t_ref_bseg[] IS INITIAL.

CLEAR : t_bseg_v,t_bseg.

REFRESH: t_bseg_v,t_bseg.

thanks in advance

soorya

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 12:54 PM

    Do you need to select all the fields from BSEG? Can you use a field list with only those fields that you need to pull from BSEG?

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 12:56 PM

    1. Provide a field list instead of Select *

    2. make it "into table" instead of "into corresponding field of table"

    3. Try to check for the key fields like "belnr" in the begning of the where clause instead at the last.

    4. Check whether internal table t_payr is not initial before the select statement.

    Message was edited by: vinodh balasubramaniam

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 01, 2006 at 01:01 PM

    You are using no index, this access is doing a sequential read of BSEG by BUKRS only. Try to add BELNR to where clause.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2006 at 01:02 PM

    first,

    remove * in the select.

    place the fields in the order in which you defined the internal table t_ref_bseg.

    2.

    if you follow the same order in the SELECT as you define the internal table fields, no need to use CORRESPONDING FIELDS OF.

    dont use this

    3. fields in the WHERE condition should be the order in which they exists in the table. if you follow that, retreival will be faster.

    Regards

    srikanth

    Add comment
    10|10000 characters needed characters exceeded