I used Xbee pro S2B.but it can't range long distance.Only 20-30 meters.Please help me

Please give more detail in your question. Things like radio configuration, environment, and what range you are expecting.

>> Check are you providing sufficient power supply. Don’t use battery power.

>> Check ‘Power Level’ parameter PL. It should be set to maximum PL=4

>> Check if antenna is properly attached.

This link may be helpful for you as well:
http://www.digi.com/support/kbase/kbaseresultdetl?id=2051