How to build global class in ABAP (SE24) and Calling Class in report (SE38) ?
How to build global class in ABAP in SE24 step by step ?
1. Go to T-code - SE24 and give your class name.
press the create button for creating the class.
2. Then choose Radio button Class and Enter.
3. Add the description and select inst. generation as per your need and click on save.
4. Select your Package or you can save in Local object also.
5. Here we can define methods, parameters, events, attributes etc.
6. By clicking on method tab, we can give method name, decide level, visibility and description.
7. For defining Parameters we have to select the particular method and then click on parameter tab
(on top of method name). For parameter :-
- Give parameter name, type, typing method.
- Associated type (Data element, Structures, Table type,Domain, etc).
8. Then press on method tab and double click on method name or we can click on Source Code tab
and Source code can be written in programming space.
as well.
10. Go to T-CODE - SE38 and give the Program name, Select source code and then press Create.
11. After that pop up will appear where we have to give the Title and select Type as Executable program, click Save.
12. Declare local object in report which will ( Data: lo_demo type ref to the class )that we made in SE24 .
Then click on Pattern and pop up will appear, Select the radio button as Shown then press Enter.
13. Then select Call method and fill those fields then press Enter.
14. This will generate some lines in programs with parameters( line no.11 to 16 ).
For giving the exporting and importing parameter we have to declare variables and pass values through Selection Screen.
If you didn't know anything about the OOABAP then visit my blog for Introduction of OOABAP.
Please comment below your queries and share .
THANK YOU FOR READING
Comments
Post a Comment