how should i design variable current source of 4-20mA with 24Vdc input?
What you're describing is a 4-20 mA Current Loop. The implementation of current loops is very vast, however, I would go with an approach similar to this one. The input range is 0-5v for the example I gave, but you could quite easily scale your input down to 5v max by using a voltage divider. The circuit is rather robust and relatively easy to implement and looks something like this: