Ex:-
Steps :-
1.Abstract Class Creation.
- Go to Transaction Code SE24.
- Enter the class name start's with ZCL_< class name > and click on Create.
- Enter the description.
- Select the instantiation as Abstract.
- Un-check the Final Keyword.
- Click on SAVE.
- Pop-up will appear.
- Select Abstract .
- Pop-up will appear.
- Click on Continue.
- Click on Change.
- Check the status bar.
- Create a normal method to display data.
- To pass the parameter , place the cursor on method name and click on Parameters.
- Enter the importing parameter.
- Click on Save and click on back button.
- To implement the method , double click on method name.
- Enter the logic.
- Pop-up will appear.
- Enter the description and click on Create Inheritance.
- Go to Transaction code SE38.
Source Code
DATA : OBJ TYPE REF TO ZCL_INHERIT_ABSRACT.
DATA : IT_VBAP TYPE TABLE OF VBAP.
PARAMETERS : P_VBELN TYPE VBAP-VBELN.
START-OF-SELECTION.
CREATE OBJECT OBJ.
CALL METHOD OBJ->FETCH_DATA
EXPORTING
IM_VBELN = P_VBELN
CHANGING
CH_ITAB = IT_VBAP
.
CALL METHOD OBJ->DISPLAY
EXPORTING
IM_ITAB = IT_VBAP
.
No comments:
Post a Comment