Application Development and Automation 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: 
Read only

Dump in simple select statement using MSEG and MKPF

Former Member
0 Likes
1,074

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
916

hi,

Rather than using Inner Join statement use FOR ALL ENTRIES statement ..

regards,

Santosh

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.

4 REPLIES 4
Read only

Former Member
0 Likes
917

hi,

Rather than using Inner Join statement use FOR ALL ENTRIES statement ..

regards,

Santosh

Read only

Former Member
0 Likes
916

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

Read only

Former Member
0 Likes
916

Well, the problem is that the select statement isn't using any index.

rob

Read only

0 Likes
916

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