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

Performance Issue

Hi Frnds ,

Im Having one internal table tl_soline1 .which fetches data from vbak,vbap,vbek.

for this im using inner joins .

But it is giving Performance problem . For executing it is taking some much time.

please Look in to the code once & give me the Solutions.

TYPES : BEGIN OF tp_soline1,

vbeln TYPE vbak-vbeln, "Order ID(10)

erdat TYPE erdat, "MOD43

ernam TYPE ernam, "MOD43

auart TYPE vbak-auart, "Sales type

lifsk TYPE vbak-lifsk, "Delivery block

faksk TYPE vbak-faksk, "Billing block

netwr TYPE vbak-netwr, "Order Net value

vtweg TYPE vtweg ,

vdatu TYPE vbak-vdatu, "Requested del. date

bstnk TYPE vbak-bstnk, "PO Number

bstdk TYPE vbak-bstdk, "PO Date

kunnr TYPE vbak-kunnr, "Customer (soldtoparty)

zz_prime TYPE zzprime,

zz_dpas TYPE zzdpas,

posnr TYPE vbap-posnr, "Item(6)

matnr TYPE vbap-matnr, "Part Name(18)

kdmat TYPE matnr_ku,

kwmeng TYPE vbap-kwmeng,"Order Quantity(13)

werks TYPE vbap-werks, "Site

vstel TYPE vbap-vstel, "Site(4)

netpr TYPE vbap-netpr, "UnitSelling Price(11)

mvgr1 TYPE mvgr1,

mvgr2 TYPE mvgr2,

mvgr3 TYPE mvgr3,

mvgr4 TYPE mvgr4,

mvgr5 TYPE mvgr5,

ps_psp_pnr TYPE vbap-ps_psp_pnr , "WBS Element

bedae TYPE bedae,

adpri TYPE vbap-adpri, "Order priority

zz_clin TYPE vbap-zz_clin, "Customer contract line item

etenr TYPE vbep-etenr, "Schedule Line

ettyp TYPE vbep-ettyp, "Schedule Line category

lfrel TYPE vbep-lfrel,

edatu TYPE vbep-edatu, "Due date

wmeng TYPE vbep-wmeng, "Ord quant in sales units

lmeng TYPE vbep-lmeng, "Shipped Quantity

mbdat TYPE vbep-mbdat, "Material availability date

END OF tp_soline1.

DATA : tl_soline1 TYPE STANDARD TABLE OF tp_soline1

WITH HEADER LINE,

SELECT vbakvbeln vbakerdat

vbakernam vbakauart

vbaklifsk vbakfaksk

vbaknetwr vbakvtweg

vbakvdatu vbakbstnk

vbakbstdk vbakkunnr

vbakzz_prime vbakzz_dpas

vbapposnr vbapmatnr

vbapkdmat vbapkwmeng

vbapwerks vbapvstel

vbapnetpr vbapmvgr1

vbapmvgr2 vbapmvgr3

vbapmvgr4 vbapmvgr5

vbapps_psp_pnr vbapbedae

vbapadpri vbapzz_clin

vbepetenr vbepettyp

vbeplfrel vbepedatu

vbepwmeng vbeplmeng

vbep~mbdat

FROM vbak

INNER JOIN vbap

ON vbakvbeln = vbapvbeln

INNER JOIN vbep

ON vbepvbeln = vbapvbeln

AND vbepposnr = vbapposnr

INTO TABLE tl_soline1

WHERE vbak~auart IN s_saletp

AND vbap~werks IN s_lsite

AND vbep~etenr IN r_etenr

AND vbap~matnr IN s_matnr .

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 09:50 AM

    HI

    AVOID INNER JOINS AND USE FOR ALL ENTRIES

    BECAUSE IF YOU USE JOINS FOR 3 OR MORE TABLES THAN THE LOAD ON DATA BASE WILL BE VERY HIGH

    IF YOU USE JOINS THEN THE DATA BASE CONNECTION EXIST UP TO THE PROGRAM EXECUTION RESULT IN WHICH THE LOAD ON DATABASE PERFORMANCE WILL REDUCE

    IF YOU USE FOR ALL ENTRIES IT ALSO DONES SAME RESULT AS JOINS DONE

    ADVANTAGE IS THERE IS NO DATABASE CONNECTION FOR THIS

    IT WILL RETRIVE THE DATA FROM DATA BASE TABLE AT ONCE

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 12:25 PM

    hi,

    avoid using more than 1 inner joins as it effects your program performance.

    if it is required to take data from more than 2 tables than use for all entries.

    again it depends on ur data contents and ur where clause.

    if u r fetching data from header table and item table and if both have got the document number than u can use inner joins but if the item table does not have document no. than for one header data it will give one item detail and for multiple item data it will repeat the header data. thus giving redundant data.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 02:25 PM

    Your problem is that you are not using an index in your SELECT. Using FOR ALL ENTRIES will not improve it.

    There is a secondary index table - VAPMA (Sales Index: Order Items by Material) that is indexed by material. You should use that in your SELECT.

    Rob

    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.