Appearance
Lesson 1 Practice — Course Eligibility Checker
Create:
text
ZCL_ABAP_L01_PRACTICE_###Implement IF_OO_ADT_CLASSRUN.
Problem
A training provider accepts a registration when:
text
name is present
age >= 18
experience_years >= 0
accepted_terms = abap_trueIf accepted, calculate:
text
completion_year = current_year + 1Requirements
Create variables for:
text
name
age
experience_years
accepted_terms
current_yearUse:
text
string template output
arithmetic
IF / ELSEIF / ELSE
abap_bool
at least one FINAL(...) local valueTest at least four cases:
- valid applicant;
- missing name;
- under 18;
- terms not accepted.
Questions
- Why must the class be activated before
F9uses the latest code? - When would an explicit
DATA ... TYPE ...declaration be clearer than inlineDATA(...)? - What does
IS INITIALtest? - Why use
abap_true/abap_falseinstead of customY/Nvalues? - What is the difference between Eclipse/ADT and the ABAP backend?