By using the wave function ansatz method, we study the energy eigenvalues and wave function for any arbitrary $m$-state in two-dimensional Schr{o}dinger wave equation with various power interaction potentials in constant magnetic and Aharonov-Bohm (AB) flux fields perpendicular to the plane where the interacting particles are confined. We calculate the energy levels of some diatomic molecules in the presence and absence of external magnetic and AB flux fields using different potential models. We found that the effect of the Aharonov-Bohm field is much as it creates a wider shift for $m eq 0$ and its influence on $m=0$ states is found to be greater than that of the magnetic field. To show the accuracy of the present model, a comparison is made with those ones obtained in the absence of external fields. An extension to 3-dimensional quantum system have also been presented.