• Thanks Luic for the response...

    It seems close, the problem is, it was returning one value for all the rows.

    I want it to return the values for each row and put them in a table along with its ID...

    Actually I missed Key fields in my initial post, The key fields KSCHL and KOTABNR which will be used to link the tables A and B... these fields should also be appearing on the final result table. (Can we insert the result into a table?)

    Appreciate you help...