SAP KISS PRINCIPLE - Guide
Get Example source ABAP code based on a different SAP table
KISS Principle
ABAP_BACKGROUND
The KISS principle says that you should always choose the simplest solution for a problem. KISS is an acronym and can have any of the following meanings (the list is not exhaustive):
The basic statement of the KISS principle is similar to Occam's razor, which says that in science the preferred theory is the one that makes fewest assumptions to explain observations (see Wikipedia entry on the KISS principle).
ABAP_RULE
Follow the KISS principle, and limit the complexity of your programs as far as possible.
ABAP_DETAILS
The best solution to a problem is usually the one that is as simple, minimalist, and easy to understand as possible, while ensuring stability, understandability, and maintainability in addition to functional correctness.
There are plenty of bad examples of the KISS principle. Why is this?
To develop according to the KISS principle, you should ensure right from the start that the complexity of the program remains manageable. Rules that support this approach relate to the
Latest notes:
If existing programs do not follow the KISS principle, and these programs need to be further developed, we recommend refactoring as appropriate. Refactoring refers to the process of manually or automatically improving the structure of programs while retaining the observable program behavior. It improves legibility, understandability, maintainability, and extensibility, as well as considerably reducing the related effort for troubleshooting and functional enhancements (see Wikipedia entry on refactoring). The (incremental) refactoring of an existing program is not only useful for following the above rule, but also for all following rules.
The refactoring of existing code is supported by the required coverage by
ABAP_HINT_END
Example ABAP Coding
The figure below shows the structure of a method that does not follow the KISS principle. The method consists of approximately 160 statements and reaches a
IMAGE ABDOC_KISS.jpg 570 440
The result is illustrated on the right of the figure. By splitting the method M into three methods, each with less than 100 statements and a maximum nesting depth of 5 levels, manageable modularization units were created, which follow the rules for
ABAP_EXAMPLE_END