The script works as expected during a normal run, but validation will fail after the last line item, giving a "No batch input data..." error.
IT is a known bug in 10.7. But it has fixed in WFM12.
1. The script has loop condition and if the validation works for only one line item then Edit the script and apply &EndSession:1. This will validate each line item which resolves the issue.