I would agree with Frank on this, he looks to be a junior officer or cadet on a shipping line, I looked at P and O and although the badge is slightly different all other aspects of uniform and cap are similar, the photo circa 1900 would make him 18-20 years old, it is unlikely he would have achieved high rank at that age.
That is not to say he wasn't in South Africa, tens of thousands of troops were shipped by shipping companies
Such a shame the pic is so damaged, the experts on the photographic board may be able to repair some of the damage.
James