basically first you vary "fi" from 0 to pi i.e. from yop of z-axis to down of zaxis.
pi being fi's maximum value.
then you vary theta from 0 to 2pi. on x-y plane. basiclly you will get a circle if you go uptill 2pi. ((its kind of obvious why theta goes uptill 2pi. its because theta moves in x-y plane ie it varies in both x and y direction. so 0 to pi in x direction and then 0 to pi in y direction. overall it moves 0 to 2pi in the plane)).