03-18-2008 7:29 AM
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.
03-18-2008 7:32 AM
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
03-18-2008 8:40 PM
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
03-19-2008 3:34 AM
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
03-19-2008 1:11 PM
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.
03-20-2008 8:02 AM
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.
03-21-2008 9:20 AM
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
04-15-2008 6:50 AM
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.