Comparing hydrocarbons with batteries
As Olin Lathrop wrote, the big problem is energy density: hydrocarbon fuels simply offer a huge amount of energy per unit mass, compared to any current battery technology. To put some numbers on this, we can look at Wikipedia's page on energy density. Let's compare ethanol (probably the least energy-dense of the commonly used camping stove fuels) with non-rechargeable lithium batteries (the most energy-dense of current battery technologies).
Ethanol fuel provides 26.4 MJ/kg; lithium batteries provide 1.8 MJ/kg -- less than one-fourteenth as much per unit mass. So if you had 100 g of ethanol (about 127 ml) for cooking purposes and wanted to substitute it with electrical power, you'd need about 1.4 kg of disposable lithium batteries. If you want rechargeable lithium-ion batteries, you'll need about 2.8 kg of them (the energy density is about half that of disposables). As gerrit pointed out in the comments, you also need to think about power density: even if your battery contains enough energy to cook, it might not be able to output that energy fast enough for practical cooking.
Battery technology is improving all the time, but there are no technologies currently in development which would give anything like the order-of-magnitude improvement needed to make them competitive with hydrocarbons for energy density.
So it's not ideal, but is it feasible?
It's clear that batteries are far less energy-dense than hydrocarbon fuels, but that doesn't necessarily mean that they're a lost cause -- perhaps the extra weight would be small enough to be manageable, especially if you're hiking in a German forest where the only alternatives to flameless heating are breaking the law and eating cold food.
I'll start by picking a battery pack, then look at how much cooking we could get out of it. This E-bike battery pack is currently retailing on Amazon for around 277 USD. Its vital statistics are: 24 V, 11 Ah, 262 Watt-hours or 943 kJ of energy capacity. It weighs about 2.3 kg and can output 15 Amps of continuous power, which gives a maximum of 360 Watts. (I specifically looked for an e-bike battery pack, since they tend to be designed for relatively high power output.) For cooking, let's keep it simple and decide that we just want to boil water, which we can then use for beverages, instant soups, noodles, dehydrated meals, and so on. So we can attach the battery pack to a 24-volt electric immersion heater like this one. It's rated at 200 Watts, well within the capacity of the battery. I don't see a weight specified on this one, but other similar heating elements I've seen online weigh under 100 g, so our whole electric heating set-up is under 2.4 kg.
How many hot meals can we make with this set-up? Water has a specific heat capacity of about 4.18 J⋅g−1⋅K−1. Let's say that for each meal we want to heat 500 ml of water from 15°C to 100°C. That's going to require 4.18 × 500 × 85 = 177650 J of energy. Let's round up and call it 200 kJ since the water might be colder and we'll be losing some heat to the pot. As a double-check on this calculation, I just timed my 1 kW kettle bringing 500 ml of 11°C tap water to a rolling boil; it took 210 seconds, so (assuming the power rating is correct) used 210 kJ of energy. Remembering that the battery pack holds 943 kJ and using this higher figure for the water boil, we get 943 / 210 =~ 4.5 half-litre boils from a 2.4 kg electric heating system.
Whether this is practical or not depends on the circumstances and personal judgement. On a two-day hike, this set-up would give you at minimum a hot drink every morning, and a hot drink and hot meal every evening. If you can manage on 560 ml of boiling water per day, you could even stretch as far as four days. The 2.4 kg would probably be unthinkable for a hard-core ultralighter, but it's clearly not an impossible weight to carry. For longer hikes, of course, it swiftly becomes impractical. At this point you probably have to start thinking about solar panels for recharging in the wilderness :-).
Things are getting better (but very slowly)
Lithium-ion technology has been on the market since 1991, with variable but fairly continuous improvements from one year to the next. Energy density tends to increase, on average, by a few percent per year. This makes for significant improvements in the long term: as the graph below from Masias et al. (2013) shows, energy density of the common 18650 battery cell improved by a factor of more than 2.5 between 1991 and 2013:
Similar trends can be seen in the data of Jeong et al. (2011) and Pistoia (2014).
We can probably expect these marginal improvements to continue at least for a few years more (Tesla seem fairly confident about it, for instance). So our 2.4 kg weekend water-boiler will probably come down below 2 kg in the foreseeable future, but beyond that it's hard to say. Even if lithium-ion energy density could continue to improve indefinitely at 10% per year, it would take over two decades to catch up with ethanol. Would-be electric hikers might do better to pin their hopes on the development of some entirely new battery design. There are plenty of research groups working on potentially revolutionary new battery technologies, but potentially is the key word here: very few bright ideas survive the long journey from notebook to laboratory to factory.
Jeong, G., Kim, Y. U., Kim, H., Kim, Y. J., & Sohn, H. J. (2011). Prospective materials and applications for Li secondary batteries. Energy & Environmental Science, 4(6), 1986-2002.
Masias, A., Snyder, K., & Miller, T. (2013). Automaker Energy Storage Needs for Electric Vehicles. In Proceedings of the FISITA 2012 World Automotive Congress (pp. 729-741). Berlin: Springer.
Pistoia, G. (Ed.). (2014). Lithium-ion batteries: advances and applications. Amsterdam: Elsevier.