The 21-year-old, vying for a place in the first of two Tests starting in Abu Dhabi from Monday, hit 66 in a Pakistan 'A' score of 230-4 in reply to South Africa's 354-8 declared on the second day of the three-day match at Sharjah stadium.
Pakistan needs to select three players from this tour match to add to the 12-man squad announced for the two-Test series.
The second Test starts in Dubai from October 23.
But Shahzad's rival for the opening slot, Shan Masood, also scored an attractive 50 in a stand of 106 for the first wicket before both retired to allow others a chance to gain practice.
Ahmed has played 27 one-day and 15 Twenty20 for Pakistan since 2009 and is tipped to make his Test debut in Abu Dhabi.
South Africa's four-pronged pace attack led by world's best Test bowler Dale Steyn toiled hard in the heat. Of the pacemen only Morne Morkel managed a single wicket.
Steyn and fellow new ball partner Vernon Philander bowled 26 overs between them but were unable to separate the Pakistan 'A' openers.
Pakistan's one drop batsman Azhar Ali also notched a sedate 54 while Asad Shafiq, also fighting to keep his Test place, was unbeaten on 32 at stumps.
South African spinners Robin Peterson (1-42) and Imran Tahir (0-34) bowled tight but failed to extract much spin out of the pitch.
The two-Test series is expected to be dominated by spinners, with Pakistan likely to enter the first Test with off-spinner Saeed Ajmal and two left-armers in Abdur Rehman and Zulfiqar Babar.
Brief scores: South Africa 354-8 (J. Kallis 70, A. Petersen 58, AB de Villiers 58, Hashim Amla 50, JP Duminy 49)
Pakistan 'A' 230-4 (Ahmed Shahzad 66, Azhar Ali 54, Shan Masood 50) (AFP)