Spinner is right, the side stand switch is often at fault, but you need to furnish more information about the actual symptoms. Is the starter motor running with each press and the ignition system not firing the engine up?... Or is the starter motor simply not running on some presses of the starter button?
I had a similar problem early on and found it was the Kill switch that was the culprit. The starter motor would run reliably, but the ignition circuit was dead and so the engine would not fire. Eventually I discovered that gently manipulating the Kill switch lever while cranking would (sometimes anyway), fix things.
A careful disassembly of the button assembly showed the whole arrangement to be true German engineering... i.e. 500 parts were used to perform one simple task. It is filled with very delicate copper leaves and in my case, the Kill switch contacts were still closed most of the time even with the switch lever in the center "run" position. Once adjusted slightly, the system resumed normal operation.