Ever wondered how to execute a piece of ABAP code in a ‘closed’ productive BW system? Well, here’s your answer.
Log on to the required (productive) BW system and create a new analysis process via tcode RSANWB

Create an extraction from a dummy InfoObject, e.g. 0MATERIAL. It doesn’t really matter which infoobject you take, as long as it doesn’t contain much data.

Map a routine object to the InfoObject and then go to the Properties dialog of the routine.

Go through all the tab pages, create a dummy mapping for the source and target fields and enter your code in the Routine tab. In this case I’ve coded a line which will display an Information message via a pop-up.

Perform a preview via Display data. This actually executes the code which is placed in the routine tab!

The result of the “Display data” (aka the execution of the code) generates the following output:

And there you have it. ABAP code being executed in a (productive) BW system. Please use it wisely!!!
A big thanks to Crispian Stones for pointing this out to me.