Wouldn't abolition of cash give rise to a substitute currency? Some countries (e.g. Sweden and Denmark) plan to abolish physical cash in the future and restrict the use of cash to electronical deposits. One of the reasons for this is to prevent hoarding / boost spending of money, which could be achieved by introducing negative interest rates on deposits far below zero.

However, as far as I know, in times of hyperinflation, people resorted to substitute currencies (either foreign currencies or commodities like cigarettes). Wouldn't the same happen if cash was abolished?

For example, suppose the bank charges 20% or more on deposits and you can't withdraw your money in cash (since there is no cash), and you don't want to buy stocks or property for some reason (it's risky or hard to liquidate) and suppose other people have the same problems. Wouldn't it be reasonable then to create and use some alternative currency, like cigarettes or maybe a local currency, which you can store physically?
"Cash" is an emergent phenomenon of human economic organization. It exists for lots of reasons, as a provider of economic anonymity, a low transaction cost solution to the double-coincidence of wants, a portable medium of exchange, and a tool of economic accessibility for all including those in the informal economy, foreigners, the unbanked, and those with poor credit, among others. 

A country can make it difficult to use cash in the interest of thwarting anonymity and convenience, usually to prevent money laundering and tax evasion. They can do so by taxing the use of cash, failing to enforce contracts calling for cash, refusing to make more, even criminalizing the possession of cash. 

But cash is unlikely to die easily. We know from the experience with drug and alcohol prohibition as well as the international ivory and rhino horn trades that while the regulation can can certainly influence prices and thereby quantities demanded, it is awfully difficult to destroy a market for a valuable product. For a more specific example, possession of money is forbidden to US convicts. Nevertheless, they have developed internal monetary economies based around canned fish, shelf-stable pastries, as well as cigarettes and stamps. Cigarettes also emerged as money in WWII P.O.W. camps, showing that even the Nazis couldn't keep a monetary economy from forming.

Sweden in particular has a significant additional obstacle to keeping currency out of their economy. They share boarders with Norway and Finland, each with their own currency. Go to practically any boarder region or tourist spot around the world and you'll see tellers happy to take dollars, euros, or yen in addition to the local currency. It is especially difficult to ditch cash when other sources of cash are available.