The electronic structure of ScH2 and HfH2 have been calculated by using the self-consistent LMTO-ASA method, without placing an extra muffin-tin sphere at the octahedral site in the fcc lattice to make a correction for muffin-tin potential. In the case of ScH2, the result is in good agreement with that of Peterman and Harmon and the photoemission data, the only discrepancy is the position of T2, which is located below the Fermi level rather than above it, therefore, the occupancy of proton in the octahedral site is quite possible. The general feature of the calculated density of states of HfH2 is in reasonable agreement qualitatively with the photoemission data. The electronic charge within the hydrogen sphere is about 1.2-1.3.