The ball came at a speed of 142 and hit him on the head.
In the 44th over, the third ball hit the helmet on the front side.
Despite wearing a helmet, Shardul's head started swelling.
Young bowler Gerald Coetzee was bowling.
The first match of the Test series is being played at the SuperSport Cricket Stadium in Centurion.