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

SELECT

Former Member
0 Likes
629

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.

4 REPLIES 4
Read only

Former Member
0 Likes
569

Hi,

Go for FOR ALL ENTRIES statement instaed of INNER JOINS.

Revert back if any issues,

Reward with points if helpful ,

Regards,

Naveen

Read only

Former Member
0 Likes
569

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.

Read only

0 Likes
569

please give me the total answer.

i dont know how to use for all entries .

please give the code.

Read only

Former Member
0 Likes
569

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