11-21-2007 11:50 AM
Hi All.
I have an internal table ITAB_REF0011 with 169 records.
I wanted to filter it based on the criteria -->
LN_DAT8 = '11111111' LN_TIM6 = '222222' BINARY SEARCH.
This filter will return only 1 record out of the 169 records.
If I do the codes below, will SY-TFILL = 1? If not, how do I find out the number of records after the internal table ITAB_REF0011 has been filtered? Thanks.
****************************************************************************
READ TABLE ITAB_REF0011 WITH KEY
LN_DAT8 = '11111111' LN_TIM6 = '222222'
BINARY SEARCH.
IF SY-SUBRC = 0.
LOOP AT ITAB_REF0011.
IF SY-TFILL = 1. ==> SY-TFILL <> 1, why?
...
ENDLOOP.
ENDIF.
...
11-21-2007 11:54 AM
Hi..
1. READ TABLE statement will only one Record from Itab to Workarea.
2. SY-TFILL Stores the Total number of records in internal table.
3. You can use SY-Tabix To find the Current record in LOOP.
LOOP AT ITAB.
IF SY-TABIX = 1.
ENDLOOP.
reward if Helpful.
11-21-2007 11:56 AM
READ TABLE ITAB_REF0011 WITH KEY
LN_DAT8 = '11111111' LN_TIM6 = '222222'
BINARY SEARCH.
data : v_line type i.
describe table ITAB_REF0011[] lines v_line.
v_line contains no. of records in ITAB_REF0011.
11-21-2007 12:06 PM
Hi,
I think this was your point if i am correct.
you want filter out how many records were there with you condition in the internal table
You need to do
loop at itab1 and your conditions
v1 = v1+ 1.
increment the variable.
endloop.
this will solve your problem
you can not do it by read statement
Regards,
siva chalasani.
<b>Reward points if usefull</b>
11-21-2007 12:07 PM
Hi,
Read statement always read only one record at a time.
Regards,
Prashant