Filelaout,ci and app eng

Hi,
I am tryiing to insert a file through app eng and ci.
I created staging record and assigned it to file laout n drag that file laout in app eng.
in next step i had assige staging table value to state record through do select.immediate to that action i had drag a ci which associated with main record in peoplecode.
but only last value is getting inserted into main record though staging n state record working fine...

all the validations are workin fine..tx alot.....
Now i need to create a stat file where 1 can find out how many rows are processe,how many errors and how many rows are succed,,,,,
any suggetions would be helpful to mee