2006 Feb 05 10:00 AM
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
2006 Feb 05 10:57 AM
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
2006 Feb 05 11:06 AM
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.
2006 Feb 05 11:52 AM
Hi ,
But if we use join on Mseg and MKPf , will it use the indexes?
2006 Feb 06 4:35 AM
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.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |