That is really disturbing because you have to wait until the compiling finish then you can do the transaction. To avoid that you have to compile the SAP programs using SAP Load Generator (SGEN) as explained below.
1. Call transaction SGEN.
Choose “Generate All Objects of Selected Software Components” on the initial screen. And Press Continue to next step.
2. Select the Software Component you want to compile.
Note: Select all components for simplicity and press “Continue” to next step.
3. Use Parallel Process for quicker process (read How to create RFC Group for Parallel Processing for detailed).
Press “Continue” to next step.
4. Now you will see the total number of objects to be generated.
Click “Start Job Directly” to start the compiling. You will read a message “The generation job was successfully scheduled or started” at the bottom left.
Click “Job Overview” icon to monitor your newly generated job.
6. You can also go to SM50 – process overview to monitor the work process (read article How to check SAP Application Servers and Work Process for detailed).
Wait until the compiling process finish. Now you will not face program compiling anymore after calling any SAP transaction codes.