Skip to Content
0
Sep 08, 2010 at 02:30 PM

Select - MKPF x MSEG

512 Views

Hi!

I'm with a problem in a selection of mkpf and mseg tables. I need to select some period of MKPF (i'm using the field budat) and after, select the MSEG table (of some materials).

I tried many diferent commands such as "Inner join" and "for all entries". In the case of "for all entries", the program blocked the mseg table many times and in the case of "inner join", the cost wasn't very good ... I had the help of a DBA Oracle, too. But when I wrote the command in ABAP, the execution was terrible !!!!

Somebody in this forum have the same problem any time? Do you know something to help me?

The command that I'm testing now is (after the help of the DBA Oracle):

SELECT amblnr bmjahr bzeile bmatnr bwerks blgort bcharg bshkzg b~menge

INTO CORRESPONDING FIELDS OF TABLE t_mseg

FROM mkpf AS a

INNER JOIN mseg AS b ON amblnr = bmblnr AND

amjahr = bmjahr

WHERE a~budat IN r_bldat AND

b~matnr IN r_matnr AND

b~werks = l_centro.