It is permissible to have an operation to tie the stomach (i.e., making it smaller by putting a band or staples) or to reduce its size and connect it to the small intestine for the purpose of reducing excess weight, and this is not regarded as changing the creation of Allaah, because it comes under the heading of medical treatment. But that is subject to the condition that it be thought most likely that no bad consequences or greater harm will result from that. One should refer concerning that to a trustworthy doctor, because these operations may have serious side-effects.
It is better to use dietary methods, in consultation with specialists. If that does not succeed, then you may resort to tying the stomach or re-channelling the food so long as you are certain that it is free from harmful and negative side effects.
And Allaah knows best.