"According to §63 and §64 of the Penal Code (Strafgesetzbuch, StGB) it is possible under certain circumstances to order the placement of mentally ill or addicted offenders in special closed correctional facilities (like psychiatric facilities or withdrawal clinics).
"The Narcotics Act (Betäubungsmittelgesetz, BtMG) allows the suspension of proceedings in cases of minor guilt or lack of public interest in prosecution (§31a BtMG). This applies mainly to consumption-related offences, in particular when they occur for the first time and third parties are not involved. These regulations are subject to different regional application as shown by a study carried out by Schäfer & Paoli (2006). With regard to the prosecution of consumption-related offences involving cannabis, there has recently been a move to greater convergence of the definitions of limit values for 'small quantities' in the Laender in line with the guidelines passed by the Federal Constitutional Court. Further details can be found in chapter 1.2.2.
"It is moreover possible to defer a prison sentence of up to two years to provide the drug addict with the chance to undergo therapy ('therapy not punishment', §35 BtMG)."

Source

German Reference Centre for the European Monitoring Centre for Drugs and Drug Addiction (Deutsche Beobachtungsstelle fuer Drogen und Drogensucht (DBDD)), "2012 National Report to the EMCDDA by the Reitox National Focal Point: Germany: New Developments, Trends and In-Depth Information on Selected Issues - Drug Situation 2011/2012" (Munich, Germany: DBDD, Oct. 2012), pp. 168-169.
http://www.emcdda.europa.eu/h…
http://www.emcdda.europa.eu/a…