- SAP ABAP Reports
- Report Types and Events
- Message Class
- Example of Classical Report
- Example of Interactive Report
- Example of ALV Report
- Example of Blocked ALV Report
- Example of Hierarchical Report
- Module Pool Programming
- Screen Painter Components
- Events in Flow Logic Editor
- Screen Elements and Creation Steps
- Working with Validations
- Database Operations
- OO Programming in ABAP
- Types of Programming Structure
- Key Features of OO Programming
- Classes and Objects
- Types of Visibility Section
- Class Defination and Implementation
- Object Creation for Class
- Method Declaration and Implementation
- Types of Component Class
- Global Class and implement GLOBAL methods
- OOP's ALV
- OOP's BDC
24OOP0309 – Steps to Create Global Class and implement GLOBAL methods
Step 1: Access the Class Builder (SE24)
- Log in to your SAP system.
- Go to the transaction code SE24.
- In the “Class/Interface” field, enter a name for your class starting with `Z` or `Y` (e.g., `ZCL_MY_GLOBAL_CLASS`) to indicate that it’s a custom development object.
- Click Create.
Step 2: Define the Class Attributes
- In the “Class Builder” screen, you’ll be prompted to enter a short description for your class.
- Choose a class type. For a typical global class, select ‘Class’.
- In the “Attributes” tab, define the attributes (variables) that your class will use. These attributes can be public, protected, or private depending on how you want them accessed.
Step 3: Define the Methods
- Navigate to the Methods tab.
- Define the methods that your class will use. Methods are the functions that belong to the class and operate on the class’s attributes.
- For each method, specify whether it’s public, protected, or private.
- Provide a meaningful description for each method.
Step 4: Implement the Methods
- Select the method you want to implement and click on **Method** in the toolbar.
- The system will take you to the ABAP Editor where you can write the code for the method.
- Implement the method logic according to your requirements.
- Once done, save and activate your code.
Step 5: Implementing GLOBAL Methods
If you want to define methods that are globally accessible (e.g., class methods that don’t depend on instance-specific data), you can create static methods.
- In the Methods tab, when defining a new method, check the Static checkbox. This defines the method as a class method.
- Implement the logic for this static method in the ABAP Editor.
- Static methods can be called using the class name without needing to create an instance of the class.
Step 6: Activate the Class
- After defining and implementing your methods, return to the main Class Builder screen.
- Click on Activate (Ctrl+F3). This will activate your class and make it available for use throughout the SAP system.
Step 7: Testing the Class
- To test your global class, go to transaction SE80.
- In the Object Navigator, find your class under the “Repository Browser” and right-click to create a test program or use the ABAP editor to write a quick test.
- Instantiate your class (if necessary) and call its methods to see if everything works as expected.
Author : Aniket Pawar, 9373518385
24OOP0309 – Steps to Create Global Class and implement GLOBAL methods
Step 1: Access the Class Builder (SE24)
- Log in to your SAP system.
- Go to the transaction code SE24.
- In the “Class/Interface” field, enter a name for your class starting with `Z` or `Y` (e.g., `ZCL_MY_GLOBAL_CLASS`) to indicate that it’s a custom development object.
- Click Create.
Step 2: Define the Class Attributes
- In the “Class Builder” screen, you’ll be prompted to enter a short description for your class.
- Choose a class type. For a typical global class, select ‘Class’.
- In the “Attributes” tab, define the attributes (variables) that your class will use. These attributes can be public, protected, or private depending on how you want them accessed.
Step 3: Define the Methods
- Navigate to the Methods tab.
- Define the methods that your class will use. Methods are the functions that belong to the class and operate on the class’s attributes.
- For each method, specify whether it’s public, protected, or private.
- Provide a meaningful description for each method.
Step 4: Implement the Methods
- Select the method you want to implement and click on **Method** in the toolbar.
- The system will take you to the ABAP Editor where you can write the code for the method.
- Implement the method logic according to your requirements.
- Once done, save and activate your code.
Step 5: Implementing GLOBAL Methods
If you want to define methods that are globally accessible (e.g., class methods that don’t depend on instance-specific data), you can create static methods.
- In the Methods tab, when defining a new method, check the Static checkbox. This defines the method as a class method.
- Implement the logic for this static method in the ABAP Editor.
- Static methods can be called using the class name without needing to create an instance of the class.
Step 6: Activate the Class
- After defining and implementing your methods, return to the main Class Builder screen.
- Click on Activate (Ctrl+F3). This will activate your class and make it available for use throughout the SAP system.
Step 7: Testing the Class
- To test your global class, go to transaction SE80.
- In the Object Navigator, find your class under the “Repository Browser” and right-click to create a test program or use the ABAP editor to write a quick test.
- Instantiate your class (if necessary) and call its methods to see if everything works as expected.
Author : Aniket Pawar, 9373518385