Skip to content

Latest commit

 

History

History
65 lines (39 loc) · 1.37 KB

ex1.md

File metadata and controls

65 lines (39 loc) · 1.37 KB

Create your first class

Definition

💻 Using SE38, create a new report called ZABAPOO_TRAIN_XXX where XXX is your trigramme

  • Title : My first ABAP OO report
  • Type : Executable report
  • Status: Test report

💾 save

Write down following code

CLASS lcl_flight DEFINITION.


ENDCLASS.

💡 compile

❓ Why is it compiling ?

Implementation

💻 Now add the implementation section. (no tips this time)

💡 compile

And this is all it takes to start a class. Well an empty one, but still, you've created your first class.

How do we write it using in the definition of our class ?

Visibility

💻 start to type PUBLIC and use CTRL + SPACE to get suggestions from auto completion.

Do it again for PRIVATE

💾 save then 💡 compile (or shorter CTRL + F3)

Now, your code should look like this

[...]
CLASS LCL_FLIGHT DEFINITION.
	PUBLIC SECTION.
	
	PRIVATE SECTION.
ENDCLASS.

CLASS LCL_FLIGHT IMPLEMENTATION.

ENDCLASS.
[...]

Questions

  • What are the keywords to wrap the definition part of a class ?
  • Where will you declare attributes that you want to hide from external referential ?
  • Where will you declare a behavior ? Where will you define it ?
  • What's the word that define the process of giving different visiblity settings to attributes and behaviors ?