Flipkart.com

Tuesday, June 22, 2010

Using Features in ABAP

Features can be effectively used in ABAP to code business logic and make the code easy to maintain.

Let us take a scenario. The business logic is to find out the HR admin position based on company code, personnel area, personnel subarea, Employee group and employee subgroup.


1. If company code = 0001, HR admin position eq 10000123.
2. If company code = 0002,
     2.1. Employee group = C, HR Admin position is 10000234.
     2.2. Other employee groups, HR Admin position is 10000235.
3. For all other company codes,
     3.1. If personnel subarea is 2345,
         3.1.1. If Employee group is D, HR Admin position is 10000236.
         3.1.2. For all other groups, HR Admin position is 10000237.
     3.2. For other personnel sub areas, HR admin position is 10000238.

To code the above logic in ABAP code will be very complex and will be very difficult to maintain if there is any change in business logic or the HR Admin positions. Changing the code would require the entire code to be retested for all other scenarios. A Feature allows us to separate out the business logic from the code and allows easy maintenance.

No comments:

Post a Comment