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

Data selection from MKPF & MSEG

Former Member
0 Likes
1,193

Hi ,

I want to pick Material document number (MBLNR)and quantity in a RFC call from APO to R/3. My selection criteria are posting date, material number, plant and movement type.

What would be the best possible way to select data from performance point of view

1) Should I create a join on MPF and MSEg. OR

2) Is there a view which alread exists for these two tables.

Regards,

Sivyanshu

Hi ,

I want to pick Material document number (MBLNR)and quantity in a RFC call from APO to R/3. My selection criteria are posting date, material number, plant and movement type.

What would be the best possible way to select data from performance point of view

1) Should I create a join on MPF and MSEg. OR

2) Is there a view which alread exists for these two tables.

Regards,

Sivyanshu

4 REPLIES 4
Read only

Former Member
0 Likes
845

Hi

Try to see the view M_MKPF and CNMSEG.

Anyway you can also create an your own view for MKPF and MSEG table.

I'm not sure which is the faster solution, but you can try to compare tham.

Max

Read only

Former Member
0 Likes
845

Hi,

use simple statement as you have secondary index on

mkpf-budat

select from mkpf into it_mkpf

where budat = s_budat.

if not it_mkpf[] is initial.

select from mseg in to it_mseg

for all entries in it_mkpf

mblnr = it_mkpf-mblnr

mjahr = it_mkpf-mjahr

matnr in s_matnr

werks in s_werks

bwart in s_bwart.

Regards

Amole

endif.

Read only

0 Likes
845

Hi ,

But if we use join on Mseg and MKPf , will it use the indexes?

Read only

Former Member
0 Likes
845

Hi nikhil,

1. selection criteria are posting date, material number, plant and movement type.

Since MKPF and MSEG contain vast amount of data,

and looking to the selection-critera,

2. My opinion is that :

U should first select from MKPF.

(using posting date)

3. This will give u a specific number of records.

4. Then using that, u can once

again SELECT from MSEG

(taking into consideration the document number(s)

recevived in step 2.

5. USING JOINS DIRECTLY

WILL AFFECT THE PERFORMANCE.

(IT WILL TAX THE DATABASE SERVER

UNNECESSARILY FOR CRATING JOINS

ON THOUSANDS OF RECORDS.

regards,

amit m.