Hi Asif,
Are you going to write new file per IDOC message groups or using the same file to dump the data...
If you need to write the IDOC in same Output file, you can process single IDOC (Idoc 1 by 1) in PI and keep writing the converted flat data into the output file in Append mode.
Regards,
Azhar