‎2009 Oct 30 5:43 AM
Hi Guriji,
I want to fetch the data from Mseg and mkpf table based on condion but it will take time. but are the condion we are written it will take lot of time .Plz tell what we are doing for this.
TABLES: mseg, mkpf.
DATA: BEGIN OF T_ITAB OCCURS 0,
MATNR TYPE mseg-MATNR,
WERKS TYPE mseg-WERKS,
BWART TYPE mseg-BWART,
BUDAT TYPE mkpf-BUDAT,
END OF T_ITAB.
START-OF-SELECTION.
SELECT-OPTIONS: plant FOR mseg-WERKS OBLIGATORY.
select amatnr awerks abwart bbudat into t_itab from mseg as a inner join mkpf as b
on amblnr = bmblnr
where awerks in plant and abwart = '201' or a~bwart = '261' .
COLLECT t_itab INTO t_itab.
endselect.
loop at t_itab.
WRITE:/ t_itab-matnr, t_itab-bwart, t_itab-budat,t_itab-werks.
endloop.
thanks
‎2009 Oct 30 5:49 AM
Hi Sachin
Avoid SELECT - END SELECT and select records into an internal table.
This will improve performance.
After this you can loop on the resultant internal table and can COLLECT records.
As per my understanding there is not need to use the collect statement. Please check this at your end.
Also , in place of abwart = '201' or abwart = '261' use
a~bwart in ( 201, 261 ).
Hope this help you
‎2009 Oct 30 5:49 AM
Hi Sachin
Avoid SELECT - END SELECT and select records into an internal table.
This will improve performance.
After this you can loop on the resultant internal table and can COLLECT records.
As per my understanding there is not need to use the collect statement. Please check this at your end.
Also , in place of abwart = '201' or abwart = '261' use
a~bwart in ( 201, 261 ).
Hope this help you