2008 Apr 29 10:29 AM
select amblnr amjahr azeile amatnr alifnr aebeln
awerks amenge
b~budat
from mseg as a join mkpf as b on amblnr = bmblnr
and amjahr = bmjahr
into corresponding fields of table it_mseg
for all entries in it_vbap
where a~werks = p_werks
and a~bwart = '122'
and b~budat in s_budat
and a~matnr = it_vbap-matnr
and a~werks = it_vbap-werks.
endif.
can any one give alternate for this.........plz
2008 Apr 29 10:36 AM
hi,
IF NOT i_mara[] IS INITIAL.
SELECT mblnr " Material document
mjahr " Material doc. year
zeile " Item in material document
bwart " Movement type
matnr " Material number
werks " Plant
shkzg " Credit/Debit indicator
dmbtr " Amount in loc. currency
menge " Quantity
FROM mseg
INTO TABLE i_mseg
FOR ALL ENTRIES IN i_mara
WHERE matnr EQ i_mara-matnr
AND werks EQ p_werks
AND lgort IN r_lgort
AND bwart IN r_bwart
AND sobkz IN r_sobkz.
This uses secondary index on mseg table......
when u select more records... u program performance goes down....
No alternate for mseg table , I have tried a lot but no answers from any one...
try to improve performance on the other part of ur program...
Regards,
Priya
hi,
IF NOT i_mara[] IS INITIAL.
SELECT mblnr " Material document
mjahr " Material doc. year
zeile " Item in material document
bwart " Movement type
matnr " Material number
werks " Plant
shkzg " Credit/Debit indicator
dmbtr " Amount in loc. currency
menge " Quantity
FROM mseg
INTO TABLE i_mseg
FOR ALL ENTRIES IN i_mara
WHERE matnr EQ i_mara-matnr
AND werks EQ p_werks
AND lgort IN r_lgort
AND bwart IN r_bwart
AND sobkz IN r_sobkz.
This uses secondary index on mseg table......
when u select more records... u program performance goes down....
No alternate for mseg table , I have tried a lot but no answers from any one...
try to improve performance on the other part of ur program...
Regards,
Priya
2008 Apr 29 10:36 AM
hi,
IF NOT i_mara[] IS INITIAL.
SELECT mblnr " Material document
mjahr " Material doc. year
zeile " Item in material document
bwart " Movement type
matnr " Material number
werks " Plant
shkzg " Credit/Debit indicator
dmbtr " Amount in loc. currency
menge " Quantity
FROM mseg
INTO TABLE i_mseg
FOR ALL ENTRIES IN i_mara
WHERE matnr EQ i_mara-matnr
AND werks EQ p_werks
AND lgort IN r_lgort
AND bwart IN r_bwart
AND sobkz IN r_sobkz.
This uses secondary index on mseg table......
when u select more records... u program performance goes down....
No alternate for mseg table , I have tried a lot but no answers from any one...
try to improve performance on the other part of ur program...
Regards,
Priya
2008 Apr 29 10:48 AM
hi,
1. avoid into corresponding
2. split the join. first fetch the data from mseg. then based on the mblnr, mjahr and s_budat fetch the data from mkpf.
3. try to populate a range table for all werks put together.
regards,
madhu
2008 Apr 29 10:54 AM
hi
thanks.. today my first day of work... can u help me to optimize if i send u my program..plz plz...
2008 Apr 30 3:07 AM
Hi meena...
Your total Select Query is incorrect Could You tell Wht You need do actually...
regards,
sg.
2008 Apr 29 3:44 PM
Hi,
You can create a database view with this two tables and than select data from this view.
For my case and with this same tables, worked fine.
Regards,
Fernando
2008 Apr 30 3:17 AM
if not it_vbap[] is initial.
select amblnr amjahr azeile amatnr alifnr aebeln
awerks amenge b~budat
into corresponding fields of table it_mseg
from mseg as a
inner join mkpf as b on amblnr = bmblnr
and amjahr = bmjahr
for all entries in it_vbap
where a~werks = p_werks
and a~bwart = '122'
and b~budat in s_budat
and a~matnr = it_vbap-matnr
and a~werks = it_vbap-werks.
endif.
This could correct but I suggest You not to Hard Code Movement type and try to declare a type wht Fields You need.
Regards,
sg.
2008 May 01 2:18 PM
Hi ..
thanks ..its vendor performance report. it takes 20 hrs to run. i need to optimize...
i tried to run but its not showing any output... how to check..
2008 May 02 3:48 AM
Hi Meena,
Is only this Select query You are Using in your whole program, the better way to check is ...try to select the data separetly from one one table using For all entries then you wil come to know whether the data is selecting or not.
Try out..
regards,
sg.
2008 May 02 4:31 AM
Hi ..
1. Get the index of each table.
2. Used the field order selection from top to bottom if no table
index created in each table.
3. Select to table consuidering the foreign key first before
secondary.
Try out this...
if not it_vbap[] is initial.
select amblnr amjahr azeile amatnr alifnr aebeln awerks amenge b~budat
into table it_mseg
from mseg as a
inner join mkpf as b
on amandt = bmandt
and amblnr = bmblnr
and amjahr = bmjahr
for all entries in it_vbap
where a~werks = p_werks
and a~bwart = '122'
and b~budat in s_budat
and a~matnr = it_vbap-matnr
and a~werks = it_vbap-werks.
endif.
regards,
sg
2008 May 02 3:59 AM
Hi Meena,
One quick question, have you limited the data going into the select? I noticed that your for all entries table implies it's from VBAP (it_vbap) which could contain many entries for the same material/plant combinations.
Have you limited this table (or a subset) to contain only a SINGLE entry for each material/plant code?
(Just a thought).
Good luck with your tuning effort.
Andy
2008 May 02 11:05 AM
Hi,
MSEG
-
MANDT
MATNR
WERKS
BWART
MKPF
-
MANDT
BUDAT
If there is no index exists on the above fields, please create secondary index for the
above tables for improving the performance.
Please create histograms for tables MKPF and MSEG tables as mentioned in SAP Notes 902675 and 921164.
Also please ensure you have the value 5 for the following parameters.
rsdb/max_blocking_factor
rsdb/min_in_blocking_factor
Hope this helps
Regards
Dileep
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |