‎2007 Sep 24 7:38 AM
Hello all
I have a loop which is coded as below ..
LOOP AT ij_cawn
WHERE atinn = j_3apghd-j_3abzd1.
EXIT.
ENDLOOP.
When analysis was done using ST12, this was shown to take huge time. I would like to modify this code as
Read tavel ij_cawn with key atinn = j_3apghd-j_3abzd1.
Binary search is not possible as the table is not sorted . Also I cannot sort it due to some other logic.
Could you please give me your valuable sggestions in thsi ..
Regards
Sudha
‎2007 Sep 24 7:42 AM
hI,
YOUR LOGIC IS RIGHT,
USE READ STATEMENT AND THEN WRITE IF SY-SUBRC = 0.
PERFORM STEPS.
ENDIF.
‎2007 Sep 24 7:42 AM
hI,
YOUR LOGIC IS RIGHT,
USE READ STATEMENT AND THEN WRITE IF SY-SUBRC = 0.
PERFORM STEPS.
ENDIF.
‎2007 Sep 24 7:43 AM
Hi,
make a copy of this internal table in other internal table.
sort that internal table. use Binary Search.
It can help you,
Sandeep Kaushik
‎2007 Sep 24 7:43 AM
i_temp[] = ij_cawn[].
sort i_temp by atinn.
Read table i_temp with key atinn = j_3apghd-j_3abzd1 BINARY SEARCH.