Every one tell me that when you open some screen at the first time, the sap will compile the abap program and will not compile again at the next time.But I found actually when I open some screen at the 2th or 3th or more times,the sap will still compile the abap again.Such as open the T-CODE va01,mm01,and so on,the sap will show some message below the screen to show it was compiling the abap program.This make the operation spend me huge time.Is there any one could tell me how to resolve the problem or give me some advice?And I will appreciate him/her very much.Thank you.
SAP compiles the source code as it is needed. This compiled code is then stored in the database and used for future uses of the program, until the source is changed.
Most-likely when you ran the transaction a 2nd / 3rd time and saw compilation messages it was either due to different areas of code being run than the first time, or further ABAP changes having been done since the first time, invalidating the compiled code. Note that activation of user exists / enhancements can also trigger recompiling.
To "eliminate" this compiling, or at least get it out of the way. After upgrades, support stacks or notes, you can request your Basis team run the SGEN transaction. This transaction mass generates programs by group and is normally used after upgrades or support stacks. Do note that they need to be very selective in what 'software components' they select to compile - you only want to compile areas that you actually use; otherwise, you just waste space. Lastly, if your Basis team is going to generate a lot of components, a large number of DB logs will be triggered - they may want to either closely police the archlogs area or disable DB logging and do an offline backup after the generation (if you can afford the downtime - like with a test system).
Hope this helps.