Hi All,
This issue is resolved !!!!.It was not working because the internal table had many other fields apart from the 5 fields I have mentioned which did not have similar field values.So collect did not work effectively in that case.
Its now resolved !!!