This work proposes and simulates a finite set model predictive control technique for the photovoltaic inverter. The power topology is a 30 KW PV array with two power conversion stages: DC/DC boost converter controlled with maximum power point tracking to extract the maximum available photovoltaic power and two-level voltage source inverter with passive filter to convert direct current to alternative current and inject it into a medium voltage grid via a transformer, a 30 KW lead-acid batteries system connected to the inverter DC bus through buck-boost converter. Two control levels appear for the inverter: a simple hysteresis-based power management which sends the power reference to the second level according to the battery state of charge value. The second level is a finite set model predictive controller which makes the inverter inject desired high-quality currents according to the reference. This technique doesn't need a modular for switching and the digital simulation with MATLAB/Simulink software proves the performance of MPC controller in term of injected currents quality with THD value of 0.91% compared to conventional hysteresis controller with THD of 1.57%.