05-07-2010 9:12 AM
When i perform a READ TABLE SENTENCE, is it possible to know in wich INDEX is the result when sy-subrc is 0?
I want to avoid looping the table to know that and sy is not giving me any clue.
Thanks!
05-07-2010 9:26 AM
HI,
Just simply you can check like this for understanding.
data:
t_tab type TABLE OF spfli.
SELECT * from
spfli
into table t_tab UP TO 20 rows.
read table t_tab transporting no fields with key carrid = 'AZ'.
if sy-subrc eq 0.
write:/ sy-tabix. " Here it prints as 3 as AZ present at index 3
endif.
Regards and Best wishes.
05-07-2010 9:13 AM
05-07-2010 9:19 AM
Go with using SY-TABIX - Checks Current line of an internal table
READ TABLE ITAB ASSIGNING <FS> INDEX 3
05-07-2010 9:26 AM
HI,
Just simply you can check like this for understanding.
data:
t_tab type TABLE OF spfli.
SELECT * from
spfli
into table t_tab UP TO 20 rows.
read table t_tab transporting no fields with key carrid = 'AZ'.
if sy-subrc eq 0.
write:/ sy-tabix. " Here it prints as 3 as AZ present at index 3
endif.
Regards and Best wishes.