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

Performance Issue

Former Member
0 Likes
497

Hi Guys,

Need some suggestions to improve performance of following select query.

data:i_items LIKE yweb_po_view OCCURS 0 WITH HEADER LINE,

SELECT * FROM yweb_po_view INTO TABLE i_items

WHERE eindt BETWEEN vdatu_from and vdatu_to

and bukrs = company_code

and LOEKZ_EKPO = ''

AND pstyp IN r_pstyp

AND emlif = i_vendor-lifnr

AND lblkz = 'X'

AND elikz <> 'X'.

yweb_po_view is view with combination of four standard tables.

EKKO

EKPO

EKET

MARA

Thanks in Advance,

Harkamal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
478

Try to write down internal table without header...

types : begin of ty_data ,

fld1,

fld2,

end of ty_data.

data i_data type standard table of ty_data.

data wa_data like line of i_data.

use where conditions properly,and select only few fiedls if possible.

Rewards points if it is helpful

Thanks

Seshu

3 REPLIES 3
Read only

Former Member
0 Likes
479

Try to write down internal table without header...

types : begin of ty_data ,

fld1,

fld2,

end of ty_data.

data i_data type standard table of ty_data.

data wa_data like line of i_data.

use where conditions properly,and select only few fiedls if possible.

Rewards points if it is helpful

Thanks

Seshu

Read only

Former Member
0 Likes
478

Do not use 'SELECT *' instead of that use SELECT the required fields from i_items.

Secondly please check the View. I am sure there must be some thing wrong out there when you want to make the view with four tables. Please look there once again.

Regards,

Subhasish

Read only

Former Member
0 Likes
478

Hi harkamal,

Please avoid VIEW and put the data into the separate internal tables and then loop at EKKO and Read rest table

Select *  into <IT_EKKO>
         from EKKO 
         where <condition>

Select rest other tables with condition.

Now Sort ALL Internal Table.

LOOP AT IT_EKKO.
  READ TABLE IT_EKPO WITH KEY EBELN = IT_EKKO-EBELN BINARY SEARCH.
  IF SY-SUBRC = 0.
    <INSERT INTO FINAL INTERNAL TABLE.
  ENDIF.
  ----- Put Read command to other internal table and put it into the final table <i_itmes>
   APPEND I_ITEMS.
ENDLOOP.

This would diffinately increase the perfomance.....