US President Donald Trump has vowed to go to the Supreme Court, saying the appeals court "incorrectly" issued the ruling.