Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

perfromance issue

Former Member
0 Kudos
95

Hi all my program is going to dump in quality as i am using MSEG table based on ebeln and ebelp.

please check the query below.

data: begin of imseg occurs 0,

mblnr like mseg-mblnr,

mjahr like mseg-mjahr,

menge like mseg-menge,

ERFMG LIKE MSEG-ERFMG,

erfme like mseg-erfme,

ebeln like mseg-ebeln,

ebelp like mseg-ebelp,

end of imseg.

if not ekpo[] is initial.

select mblnr

mjahr

menge

erfmg

erfme

ebeln

ebelp

from mseg into table imseg

for all entries in iekpo

where ebeln = iekpo-ebeln and

ebelp = iekpo-ebelp.

endif.

8 REPLIES 8

Former Member
0 Kudos
67

Hi,

for the performance issue u hava to look up some stapes .

1. use internal table without header line.

( first structure then internal table .

data : < I tanble name > type standard table of < structure name > initial size 0.

2. Don't use select * , use required fields

3. don't use corresponding key word

4. from ST05 find out witch select statement is performance bad

5. use upper case letter

6. if performance bad then use secondary index.

7. avoid nested select statement.

Thaning uou,

subash.

Former Member
0 Kudos
67

Hi

You remove the duplicate entries from the EKPO and not use EBELP since these fields are not primary keys

also try use the primary keys from MSEG

You can use the table EKET (PO order History) to get the information which will be very fast

Try this and let me know

Regards

Shiva

Former Member
0 Kudos
67

Some small tuning that you can do:

1. Select the fields in the same order as in MSEG table.

2. Add this lines

Data: lt_ekpo type standard table of ekpo.

lt_ekpo[] = ekpo[].

sort lt_ekpo by ebeln ebelp.

delete adjacent duplicate from lt_ekpo comparing ebeln ebelop.

Now use this sorted and unique driver table to get data from MSEG.

Also seat with functional person and check if you can access MKPF first followed by MSEG. MKPF is the header table.

Former Member
0 Kudos
67

Dear Anand,

All the previous answers and recommendations are pretty good and should be realized specifically the table declaration (data: itab type standard table ...). I recognized an incorrect statement:

if not ekpo\[\] is initial. should be: if not iekpo[] is initial.

Heinz

Former Member
0 Kudos
67

In the coding i see that you have written ekpo and iekpo. Please decide whether youe internal table name is ekpo or iekpo.

Once you write the correct internal table it should work

Former Member
0 Kudos
67

Hi,

The program going for dump could be because the data is too much to be fiited into an internal table . Since you have selected on EBELN and EBELP which are not key fields of MSEG.

TRy using PACKAGE SIZE statement in your select clause. You will be able to restrict the number of records which come into your internal table.

Regards,

Soumya

Former Member
0 Kudos
67

Hi,

select mblnr

mjahr

menge

erfmg

erfme

ebeln

ebelp

from mseg

APPENDING table imseg

for all entries in iekpo

PACKAZE SIZE 20000

where ebeln = iekpo-ebeln and

ebelp = iekpo-ebelp.

ENDSELECT.

Change the package size according to your system performace

0 Kudos
67

Hi,

Any select query for a biger table(more data) needs to use table index in the query.

Please check if any index defined for table MSEG suits your requirement else create an table index.

It will work. If a select query is not using any index defined in the table then it will automatically take loger time and goes to dump.

Regards

Sunil Kumar P