From your diagnosis, it appears your kidneys are affected due to excessive use of Ranitidine.
Alcohol worsens peptic ulcer to extent that complications of peptic ulcer can develop like bleeding from ulcer and perforation of ulcer. Ranitidine you are taking only helps by reducing the acid production in stomach. If you continue to have alcohol, there is no use in you taking ranitidine as its effects are inhibited by alcohol.
Ranitidine excreted through kidney. Ranitidine taken chronically for more than 3 months damages the kidney reversibly. I suggest you to stop having ranitidine and mainly stop with alcohol. If you continue with alcohol, peptic ulcer disease can worsen leading to perforation and strictures etc.
You can take sucralfate, which will coat your ulcers. But again if you continue with alcohol, there would be no effect again. For your kidney function, renal function tests have to be done to know the extent of damage. I suggest you consult a urologist. For your pain you can do spasmolytics like Meftal spas.