(9I) INDEX의 사용여부 확인하기
제품 : ORACLE SERVER
작성날짜 : 2002-04-03
(9I) INDEX의 사용여부 확인하기
==============================
PURPOSE
Oracle9i에서는 만들어진후 사용되지 않은 index을 찾을수 있는 feature가
소개되었다.
Explanation
ALTER INDEX MONITORING USAGE 절을 이용하여 작업 시간동안 사용되지 않는
index을 찾을 수 있다.
Example
< Simple Example >
1. Sample table and data를 생성한다.
create table products
(prod_id number(3),
prod_name_code varchar2(5));
insert into products values(1,'aaaaa');
insert into products values(2,'bbbbb');
insert into products values(3,'ccccc');
insert into products values(4,'ddddd');
commit;
2. 1번에서 만든 table에 Primary Key index를 만든다.
SQL> alter table products
add (constraint products_pk primary key (prod_id));
3. v$object_usage을 query하여 본다.
: 아직 monitoring이 start되지 않았음을 알수 있다.
SQL> column index_name format a12
SQL> column monitoring format a10
SQL> column used format a4
SQL> column start_monitoring format a19
SQL> column end_monitoring format a19
SQL> select index_name,monitoring,used,start_monitoring,end_monitoring
from v$object_usage;
no rows selected
4. Index의 사용여부를 확인하기 위해 monitoring을 시작한다.
SQL> alter index products_pk monitoring usage;
Index altered.
5. v$object_usage를 query하여 monitoring중인지를 확인할수 있다.
: MONITORING column이 'YES', START_MONITORING column이 시작한 날짜.
SQL> select index_name,monitoring,used,start_monitoring,end_monitoring
from v$object_usage;
INDEX_NAME MONITORING USED START_MONITORING END_MONITORING
PRODUCTS_PK YES NO 04/02/2002 16:11:56
6. Test를 위해 index를 사용하는 select 문장을 수행한다.
필요하다면 index을 타고 있는지를 학인하기 위해 Autotrace utility 를
사용하기 위해 plan_table을 만들어 학인한다.
( Bulletin 10712 : NEW FEATURE:AUTOTRACE IN SQL*PLUS 3.3 참조)
@$ORACLE_HOME/rdbms/admin/utlxplan
Table created.
SQL> set autotrace on explain
SQL> select * from products where prod_id = 2;
PROD_ID PROD_NAME_
2 bbbbb
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE
1 0 TABLE ACCESS (BY INDEX ROWID) OF 'PRODUCTS'
2 1 INDEX (UNIQUE SCAN) OF 'PRODUCTS_PK' (UNIQUE)
SQL> set autotrace off
7. v$object_usage을query하여 index가 사용되어진 여부을 확인할 수 있다.
: USED column이 'YES'
select index_name,monitoring,used,start_monitoring,end_monitoring
from v$object_usage;
INDEX_NAME MONITORING USED START_MONITORING END_MONITORING
PRODUCTS_PK YES YES 04/02/2002 16:11:56
8. Index사용여부을 monitoring하는 것을 stop한다.
SQL> alter index products_pk nomonitoring usage;
Index altered.
9. v$object_usage를 query하여 monitoring이 stop되었는지 확인할수 있다.
: MONITORING column이 'NO', END_MONITORING column이 stop한 날짜.
SQL> select index_name,monitoring,used,start_monitoring,end_monitoring
from v$object_usage;
INDEX_NAME MONITORING USED START_MONITORING END_MONITORING
PRODUCTS_PK NO YES 04/02/2002 16:11:56 04/03/2002 11:05:30
< Database 전체의 모든 index에 대해 monitoring >
1. SYS와 SYSTEM user 소유의 index을 제외하고 모든 index에 대해
monitoring을 시작하도록 script을 만들어 보자.
set heading off
set echo off
set feedback off
set pages 10000
spool startmonitor.sql
select 'alter index '||owner||'.'||index_name||' monitoring usage;'
from dba_indexes
where owner not in ('SYS','SYSTEM');
spool off
2. SYS와 SYSTEM user 소유의 index을 제외하고 모든 index에 대해
monitoring 을 stop하도록 script을 만들어 보자.
set heading off
set echo off
set feedback off
set pages 10000
spool stopmonitor.sql
select 'alter index '||owner||'.'||index_name||' nomonitoring usage;'
from dba_indexes
where owner not in ('SYS','SYSTEM');
spool off
3. ALTER ANY INDEX system privilege을 가지고 있는 user에서 1번에서 만든
script을 돌리도록 한다.
@startmonitor
4. database의 정상 가동을 수행한다. (
5. 일정시간이 흐른후에 ALTER ANY INDEX system privilege을 가지고 있는
user에서 monitoring을 stop하기 위해 2번에서 만든 script을 돌리도록
한다.
@stopmonitor
6. v$object_usage을 query하여 한번도 사용되지 않은 index을 확인한다.
select d.owner, v.index_name
from dba_indexes d, v$object_usage v
where v.used='NO' and d.index_name=v.index_name;
참고 > v$object_usage view는 connect하는 user에 대한 내용만 display
하므로 SYS user에서 다른 user의 monitoring현황을 보고자 한다면
아래와 같이 view을 만든다.
SQL> connect / as sysdba;
Connected.
SQL> create or replace view V$ALL_OBJECT_USAGE
(INDEX_NAME,
TABLE_NAME,
MONITORING,
USED,
START_MONITORING,
END_MONITORING)
as
select io.name, t.name,
decode(bitand(i.flags, 65536), 0, 'NO', 'YES'),
decode(bitand(ou.flags, 1), 0, 'NO', 'YES'),
ou.start_monitoring,
ou.end_monitoring
from sys.obj$ io, sys.obj$ t, sys.ind$ i,
sys.object_usage ou
where i.obj# = ou.obj#
and io.obj# = ou.obj#
and t.obj# = i.bo#;
View created.
SQL> select * from v$all_object_usage;
INDEX_NAME TABLE_NAME MON USE START_MONITORING END_MONITORING
PK_EMP EMP YES NO 10/12/2001 06:42:35
Reference Document
Note:144070.1
Note:160712.1
Note:136642.1
Oracle9i Database Administrator's Guide
거의 대부분 리눅스+오라클9i 설치 문서 대부분은 export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601 설정을 하던데 틀렸단 말씀이신가요?
라고 하셨는데...참고로
예전에야 그렇지만.. 현재는 한글을 사용하신다면 한글을 더 폭넓게 지원하는 KO16MSWIN949를 사용하시는 것이 더 좋을 듯 싶습니다.
또한 export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601와
NLS_LANG=KOREAN_KOREA.KO16KSC5601 의 눈에 띄는 차이는
에러및 접속메시지가 한글과 영문의 차이가 있습니다..
[oracle@localhost 9.2.0]$ export NLS_LANG=KOREAN_KOREA.KO16KSC5601
[oracle@localhost 9.2.0]$ sqlplus
SQL*Plus: Release 9.2.0.1.0 - Production on 화 Sep 19 18:28:37 2006
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
사용자명 입력: /as sysdba
다음에 접속됨:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
SQL> SLDKFJAD
SP2-0042: 알 수 없는 명령어 "SLDKFJAD" - 나머지 줄 무시.
SQL> eixt
SP2-0042: 알 수 없는 명령어 "eixt" - 나머지 줄 무시.
SQL> exit
p.s그리고 경험상...export NLS_LANG=AMERICAN_AMERICA.KO16KSC5601 은 에러의 경험이 있으나 American_America 로 했을때는 에러의 경험이 없었네요. 그냥 참고하세요
Similar Messages
-
Which to use - Sy-index or sy-tabix ??
This is what i found out about SY-INDEX and SY-TABIX but which one to use when i want to delete a line of data from an internal table ? I tried both sy-index and sy-tabix and both works fine and returning the expected output for me but which one is better of to use ?
SY-TABIX :- For Internal Table, Current Line Index
SY-INDEX :- For Loops, Current Loop Pass
The below code is where i uses the Delete ..
LOOP AT dmg.
CONCATENATE
dmg-dmg00
dmg-dmg01
dmg-dmg02
dmg-dmg03
dmg-dmg04
dmg-dmg07
dmg-dmg08
dmg-dmg09 INTO tli_down1 SEPARATED BY '*'.
APPEND tli_down1. CLEAR tli_down1.
DELETE dmg INDEX sy-index.
EXIT.
ENDLOOP.Right. Just like what they said upstairs, sy-babix is the best choice.
One more thing is, if you want to concatenate fields of table dmg and append to tli_down1 on by one. You should not use EXIT after delete dmg.
In that case ,only one line can be appended into tli_down1 table.
> The below code is where i uses the Delete ..
>
> LOOP AT dmg.
> CONCATENATE
> dmg-dmg00
> dmg-dmg01
> dmg-dmg02
> dmg-dmg03
> dmg-dmg04
> dmg-dmg07
> dmg-dmg08
> dmg-dmg09 INTO tli_down1 SEPARATED BY '*'.
> APPEND tli_down1. CLEAR tli_down1.
> DELETE dmg INDEX sy-index.
> EXIT.
> ENDLOOP. -
Index's on cubes or Aggregates on infoobjects
Hello,
Please tell me if it is possible to put index's on cubes; are they automatically added or is this something I put on them?
I do not understand index's are they like aggregates?
Need to find info that explains this.
Thanks for the hlep.
NewbieIndexes are quite different from aggregates.
An Aggregate is a slice of a cube which helps the data retrival on a faster note when a query is executed on a cube. Basically it is kind of a snapshot of KPI's and Business Indicators (Chars) which will be displayed as the initial query run result.
Index is a process which is inturn will reduce the query response time. While an object gets activated, the system automatically create primary indexes. Optionaly, you can create additional index called secondary indexes.Before loading data, it is advisable to delete the indexes and insert them back after the loading.
Indexes act like pointers for quickly geting the Data.When u delete it will delete indexes and when u create it will create the indexes.
When loading we delete Bcs during loading it has to look for existing Indexes and try to update so it will effect the Data load performence so we delete and create it will take less time when compared to updating the existing ones.
There is one more issue we have to take care if u r having more than 50 million records this is not a good practice insteah we can delete and create during week end when they r no users. -
LIKE, LIKEC and Index usage
I've table that contains about 20 million rows, and I've created index for varchar2(100) column. It works well if I do
SELECT * FROM MY_TABLE WHERE MY_COL LIKE 'FOO%';
But if I change query to use LIKEC (to make unicode escaped strings work):
SELECT * FROM MY_TABLE WHERE MY_COL LIKEC 'FOO%';
I always get full table scan in explain plan.
I tried to use NVARCHAR, or index created by TO_NCHAR but I always end up hitting full table scan.
Should I create index some special way or do something else before I get index working?Just a gut feeling : is the database using character semantics or byte semantics?
My gut feeling, after looking up the documentation, is it should be character semantics.
BTW: Not posting version info decreases the chance you get an adequate reply.
Sybrand Bakker
Senior Oracle DBA -
Index with "or" clause (BUG still exists?)
The change log for 2.3.10 mentions "Fixed a bug that caused incorrect query plans to be generated for predicates that used the "or" operator in conjunction with indexes [#15328]."
But looks like the Bug still exists.
I am listing the steps to-repro. Let me know if i have missed something (or if the bug needs to be fixed)
DATA
dbxml> openContainer test.dbxml
dbxml> getDocuments
2 documents found
dbxml> print
<node><value>a</value></node>
<node><value>b</value></node>
INDEX (just one string equality index on node "value")
dbxml> listIndexes
Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
Index: node-element-equality-string for node {}:value
2 indexes found.
QUERY
setVerbose 2 2
preload test.dbxml
query 'let $temp := fn:compare("test", "test") = 0
let $results := for $i in collection("test.dbxml")
where ($temp or $i/node[value = ("a")])
return $i
return <out>{$temp}{$results}</out>'
When $temp is true i expected the result set to contain both the records, but that was not the case with the index. It works well when there is no index!
Result WITH INDEX
dbxml> print
<out>true<node><value>a</value></node></out>
Result WITHOUT INDEX
dbxml> print
<out>true<node><value>a</value></node><node><value>b</value></node></out>Hi Vijay,
This is a completely different bug, relating to predicate expressions that do not examine nodes. Please try the following patch, to see if it fixes this bug for you:
--- dbxml-2.3.10-original/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp 2007-04-18 10:05:24.000000000 +0100
+++ dbxml-2.3.10/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp 2007-08-08 11:32:10.000000000 +0100
@@ -1566,11 +1572,12 @@
else if(name == Or::name) {
UnionQP *unionOp = new (&memMgr_) UnionQP(&memMgr_);
+ result.operation = unionOp;
for(VectorOfASTNodes::iterator i = args.begin(); i != args.end(); ++i) {
PathResult ret = generate(*i, ids);
unionOp->addArg(ret.operation);
+ if(ret.operation == 0) result.operation = 0;
- result.operation = unionOp;
// These operators use the presence of the node arguments, not their valueJohn -
Hi,
Can some body explain the CLEAR difference between Sy-index and Sy-tabix. And one or two small examples. I am little bit confused.
Thanx.Hi,
SY-INDEX
In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
regards,
madhu -
What is" LINE-COL2 = SY-INDEX ** 2."
can u explain what is '' ** "
FIELD-SYMBOLS <FS> LIKE LINE OF ITAB.
DO 4 TIMES.
LINE-COL1 = SY-INDEX.
LINE-COL2 = SY-INDEX ** 2. "what this will do
APPEND LINE TO ITAB.
ENDDO.Hi sunil,
1 ** means "To the power of"
2. eg. 5 ** 2 = 25
(5 To the power of 2 = 25)
regards,
amit m. -
Hi all,
I am trying to get loop count by using sy-index.
But I am not able get exact expected out put.
I am gettig all zeros instead of loop number.
I am sending my code here.
DATA: lv_diff(10) TYPE c,
lv_erdat1 LIKE sy-datum,
lv_erdat2 LIKE sy-datum,
i(15) TYPE c VALUE '1'.
SORT t_ordno BY aufnr.
LOOP AT t_ordno INTO st_ordno.
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat1 = st_ordno-erdat.
i = i + 1.
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat2 = st_ordno-erdat.
i = i + 1.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = lv_erdat2
i_datum_von = lv_erdat1
IMPORTING
e_tage = lv_diff.
WRITE:/ lv_diff,
50 <u><b>sy-index.</b></u>
CLEAR: lv_erdat1,lv_erdat2,lv_diff.use this code
DATA: lv_diff(10) TYPE c ,
lv_erdat1 LIKE sy-datum ,
lv_erdat2 LIKE sy-datum ,
i(15) TYPE c VALUE '1' ,
l_tabix type syst-tabix .
SORT t_ordno BY aufnr.
LOOP AT t_ordno INTO st_ordno.
l_tabix = sy-tabix .
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat1 = st_ordno-erdat.
i = i + 1.
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat2 = st_ordno-erdat.
i = i + 1.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = lv_erdat2
i_datum_von = lv_erdat1
IMPORTING
e_tage = lv_diff.
WRITE:/ lv_diff,
50 l_tabix.
CLEAR: lv_erdat1,lv_erdat2,lv_diff. -
ANY SY-INDEX REFLECT CHANGES WHEN CONTROL BREAK STATEMENT PROCESS
Dear Guru's,
I have a requirement where i have to move the values to variable when control break (AT END OF) process. So i want to move the values according to the end of Vendor so for that i want to know is there any sy-index available which reflects changes when Control break (AT end of) process.
LIKE Sy-subrc = 0 when select statement fetches record or sy-tabix is like counter for loop.
Hope to get reply soon.
Regards,
Himanshu RangappaHi,
There is no system Fields for it.
But your requirement can be done with 'AT NEW' and 'AT END' statement.
Refer this sample example,
loop at otab.
at new module.
move otab-module to otab2-module.
ENDAT.
at END OF effort.
sum. "Do your calculations here
move otab-count to otab2-count.
append otab2.
endat.
endloop. -
What is the diffrence betweensy-tabix and sy-index
hi
can any one suggest me
what is the diffrence betweensy-tabix and sy-index
Thanks & Regards
kalyan.Hi Kalyan,
This question has been answered many times on SCN. Please make a search before posting a thread.
Read the Rules of Engagement.
Happy Posting.
Regards,
Chandra Sekhar -
ABAP-- diff between sy-sy-tabix and sy-index
Hi Guru's,
Pleae can anybody expalins me what is the difference between sy-tabix and sy-index(Loop Index) ?
Because in one case i am Modifyimg the internal table inside the do loop by giving sy-index ((Index of Internal Tables)(MODIFY scarr_tab INDEX sy-index FROM scarr_wa TRANSPORTING currcode. ) in the syntax and in other case inside loop statement i am modifyng same record by giving sy-tabix MODIFY scarr_tab INDEX sy-tabix FROM scarr_wa TRANSPORTING currcode.) in the syntax.
in both cases its working fine but i am not getting which one i have to use where to modify the internal table?
regards
SATYAHi Henry,
SY-INDEX is the value of the current iteration. It is applicable for the following programming constructs in ABAP -
DO...ENDDO.
WHILE...ENDWHILE.
SY-TABIX (TABle IndeX) is applicable to internal tables. If you scroll down in the link which Eddie has given, you will find a more detailed explanation for sy-tabix and which statements affect its value.
Regards,
Anand Mandalika. -
What is difference between sy-tabix and sy-index.
SAP Seniors,
Can you please let me know what is difference between sy-index and sy-tabix.
I read the SAP help, it is confusing for me. it looks like both are same from help. please help me.
Thank you
Anitha.HI,
Here is a brief description of difference between SY_TABIX and SY_INDEX and using them with several conditions.
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
SY-INDEX
In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
Hope this helps.
Thank you,
Pavan. -
What is diff b/w sy-index and sy-tabix
Hi all,
Can u plz give me the diff b/w sy-index and sy-tabix exactly and how it works.
Thanks & Regards
VenkatHi Venkat,
<b>1.SY-INDEX</b>
<b>-></b>Current loop pass
<b>-></b>In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
<b>2.SY-TABIX</b>
<b>-></b>Current line index
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables.
The field is either not set or is set to 0 for hashed tables.
<b>APPEND</b> sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
<b>
COLLECT</b> sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
<b>LOOP AT</b> sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
<b>READ TABLE</b> sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
<b>
SEARCH</b> <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
I think that it clears ur doubt.
<b>Thanks,
Venkat.O</b> -
Difference between sy-tabix and sy-index?
tell me about sy-tabix and sy-index?what is the difference between sy-tabix and sy-index?
Moderator Message: Please search before posting. Read the [Forum Rules Of Engagement |https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] for further details.
Edited by: Suhas Saha on Jun 18, 2011 5:33 PMHI,
Here is a brief description of difference between SY_TABIX and SY_INDEX and using them with several conditions.
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
SY-INDEX
In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
Hope this helps.
Thank you,
Pavan. -
What is difference between sy-index and sy-tabix and where both are using ?
what is difference between sy-index and sy-tabix and where both are using ?
hi nagaraju
sy-tabix is in Internal table, current line index. So it can only be used while looping at the internal table.
sy-index is in Loops, number of current pass. This you can use in other loop statements also (like do-enddo loop, while-endwhile)
SY-INDEX is a counter for following loops: do...enddo, while..endwhile
SY-TABIX is a counter for LOOP...ENDLOOP, READ TABLE...
Here is an example from which you can understand the difference between sy-tabix and sy-index.
Itab is an internal table with the following data in it.
id Name
198 XYZ
475 ABC
545 PQR.
loop at itab where id > 300.
write :/ itab-id, itab-name , sy-tabix, sy-index.
endloop.
My output will be :
475 ABC 2 1
545 PQR 3 2
Sy-tabix is the index of the record in internal table.
sy-index gives the no of times of loop passes.
So, for the first record in the output (475 ABC), 2 is the index of the record in internal table and as it is first time loop pass occured, sy-index value is 1.
Regards,
navjot
award points -
Difference b/w sy-index and sy-tabix
hai all,
Could u explain the difference b/w sy-index and sy-tabix?
regards,
SelvaHi,
sy-index - For Loops, Current Loop Pass.
sy-tabix - For Internal Table, Current Line Index in internal table.
sy-tabix is used at internal table operations (READ TABLE ... LOOP AT ...), sy-index is used at cycles (DO...n TIMES).
SY-TABIX:
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
it can be set by using the following:
1.append
2.collect
3.loop at
4. read
5.search
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
SY-INDEX:
SY-INDEX is used to describe the number of iteration with in the DO..ENDDO, WHILE ...ENDWHILE....
for example,
DO.
WRITE SY-INDEX.
IF SY-INDEX = 3.
EXIT.
ENDIF.
ENDDO.
it gives output as:
1 2 3
Regards,
Raj.
Maybe you are looking for
-
Apple really needs to rethink their temporary playlist approach
One of my biggest annoyances with Apples music products, be it mobile or not (iTunes), is their approach to playlists and more specifically their so called "on the go" playlist on mobile devices. The "on the go" playlist needs to go or be revamped. W
-
Saving digital signature as a Bitmap Image
HI, Can we save a digital signature as bitmap in our local drive? If so, the process for the same would be a lot helpful. Thanks, bhaskar.
-
Hi, I've just started to use Numbers and have created my first spreadsheet out of the Weight Loss and Running template. If I select the weight loss chart and select format and then x axis and switch on Title, the chart shows what looks like a default
-
MDT 2010 Vista cannot finish after joining domain
Hi, I have a problem with deployment process after joining domain. I am deploying Vista using MDT 2010 with LiteTouch. Everything works fine. However, deployment process stops after joining domain. I suppose that autologon is disabled/don't work aft
-
How to Stop the preview from jumping when using .avi's??
Hi Ive been having aproblem where the .avi file I have imported will just jump forward , making it impossible to edit.. I have try reconverting th.avi's to lower bitrate, and still it jumps ,, the avi files iam using having been converted from SUPER