In ABAP, we can create classes in two ways: locally or globally. The main differences are that local classes can be used only in the program in which the class is created, while a global class can be used in every program or function module. Also, the ways in which these classes are created are different. In a local class, we need to create a definition and implementation of the class in the program, and, in a global class, the definition and implementation are created in the class builder.
We create global classes more often than local classes because it's possible to reuse them. If we want to use a local class in a different program, we need to create the same local class in that program, which is not necessary for a global class.