I actually don't see a problem with that - I would just assemble the cabinet normally and place it as desired. Then use the drill to make 2-4 holes through the cabinet, lightly drilling into the wall behind it. Then move the cabinet away; based on the drilled wall, you can see where the anchors need to go. Insert anchors into the wall, put the cabinet back, and screw it in with long screws. If there is a small gap between the cabinet and the wall, maybe place spacers (roof battens, beer coasters, or whatever) in between to avoid twisting the cabinet when screwing it in. I've never done this before, but that's how I would try it.