09-18-2009 9:57 AM
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 .
09-18-2009 10:03 AM
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.
09-18-2009 10:01 AM
09-18-2009 10:02 AM
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.
09-18-2009 10:03 AM
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.
09-18-2009 10:14 AM
09-18-2009 10:18 AM
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*
09-18-2009 11:05 AM
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