A system for charging a battery of an energy storage system using a photovoltaic inverter, the system comprising: a photovoltaic inverter configured to convert a DC power generated from a photovoltaic module into an AC power, and to output the AC power; and an energy storage system comprising: a current measuring unit and a voltage measuring unit respectively configured to measure the output current and the output voltage of the photovoltaic inverter; a controller configured to calculate an inverter output power based on the voltage and current measurements, configured to compare the inverter output power with a power reference, and configured to output a charging control signal; a charging unit configured to charge the battery by supplying power output from the photovoltaic inverter to the battery according to the signal generated by the controller; characterized in that: the controller is configured to output the charging control signal according to a constant current charging mode when the inverter output power is equal or greater than the power reference and to output a charging control signal according to a constant voltage charging mode when the inverter output power is lower than the power reference; and in that the charging unit is configured to charge the battery in the constant current mode or in the constant voltage mode accordingly. a photovoltaic inverter configured to convert a DC power generated from a photovoltaic module into an AC power, and to output the AC power; and an energy storage system comprising: a current measuring unit and a voltage measuring unit respectively configured to measure the output current and the output voltage of the photovoltaic inverter; a controller configured to calculate an inverter output power based on the voltage and current measurements, configured to compare the inverter output power with a power reference, and configured to output a charging control signal; a charging unit configured to charge the battery by supplying power output from the photovoltaic inverter to the battery according to the signal generated by the controller; characterized in that: the controller is configured to output the charging control signal according to a constant current charging mode when the inverter output power is equal or greater than the power reference and to output a charging control signal according to a constant voltage charging mode when the inverter output power is lower than the power reference; and in that the charging unit is configured to charge the battery in the constant current mode or in the constant voltage mode accordingly. a current measuring unit and a voltage measuring unit respectively configured to measure the output current and the output voltage of the photovoltaic inverter; a controller configured to calculate an inverter output power based on the voltage and current measurements, configured to compare the inverter output power with a power reference, and configured to output a charging control signal; a charging unit configured to charge the battery by supplying power output from the photovoltaic inverter to the battery according to the signal generated by the controller; characterized in that: the controller is configured to output the charging control signal according to a constant current charging mode when the inverter output power is equal or greater than the power reference and to output a charging control signal according to a constant voltage charging mode when the inverter output power is lower than the power reference; and in that the charging unit is configured to charge the battery in the constant current mode or in the constant voltage mode accordingly. the controller is configured to output the charging control signal according to a constant current charging mode when the inverter output power is equal or greater than the power reference and to output a charging control signal according to a constant voltage charging mode when the inverter output power is lower than the power reference; and in that the charging unit is configured to charge the battery in the constant current mode or in the constant voltage mode accordingly.