i) do you need all the fields of bw_table? if not, then fetch selected fields only to avoid '*' from select query.
ii) Avoid nested loop as well. one way to do it....consolidate data from both internal tables into another table and then use Loop with Read to this table.
Rgds