Like many solutions there is a large scale way of doing this, and a low scale solution of doing it. If I can assume your only building one or just a few solar systems and not a whole galaxy of them, this would be fairly simple.
The sun is the key to this, make a global array and a counter, set the counter to 0 at the start of the game. In your sun action, assign a pointer to the sun in the array[counter] slot and then increment the counter.
Every planet that you want to revolve around these sun's you create you simply assign a number according to the sun that you want them to revolve around (first sun would be 0, second sun would be 1 ect.). Then you just assign your movement code to reference array[currentSun].x, array[currentSun].y, and array[currentSun].z to find the position of the sun you want.
I'll assume you already have the code for revolving around the sun. But this should be fairly simple to do, so good luck.