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

To improve performance for report

Hi Expert,

i have generated the opensales order report which is fetching data from VBAK it is taking more time exectuing in the forground itself.

it is going in to dump in foreground and i have executed in the background also but it is going in to dump.

SELECT vbeln

auart

submi

vkorg

vtweg

spart

knumv

vdatu

vprgr

ihrez

bname

kunnr

FROM vbak

APPENDING TABLE itab_vbak_vbap

FOR ALL ENTRIES IN l_itab_temp

*BEGIN OF change 17/Oct/2008.

WHERE erdat IN s_erdat AND

  • submi = l_itab_temp-submi AND

*End of Changes 17/Oct/2008.

auart = l_itab_temp-auart AND

*BEGIN OF change 17/Oct/2008.

submi = l_itab_temp-submi AND

*End of Changes 17/Oct/2008.

vkorg = l_itab_temp-vkorg AND

vtweg = l_itab_temp-vtweg AND

spart = l_itab_temp-spart AND

vdatu = l_itab_temp-vdatu AND

vprgr = l_itab_temp-vprgr AND

ihrez = l_itab_temp-ihrez AND

bname = l_itab_temp-bname AND

kunnr = l_itab_temp-sap_kunnr.

DELETE itab_temp FROM l_v_from_rec TO l_v_to_rec.

ENDDO.

Please give me suggession for improving performance for the programmes.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 10:28 AM

    did u check whether the internal table l_itab_temp that u r using in the FOR ALL ENTRIES clause is not blank.. coz if it is the query will jst filter the data on ERDAT in ur condition.

    Edited by: Ashwinee on Dec 18, 2008 4:00 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 10:30 AM

    r u using primary key in where condition?if not try to use prmary key & create secondary index for non-primary keys.

    in where condtions use more fileds.then performance will improve.

    Regards,

    Flavya

    Edited by: Flavya on Dec 18, 2008 11:30 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 10:31 AM
    • Run the report in SE30.. you will be able to analyse if DB fetches are consuming more time or ABAP.

    • When using FOR ALL ENTRIES try to include the key fields available.

    • Avoid DELETE on internal tables. Instead move the records to a new table and Append.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 10:35 AM

    sort l_itab_temp by all fields.

    check any secondary index is available and if available and l_itab_temp have those fields then try to give the same order in where clause.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 10:38 AM

    Hi,

    In the Select Query check:

    1. If the fields order in the select quesry is same as the order of the fields in the data base table.

    2. If the Where condition is having any primary key field if no try to check by using the primary key fields

    3.Before using for all entries always check if the table used in for all entries is having data or not.

    ie., if not i_temp_vbak_vbap[] is initial.

    select <fields>

    from <db table name>

    into table <internal table>

    for all entries in i_temp_vbak_vbap

    where < conditions>.

    endif.

    Regards

    Thabitha.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 11:12 AM

    hi,

    you try like this

    DATA:BEGIN OF itab1 OCCURS 0,

    vbeln LIKE vbak-vbeln,

    END OF itab1.

    DATA: BEGIN OF itab2 OCCURS 0,

    vbeln LIKE vbap-vbeln,

    posnr LIKE vbap-posnr,

    matnr LIKE vbap-matnr,

    END OF itab2.

    DATA: BEGIN OF itab3 OCCURS 0,

    vbeln TYPE vbeln_va,

    posnr TYPE posnr_va,

    matnr TYPE matnr,

    END OF itab3.

    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.

    START-OF-SELECTION.

    SELECT vbeln FROM vbak INTO TABLE itab1

    WHERE vbeln IN s_vbeln.

    IF itab1[] IS NOT INITIAL.

    SELECT vbeln posnr matnr FROM vbap INTO TABLE itab2

    FOR ALL ENTRIES IN itab1

    WHERE vbeln = itab1-vbeln.

    ENDIF.

    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.