2005 Dec 13 2:24 PM
Hi all,
I have always confusion when to use which system fields(tabix, index, tfill).
í created one program first i used sy-tabix instead of sy-index.Then it doesnt work.
Please clarify me with examples.
that code is.
FORM delimiting.
DO.
* assigns the next field in the current header to <f>.
ASSIGN COMPONENT sy-index OF STRUCTURE i_itab TO <f>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF sy-index = 1.
excel_string = <f>.
ELSE.
CONCATENATE excel_string <delim> <f> INTO excel_string.
ENDIF.
ENDDO.
ENDFORM. " delimiting
Thanks and regards
Chandu.
2005 Dec 13 2:31 PM
2005 Dec 13 2:27 PM
hi,
sy-tabix is used in loop and endloop for internal tables.
sy-index is used for do and enddo and other loops like while
2005 Dec 13 2:31 PM
in case of Do loops we usually go for sy-index,
in loop and endloops or read statements we use sy-tabix..
regards
vijay
2005 Dec 13 2:31 PM
2005 Dec 13 2:32 PM
2005 Dec 13 2:41 PM
Hi,
Sy-index specifies about the current loop pass which is same as ur example.
Sy-tabix stores the current line index of the table.
loop at it_mara.
< ur logic >
modify table it_mara index sy_tabix.
endloop.
Sy-tfill tells abt the current number of lines in the internal table.
describe table it_mara lines sy-tfill.
if sy-tfill = 0.
<ur code if table is initial>
endif.
Regards,
Neelima.