How to create first ABAP global class (simple calculator) in transaction SE24 (part I)?

In this tutorial, you will learn how to create global ABAPĀ  class in transaction SE24. It will be a simple calculator that can add, subtract, multiply and divide. This class will be used in some other example on this web.

Step 1. To create global class go to transaction SE24 (Class Builder). Put se24in the command field and hit Enter:

 

Step 2. Put new class name as “zcl_calculator“:

 

Step 3. Click on Create button:

 

Step 4. In Create Class popup fill description field i.e. with “First OO Calculator“:

 

Step 5. Click on Save button:

 

Step 6. You will be asked for a package to save your new class. You can choose either to save it locally by clicking on Local Object button:

 

Step 7. Or choose one fill package name from your system. In this example it will be “ztest“:

 

Step 8. You need to use Save button if you want to put an object in the package:

 

Step 9. The system will also ask you for a transport request:

 

Step 10. Click on Continue button:

 

Step 11. Now go to Methods tab and add the following methods:

 

Click here for part II How to create first ABAP global class (simple calculator) in transaction SE24 (part II)?

Written by 

Leave a Reply

Your email address will not be published. Required fields are marked *