I found this when I searched on ""line 1040""
Replace the Sy1Q01, Sy1Q02,Sy1Q03,Sy1Q04,Sy1QDD files in the ..\MAS90\SOA directory.
OR
Delete the ######Z00IM_AliasItemNumber START FILTER from the Sy1Q03.soa file using Data File Display and Maitenance.
Delete the ######Z00IM_AliasItemNumber FSTART FILTER record from the SyQ04.soa file using Data File Display and Maintenance.
This is an inventory lookup but it points to the likely problem file or files.