One suggestion.
Try to avoid select statement within a loop. For every record in your source it would hit the database table. So 10k records it would hit the data base 10k times.
Instead select all the master data of the 2 dimensions in an internal table and then read the table inside the loop with selections.
Thanks
Ed.