The high-mass star forming sites SgrB2(M) and SgrB2(N) have been the target of numerous studies, revealing e.g. a rich chemistry. We want to characterize their physical and chemical structure using ALMA high-angular resolution observations at mm wavelengths, reaching spatial scales of about 4000 au, and covering the whole band 6 (from 211 to 275 GHz). In order to determine the continuum emission in line-rich sources, we use a new statistical method: STATCONT. We detect 27 continuum sources in SgrB2(M) and 20 in SgrB2(N). We study the continuum emission across the ALMA band 6, and compare it with previous SMA 345 GHz and VLA 40 GHz observations, to study the nature of the sources detected. The brightest sources are dominated by (partially optically thick) dust emission, while there is an important degree of contamination from ionized gas free-free emission in weaker sources. While the total mass in SgrB2(M) is distributed in many fragments, most of the mass in SgrB2(N) arises from a single object, with filamentary-like structures converging towards the center. There seems to be a lack of low-mass dense cores in both regions. We determine H2 volume densities for the cores of about 10^5-10^7 Msun pc^-3, one to two orders of magnitude higher than the stellar densities of super star clusters. In general, SgrB2(N) is chemically richer than SgrB2(M). There seems to be a correlation between the chemical richness and the mass of the fragments, with more massive clumps being more chemically rich. Both SgrB2(N) and SgrB2(M) harbour a cluster of hot molecular cores. We compare the continuum images with predictions from a detailed 3D radiative transfer model that reproduces the structure of SgrB2 from 45 pc down to 100 au. This dataset, together with ongoing projects in the range 5 to 200 GHz, better constrain the 3D structure of SgrB2, and allow us to understand its physical and chemical structure.