ABAP Tips and Tricks #2: Generic Hints

  1. Initialization Event:
    This event is executed before the output of the selection screen.  The INITIALIZATION section is only performed when the ABAP is started directly, and is not executed if the ABAP is called or executed by another ABAP.  This event is also ignored in a batch environment.  It is frequently used to calculate special defaults for the selection screen.
  2. Table Loop:
    Whenever looping on a table, always CLEAR the table header or fill it with a generic key before the LOOP statement.
  3. Structured And Modular Programming Techniques :
    The use of structured and modular programming techniques, along with extensive but reasonable comments, greatly enhances the readability and maintainability of a program.

– Make use of CASE structures in place of extensive nested IF’s
– Use PERFORMS to modularize the ‘mainline’ area of the report
– Replace blocks of code within an extensive IF statement with a PERFORM
– Whenever possible, use the PERFORM command with the USING or CHANGING keywords