2007 Feb 06 3:16 PM
hi experts,
1. i am getting the dump and time out in the following statement....
SELECT AMBLNR AGRTXT BWERKS BBUDAT B~BLDAT
INTO CORRESPONDING FIELDS OF TABLE IT_ITAB FROM
MKPF AS A INNER JOIN MSEG AS B ON AMBLNR = BMBLNR
WHERE
AWERKS IN SO_WERKS AND and APRCTR in so_profitcnter AND
( ABWART = '542' OT ABWART = '121' ).
Note: A~PRCTR (idont remember prctr is correct field name above but i used correct field name in my program)
i found mseg and mkpf have more han 54lakhs and 17 lakhs of records..
i have only two select options to shrink the data selection.
2. Is it advisable to use many LOOP AT IT_ITAB(more than 5) statements to fetch some other data from lfa1, reason text tables....etc.,
note: it_itab contains huge data.
2007 Feb 06 3:18 PM
hi,
Rather than using Inner Join statement use FOR ALL ENTRIES statement ..
regards,
Santosh
2007 Feb 06 3:18 PM
hi,
Rather than using Inner Join statement use FOR ALL ENTRIES statement ..
regards,
Santosh
2007 Feb 06 3:21 PM
Hi saravanan,
Reomve the into corresponding field of statement and declare the fields in the internal table it_itab as the same order of the fields in the select clause.
and include the GJAHR field for the inner join.
SELECT AMBLNR AGRTXT BWERKS BBUDAT B~BLDAT
INTO TABLE IT_ITAB FROM
MKPF AS A INNER JOIN MSEG AS B ON ( AMBLNR = BMBLNR <b>and aGJAHR = bgjahr )</b>
WHERE
AWERKS IN SO_WERKS AND and APRCTR in so_profitcnter AND
( ABWART = '542' OT ABWART = '121' ).
Regards,
Ravi
2007 Feb 06 3:32 PM
Well, the problem is that the select statement isn't using any index.
rob
2007 Feb 06 3:56 PM
Hi
Rob is right!
See your WHERE condition:
WHERE
AWERKS IN SO_WERKS AND and APRCTR in so_profitcnter AND
( ABWART = '542' OT ABWART = '121' ).
All these fields are not used by indexes of MKPF and MSEG
Max