Hi,
i think your sorting on result_package not on master data tables. if yes then how you can compare the master data tables and results of your code.
You need to check result package values before loading and then compare after the executing of your code. that may give idea.
Thanks.