Problems to avoid programming ABAP
I'm going to program in ABAP for a BPC NetWeaver project. I would like to know about tips, tricks, the problems I can find and I must avoid. For example, not to hardcode Infoprovider's technical names because they can change after executing a transport, ... etc
Thanks in advance,
Rich Heilman replied
Hi. In most cases, writing ABAP inside of a BAdI implementation instead of using script logic will always be faster. The reason is, when your use a BAdI, it is part of the enhancement framework, which means the processing is dropped to the kernel, and gives you an expontial performance boost. This is compared to script logic, which is interpreted by the ABAP runtime, and simply executes ABAP code based on that interpretation, making the process somewhat slower. Another good tip when writing code in the BAdi implementations, is to use performance enhanceing techniques in your ABAP code, such as using hash tables to perform quick lookups. Try to hit the database as less as possible, so don't re-read master data each time in a loop. Read it once and store it, again in a hash table. Same with reading transaction if required, read it once and store it instead of reading it each time in a loop. Using these practices will make it run really fast for large volumes of data. I actually had to create one a while back where the script logic was running about 1 1/2 hours for 300k records. I got it to run in about 2 minutes using the BAdI, and some good performance tuning techniques like the ones mentinoed here.
Hope this helps.