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: 

Advice about select in but000

Former Member
0 Kudos

Hi guys , I have a program with a very poor performance, executing st05 i´ve discovered several Fetchs to table but000 with this select :

SELECT partner name_org1 FROM but000
         INTO CORRESPONDING FIELDS OF TABLE it_but000
         WHERE type = c_type_2.

The key of table is only Business Partner Number.

I´m looking the best way of write this , could you give some advice ? , Should I create a index for field type ?

Thank you very much .

1 ACCEPTED SOLUTION

former_member222860
Active Contributor
0 Kudos

Declare your itab structure with the required fields and avoid use of INTO CORRESPONDING..

Check this:

data: begin of it_but000 occurs 0,
       partner like but000-partner,
       name_org1 like but000-name_org1,
     end of it_but000.


SELECT partner name_org1 FROM but000
         INTO TABLE it_but000.
        WHERE type = c_type_2.

loop at it_but000.
  write:/ it_but000-partner.
endloop.

6 REPLIES 6

Former Member
0 Kudos

Hi José

Try SELECTing type too.

Pushpraj

Former Member
0 Kudos

You should check which index is being accessed.

If it is same as your primary index, then chances of improvement are less.

You can request BASIS to create a new index and then you can check the performance.You will also have to analyse impact of doing so.

Also , you should try to avoid INTO CORRESPONDING FIELDS .

Hope its help you.

former_member222860
Active Contributor
0 Kudos

Declare your itab structure with the required fields and avoid use of INTO CORRESPONDING..

Check this:

data: begin of it_but000 occurs 0,
       partner like but000-partner,
       name_org1 like but000-name_org1,
     end of it_but000.


SELECT partner name_org1 FROM but000
         INTO TABLE it_but000.
        WHERE type = c_type_2.

loop at it_but000.
  write:/ it_but000-partner.
endloop.

Former Member
0 Kudos

This message was moderated.

kesavadas_thekkillath
Active Contributor
0 Kudos

if its too slow and if the requirement is critical.

Just try creating a secondary index.

Also just try with table BUT000_TD

Also check if there is any function module available for this

search in se37 with pattern BUPA*

Former Member
0 Kudos

HI

Go to Se11 then table BUT000

Click on button Indexes.

Create new Secondary Index with these two fields as Key fields.

then use this code:

data: begin of it_but000 occurs 0,

partner like but000-partner,

name_org1 like but000-name_org1,

end of it_but000.

SELECT partner name_org1 FROM but000

INTO TABLE it_but000.

WHERE type = c_type_2

%_HINTS ORACLE 'INDEX("Secondary Index keys")'.

For More details :

[;

Sourabh

Edited by: Sourabh Jain on Sep 18, 2009 12:07 PM