You will need to grab a description of the MT940 standard, and then apply that.
Wikipedia led me to this: https://web.archive.org/web/20160725042101/http://www.societegenerale.rs/fileadmin/template/main/pdf/SGS%20MT940.pdf
From what I have seen, some parts of the design are (IMHO) simply idiotic. e.g. numeric fields without a fixed length, where you have to go looking or the first non-numeric character first to determine the end of the field. So be prepared for some good ol' B,S,T&T.
... View more