2010 Mar 29 5:40 AM
Hi ,
I have one internal table lets ITAB1[] ,
Its having 15,0000 Records.
now I want to search only 5 records from ITAB1[] compairing ITAB2[] , ITAB2 having 15,0000 records.
what is best method to search this records in minimum time.
loop it ITAB1.
Read table ITAB2 with = ... binary search.
Endloop.
Prblem is that , above statemnt will take 15,0000 intration at each statment while reading.
Hi ,
I have one internal table lets ITAB1[] ,
Its having 15,0000 Records.
now I want to search only 5 records from ITAB1[] compairing ITAB2[] , ITAB2 having 15,0000 records.
what is best method to search this records in minimum time.
loop it ITAB1.
Read table ITAB2 with = ... binary search.
Endloop.
Prblem is that , above statemnt will take 15,0000 intration at each statment while reading.
2010 Mar 29 5:52 AM
Hi,
{SORT THE TABLE WITH PROPER CONDITON.
LOOP AT ITAB2INTO IS_ITAB2.
READ TABLE ITAB1 INTO IS_ITAB1 WITH KEY ..........
IF SY-SUBRC = 0.
W_TABIX = SY-TABIX.
LOOP AT IT_ITAB1 INTO IS_ITAB1 FROM W_TABIX.
IF ( PLEASE CHECK THE CONDITON MENTIONED FOR THE BINARY SEARCH HERE )
ELSE.
EXIT.
ENDIF.
ENDLOOP.
}
Please try this this parallel curosor method.. Performance is good..
Regards,
Srinivas.
2010 Mar 29 5:53 AM
Hi,
Could you please elaborate further how are you trying to compare the records between the two internal tables.
Regards,
Jayesh
2010 Mar 29 6:27 AM
Hi,
loop it ITAB1.
Read table ITAB2 with = ... binary search.
Endloop.I think whatever code you are using now is appropriate only.
As you want to read record from ITAB1 based on data in ITAB2, you will have to loop at ITAB2 and then do binary search on ITAB1. Just make sure that your table ITAB1 is sorted correctly as per the binary search criteria.
Thanks,
Archana
2010 Mar 29 6:30 AM
now I want to search only 5 records from ITAB1
Based on what conditions you have short listed the 5 records of ITAB1 ? Are the fields involved defined (or can be defined) as key fields of the internal table?
BR,
Suhas
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |