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: 

performance issue

Former Member
0 Kudos

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.

endselect.

7 REPLIES 7

Former Member
0 Kudos

hi Anand,

MSEG table has huge data. So got to include all the key fields in the where condition of your select statement.

Key Fields to be included.

MBLNR

MJAHR

ZEILE

Regards,

Santosh

Former Member
0 Kudos

Hello Anand,

First, the select statement is not correct as it is presented in your thread: there is no ENDSELECT required. This failure should cause a simple check-error and this is not the reason for the dump.

MSEG is a huge table. Try to use ALL or as many as possible mseg key words in the where clause and try to restrict your entry table iekpo (best is 1 entry only).

Try it and press your thumbs,

Heinz

Former Member
0 Kudos

Anand ,

When you used INTO TABLE there is no need of " end select".

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.

Now it works fine

0 Kudos

Hi ,

Try this:

if not iekpo[] 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.

and 'End select' is not required here.

Former Member
0 Kudos

Hi Murali,

Madhumita Vasu has given you the correct solution

You have written ekpo[] instead iekpo[].

so below it should be iekpo[].

if not iekpo[] 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.

No need to put endselect here put endif only at last.Endselect is only used for the loop where one by one the data of a structure is put into the internal table.

Ok Take care ,bye.

With Regards.

Gaurav.

Former Member
0 Kudos

Hi,

As already said by many of our friends 'ENDSELECT' is not necessary, but I dont think that the problem you have mentioned is because of that.

As it is known that MSEG contains many records, so while fetching data from the table if we do not use keys then the select query takes longer time and gives short dump.

You need to use indexes here so that the data fetches fastly. Check if the existing Indexes helps you or try to create a new index for the table.

This should work and it will also. I personally had an issue similar to this and I have solved by using indexes.

Regards

Sunil Kumar

Former Member
0 Kudos

Since MSEG is a huge table it is causing the problem so make sure you are using all key fields.

Or if it is necessary to use this to field EBELN and EBELP than try making the secondary index in SE11 on this table than i think it will improve the performance of the select statement.