At the time the AU was introduced, its actual value was very poorly known, but planetary distances in terms of AU could be determined from heliocentric geometry and the laws of planetary motion. Eventually the actual value of the AU was determined (approximately) from parallax observations, and more recently (and precisely) by radar. While the value of the astronomical unit is now known to great precision, the value of the mass of the Sun is not because of uncertainty in the value of the gravitational constant. Because the gravitational constant is known to only five or six significant digits while the positions of the planets are known to 11 or 12 digits, it is impossible to do calculations about the position of the planets in SI units without losing precision in the unit conversion. Therefore calculations in celestial mechanics are performed in solar masses and astronomical units rather than in kilograms and kilometers.
Some approximate conversion factors: