From the course: SAP ABAP Programming Best Practices

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Local and global classes

Local and global classes

- [Instructor] To review. The first version of our calculation program was report ZST2CALC where the functionality was implemented in a local processing class. The processing class was instantiated by the static startup method run and the actual processing was done by code in the constructor method. Next, we converted the local class from report ZST2CALC into a global class and created a new version of the report that used the global class for processing. In the second version of the program, the processing class was instantiated by the static startup method run as before. But this time the actual processing was also done in the same startup method. If this had been a more complex program, changing the structure of the code in this way would have been a lot less trivial and may have led to errors. In the next section, we will show a more robust way to reuse code via inheritance.

Contents