Hi Reddyr,
You are right in understanding that the total of balance in the line item file does not matches the total of balance in the header file. Also please be aware that a line item file may have one or more than one statements for different type of accounts.
In that case Header file will have items equal to the no of type of accounts to be posted to.
So balance should match between the two files at the level of different type of accounts as well.
Kindly check the two files thoroughly I am sure you will be able to detect it.
Thanks