Hi Paul,
the way the loop script works is saving the transaction only after processing all the rows. Since there is an error in one of the lines, it's impossible to save the transaction, since SAP will only allow to save when that error is fixed.
You will have to choose between fixing the error and re-run all lines contained in that Header, or change the script to add and save one line each time.
Hope that helps.
Regards,
------------------------------
Andre Monteiro | Senior Systems Administrator
UK Power Networks
------------------------------