There are $3$ digits and each digit has the possible values $\{0,1,2,\dots,9\}$.
Here each digit contributes their values to $S$, except $0$ which contributes $1$. Let $p(0)=1$
Every possible combination of the $3$ digits corresponds to a distinct number in $\{0,1,2,\dots,999\}$ and they cover all the numbers in this set exactly once.
So, $(1+1+2+\dots+9)^3$ is equal to the sum of the products of the numbers' non-zero digits.
$\therefore(1+1+2+\dots+9)^3=p(0)+p(1)+p(2)+\dots+p(999)$
$\implies (1+1+2+\dots+9)^3=p(0)+S$
$\implies S=(1+1+2+\dots+9)^3-1=46^3-1=3^3\cdot5\cdot7\cdot103$
So, $103$ is the largest prime dividing $S$.