3.1 KiB
1. Goal
A rooftop solar installer checks a planned photovoltaic system before it sends a quotation. The quotation program works against one interface. The interface carries the request type, the reason codes, the limits and the check methods.
2. Open questions
None.
3. Context
- Package $TMP. The interface does not exist yet.
- The quotation program fills a request, calls the check through the interface {{P}}IF_SOLAR_CHECK and reads the reason code.
- The interface is the only object of this task.
4. Contract
- Create the interface {{P}}IF_SOLAR_CHECK in package $TMP.
- The interface is global and public.
- The interface contains exactly the types, the constants and the methods of section 5. Do not add other components.
5. Business rules
5.1 Types
-
TY_REASON is a character type of length 10. It carries one reason code.
-
TY_ROOF is a character type of length 4. It carries one roof type.
-
TY_REQUEST is a structure type with exactly these five components in this order:
component type meaning roof_type ty_roof the kind of the roof roof_size i the roof size in square metres panel_count i the number of planned panels tilt_angle i the roof pitch in degrees battery_kwh i the battery capacity in kWh -
TT_REQUEST is a standard table of TY_REQUEST.
-
TT_REASON is a standard table of TY_REASON.
5.2 Constants
-
C_REASON is a constant structure. Each component has the type TY_REASON and this value:
component value ok OK empty_input EMPTY roof_type ROOF roof_size SIZE panels PANELS tilt TILT battery BATTERY -
C_ROOF_TILE is a constant of type TY_ROOF with the value TILE.
-
C_ROOF_SLATE is a constant of type TY_ROOF with the value SLAT.
-
C_ROOF_FLAT is a constant of type TY_ROOF with the value FLAT.
-
C_MIN_PANELS is a constant of type i with the value 4.
-
C_MAX_PANELS is a constant of type i with the value 60.
-
C_MIN_TILT is a constant of type i with the value 5.
-
C_MAX_TILT is a constant of type i with the value 60.
-
C_MAX_BATTERY is a constant of type i with the value 20.
5.3 Methods
- The method CHECK has the importing parameter IS_REQUEST of the type TY_REQUEST and the returning parameter RV_REASON of the type TY_REASON.
- The method CHECK_MANY has the importing parameter IT_REQUEST of the type TT_REQUEST and the returning parameter RT_REASON of the type TT_REASON.
6. Constraints
- Release target: ABAP Platform 2025 (SAP_BASIS 816).
- Coding standards: Clean ABAP. No comment that restates the code.
- Out of scope: do not create a class, a report, a function module or a database table for this task.
7. Acceptance
- The interface {{P}}IF_SOLAR_CHECK is active and has no syntax error.
- The hidden tests pass.
- Write your own ABAP Unit tests for the interface in a global test class.