I don't know if you already know this but John Hannah joined the Kings Own Scottish Borderers, Galloway Rifles on 18 Feb 1902 at Berwick on Tweed. His father's name is given as John Hannay, 54 College St, Maxwelltown.
It says "Discharged before termination of engagement 2 Aug 1902" He served in South Africa from 8 Mar 1902 to 31 Jul 1902, and was in the army a total of 174 days.
It gives full details of his appearance: height, eye-colour, distintive marks etc. His Regimental number for the K.O.S.B. was 8560