Independently of any context you can start profiling development objects using the corresponding wizard tool. To do this, you launch the profiling dialog using a shortcut. Then you specify the object (transaction, program ...) that you wish to profile in the selected system.
You can only start the profile function for a subset of development objects that are executable in the ABAP workbench. More precisely, the dialog enables you to start profiling for the following object types: