Do they actually repeat the sections? Does each section represent an order?
So they are building table 1 from data viewed in Table 2.
Table 1 is bound to the main datasource and saved in the form. Table 2 is bound to the secondary data source (SP)
As they add information into a row in table 1 you want to display the relevant data from table 2.
You really should add the table 2 repeating section into the repeating table of Table 1 and I think you would get the functionality you are looking for.
Instead of current() you could try last() for table1. Do you increment each row? you could use the highest row number to get the key information from Table1 too.
Hope this helps