Application Development 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: 

Performace of resb table

deepak_dhamat
Active Contributor
0 Kudos

Dear All,

I have one Performance issue , my problem is the query given below

Takes much more time than Expected were i retreive data from resb table only by passing EBELN and WERKS .I am using key fields also still my performance is not increased so tell me how to increase performance .

SELECT rsnum

rspos

rsart

werks

baugr

ebeln

matnr

bdmng

enmng

lifnr

ebelp

ebele

INTO CORRESPONDING FIELDS OF TABLE it_disp

FROM resb

WHERE rsnum NE 0

AND rspos NE ''

  • AND rsart = rsart

AND werks = p_werks

AND ebeln = p_ebeln .

Thanks And Regards .

Deepak Dhamat .

9 REPLIES 9

Former Member
0 Kudos

hi,

please avoid using INTO CORRESPONDING FIELDS OF TABLE .

thanks

0 Kudos

Hi Rimpa ,

Thanks For Reply .

If we will not use into corresponding fields of table then what to use as using select ENDselect is not good option or neither into table as situation is same still

and my final table fields are more and data in resb table is huge .

Thanks And Regards

Deepak

Former Member
0 Kudos

Declare the structure of the internal table with the same fields as that we select from resb table and avoid "Corresponding fields".

Also mention the key fields and required conditions in where clause of select query.

Former Member
0 Kudos

Try getting plant and ebeln(if its a Purchase order no. field) from EKPO into an internal table say it_ekpo.

Delete adjacent duplicates from it_ekpo.

Now use FOR ALL ENTRIES on ur IT_EKPO to fetch data from RESB table. It will increase the code lines but i think performance will b better. U can give it a try.

Former Member
0 Kudos

Hello

Create secondary index by WERKS and EBELN.

Former Member
0 Kudos

Hi,

Try like this, this improves ur select queary performace,

select rsnum rspos rsart matnr werks bdmng enmng baugr ebeln ebelp ebele lifnr

from resb into TABLE it_disp

WHERE rsnum NE 0

AND rspos NE ''

  • AND rsart = rsart

AND werks = p_werks

AND ebeln = p_ebeln .

Also create strcuture for this & field sequence shd be same as of select query.

for example,

begin of ty_disp,

rsnum type rsnum,

rspos type rspos,

rsart.....

end of ty_disp.

it_disp type table of ty_disp.

Thanks & Reagrds,

Anagha Deshmukh

0 Kudos

Hi Anagha ,

I have created structure of fields which i am selecting in query i. e w_disp1 and created internal table it_dispt .

And The rest is below .

code is working fine but need to test on production server will test and Reply .

SELECT rsnum

rspos

rsart

werks

baugr

ebeln

matnr

bdmng

enmng

lifnr

ebelp

ebele

INTO TABLE it_dispt

FROM resb

WHERE rsnum NE 0

AND rspos NE ''

  • AND rsart = rsart

AND werks = p_werks

AND ebeln = p_ebeln .

LOOP AT it_dispt .

MOVE : it_dispt-rsnum TO it_disp-rsnum ,

it_dispt-rspos TO it_disp-rspos ,

it_dispt-rsart TO it_disp-rsart ,

it_dispt-werks TO it_disp-werks ,

it_dispt-baugr TO it_disp-baugr ,

it_dispt-ebeln TO it_disp-ebeln ,

it_dispt-matnr TO it_disp-matnr ,

it_dispt-bdmng TO it_disp-bdmng ,

it_dispt-enmng TO it_disp-enmng ,

it_dispt-lifnr TO it_disp-lifnr ,

it_dispt-ebelp TO it_disp-ebelp ,

it_dispt-ebele TO it_disp-ebele .

APPEND it_disp.

CLEAR it_dispt.

Thanks For Your Suggestion

ANd Also for others who have replied .

Deepak Dhamat .

0 Kudos

Ur most welcome.

Thanks & Regards,

Anagha Deshmukh

Former Member
0 Kudos

Hi,

In where clause Don't use NE...

its better to get all records and delete the records which are not requried..

select *

from KNA!

into ITAB

where LAND1 NE 'IN'.. " This is not correct

select *

from KNA!

into ITAB.

delete ITAB where LAND1 EQ 'IN' " This is correct

Kiran