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

Performance issue

Hi,

I am making hitting database using following Select query.

It is taking lots of time . It is making selection on View.

OPEN CURSOR l_mvmnt FOR "2D202626

SELECT mblnr

mjahr

budat

zeile

bwart

matnr

werks

FROM v_bam_mkpf

FOR ALL ENTRIES IN t_matnr_werks

WHERE budat IN r_sydatum AND

( bwart IN r_bwart OR

bwart IN r_bwart_rev ) and

MATNR = T_MATNR_WERKS-MATNR AND

werks = t_matnr_werks-werks.

DO.

REFRESH :lt_mvmnt.

*-- Fetch data from the cursor to the internal table

*-- based on the package size

FETCH NEXT CURSOR l_mvmnt INTO CORRESPONDING FIELDS OF

TABLE lt_mvmnt PACKAGE SIZE l_pkgsiz.

IF NOT sy-subrc IS INITIAL.

CLOSE CURSOR l_mvmnt.

EXIT.

ELSE.

APPEND LINES OF lt_mvmnt TO t_mvmnt.

ENDIF.

ENDDO.

I tried with various different values of package size also

But query is taking lots of time.

Thanks in Advance

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 01:08 PM

    well i didnt had a real close look on it, but a FOR ALL ENTRIES statement forces a full table scan. this is pobably a part of your performance problem.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 03:05 PM

    This view doesn't exist in any of our systems. Is it a view on MKPF and MSEG?

    I think I would start by getting rid of the CURSOR.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 03:09 PM

    Hi Shivani, try like this.

    try to use the MOVE CORREPOSDING FIELDS OF statement with the select query and see the difference,try to use the key field in the select query.

    Also,

    performance of the select statement might be low bcoz of the selection strategy you followed while coding the select statement. i think this link might help u to solve ur problem upto some extent

    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm

    hope this helps.

    kindly reward if found helpful.

    cheers,

    Hema.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.