‎2007 Jun 19 10:41 AM
i have one select stm which comprises many join stms
due to this performances is degrading .
i need to split this .plz tell me how to do it.
select vlpma~matnr
lips~werks
lips~lfimg
lips~umvkz
lips~umvkn
lips~vbeln
lips~posnr
lips~meins
lips~vrkme
lips~vgbel
vbap~kzwi2
vbap~klmeng
kna1~name1
from vlpma
join vbuk
on vbukvbeln = vlpmavbeln
join lips
on lipsvbeln = vlpmavbeln and
lipsposnr = vlpmaposnr
join kna1
on vlpmakunag = kna1kunnr
join vbap
on lipsvgbel = vbapvbeln
and lipsvgpos = vbapposnr
into table it_assigned
for all entries in i_marc
where vlpma~matnr = i_marc-matnr
and vlpma~lfart in s_lfart
and vbuk~wbstk <> 'C'
AND lips~werks = i_marc-werks .
and lips~werks in s_werks
and lips~bwart <> '641'.
regards,
lokesh.
‎2007 Jun 19 10:43 AM
Hi,
Go for FOR ALL ENTRIES statement instaed of INNER JOINS.
Revert back if any issues,
Reward with points if helpful ,
Regards,
Naveen
‎2007 Jun 19 10:45 AM
HI,
Split the select statement and use FOR ALL ENTRIES statements instead of using joins to improve performance. Check whether the Internal table that you are making use in your select statement is empty or not...
i.e,
if not itab[] is initial.
endif.
‎2007 Jun 19 10:49 AM
please give me the total answer.
i dont know how to use for all entries .
please give the code.
‎2007 Jun 19 11:02 AM
Hi,
I guess u will have to create separate internal tables and den fetch the header level data initially..den using FOR ALL ENTRIES u can fetch the complete data. Refer to Help for usage of FOR ALL ENTRIES
Message was edited by:
nirav goradia