Amla hit five fours and two sixes in his 103 off 115 deliveries before being run out. He added 145 runs for the second wicket with Faf du Plessis (75).
J.P Duminy provided impetus to the South Africa innings towards the end, smashing 38 off 20 deliveries with five fours and a six.
Nuwan Pradeep was the most successful Sri Lankan bowler, finishing with two for 54.
Sri Lanka had suffered a blow prior to the match when captain Angelo Mathews was ruled out of the game with a calf strain.
They elected to bowl first after winning the toss in overcast conditions.
Brief Scores: South Africa 299 for six in 50 overs (H. Amla 103, F. Du Plessis 75, J.P. Duminy 38, N. Pradeep 2/54)