When they had sung a hymn: It was customary to end the Passover by singing the last part of the hallel psalms (Psalms 114–118).
The singing of hymns brought the Passover meal and Last Supper to a conclusion, and Jesus and the disciples departed for the Mount of Olives to spend the night. As they proceeded, Jesus told his disciples that they would all desert him, which had to happen because the Scriptures foretold it.
I will strike the Shepherd: As a result, the sheep (the disciples) would be scattered.