The electrification of the transportation industry has emerged as a promising solution to reduce automotive emissions. However, this transition presents various challenges, such as the limited availability of charging infrastructure, grid capacity, and the high total cost of ownership for Battery Electric Vehicles (BEVs), primarily due to the cost of the battery. This study proposes an algorithm that generates charging schedules for a fleet of BEVs during their operational period to address these challenges. The algorithm provides a time frame and charging power for all vehicles in the fleet, which can optimize the use of charging infrastructure, distribute the grid load throughout the day, and reduce BEV operational costs by extending the battery lifetime. The algorithm was tested in a realistic case study within the European project URBANIZED. Simulation results shows a saving of 13% on the total cost of charging. Furthermore, the algorithm's execution time was less than 160 seconds for a fleet of 200 vehicles, considered real-time for a fleet charging operation. In conclusion, this algorithm offers a viable solution to address challenges in the electrification of the transportation industry. Fleet managers can benefit from its cost saving benefits and efficient execution time, making it a promising tool for transitioning to BEVs.