Sharma scored 119 while Raina blasted 135 as the two overnight batsmen ripped apart the home bowling attack on the second day of the match.
India skipper Cheteshwar Pujara had struck 137 yesterday to put his side in a strong position.
Sharma and Raina shared a 106-run partnership for the fourth wicket, which was broken when the former was caught by Temba Bavuma off JP Duminy at the fag end of the morning session.
The two batsmen added 82 runs for the last wicket.
More From This Section
South Africa were 20 for one in reply as Unadkat had opener Reeza Hendricks (10) caught behind.
Dean Elgar and Simon Harmer were at the crease when stumps were drawn for the day.
Rohit added another 49 runs to his overnight score before being dismissed, but not before tormenting Protea bowlers with 14 boundaries and two sixes.
Joined by Ajinkya Rahane (10) in the middle, Raina continued to play his strokes, even as the the former got out cheaply when Duminy added another wicket to his kitty.