You need a shipyard of that size (and type, i.e. commercial vs military). If you have a station that is too massive for a shipyard, e.g. a million-ton fleet maintenance platform then you're out of luck as far as scrapping goes, but you can set it to self-destruct, recover the crew, and salvage the wreck to get something back.
It may be worth considering if you really need to get rid of a station. If it's a military one that's obsolete, then you should have a yard for it (how else did you build it?). Otherwise, the big commercial stations don't really go obsolete, and they cost nothing to keep around aside from possibly poaching commanders - once you have a FHP or OMP, it doesn't go obsolete as the major modules aboard benefit from technology increases without needing replacement (and a slow refueling or cargo loading module isn't a big deal, though ideally you're using hub modules for this instead which benefit from tech automatically). Worst case would be you set the class commander priority to zero and leave them idle around a worthless rock somewhere if you really, truly can't find a use for them, since they should be useful somewhere later on.
But if you really need the minerals from your million-ton station for something...self-destruct and salvage is the best you've got without a shipyard.