‎2008 Feb 13 4:58 AM
hi,
how to optimize the follwoing peice of code to count the no. of checkboxes clicked. ??
LOOP AT i_final INTO wa_final WHERE v_box = 'X'.
v_counter = v_counter + 1.
ENDLOOP.
i know if table contains 10000 records it will chekc the whole table..
how to optimize it ?? and store the value os checboxes clicked in V_COUNTER ??
thanks in advance
‎2008 Feb 13 5:15 AM
Hi,
Create another temporary internal table i_final_temp.
Then do the following:
refresh i_final_temp.
append lines of i_final to i_final_temp.
delete i_final_temp where v_box ne 'X'.
describe table i_final_temp lines v_counter.
This avoids any looping and hence improves performance.
Cheers,
Aditya
‎2008 Feb 13 5:14 AM
Hi,
U declare a local internal table with same structure of that inetrnal table and pass the values to that internal table. then delete the records which dont have the checkbox on.
u will be left with records with check box on..
then use DESCRIBE TABLE ITAB LINES N.
N will the no.of records in the internal table with check box on.
PS: pleae reward points if found Useful
‎2008 Feb 13 5:15 AM
Hi,
Create another temporary internal table i_final_temp.
Then do the following:
refresh i_final_temp.
append lines of i_final to i_final_temp.
delete i_final_temp where v_box ne 'X'.
describe table i_final_temp lines v_counter.
This avoids any looping and hence improves performance.
Cheers,
Aditya
‎2008 Feb 14 10:35 AM