When running records for ME22N, the script is failing with a field is not an input field error when going from Display to Change mode. An if first/if not first condition does not resolve the issue.
Change Renew session from 0 to 1. This will force a re-connection with SAP for each transaction being run.
**You will need to remove any if first/if not first conditions if the renew session option is being used. Renew session will also cause a slower run (about a second per record) as it is forcing the re-connection with SAP.