41 lines
1.7 KiB
Markdown
41 lines
1.7 KiB
Markdown
# 1. Goal
|
|
A museum lends exhibits to other museums. Before the museum approves a loan
|
|
request, the loan desk calls one check module for each request. The check module
|
|
must have the same interface as the sample check module, because the loan desk
|
|
calls all check modules in the same way.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Function group {{P}}FG_LOAN exists in package $TMP.
|
|
- Function module {{P}}LOAN_SAMPLE exists in this group. It is the sample check
|
|
module. Its interface is the interface that all check modules must use.
|
|
|
|
# 4. Contract
|
|
- Create the function module {{P}}LOAN_CHECK in function group {{P}}FG_LOAN.
|
|
- Use exactly the interface of {{P}}LOAN_SAMPLE: the same parameter names, kinds,
|
|
types, and exceptions.
|
|
|
|
# 5. Business rules
|
|
1. If the loan period in days is less than 1, raise the exception INVALID_DAYS.
|
|
2. If the loan period is more than 90 days, the request is rejected. The reason
|
|
is 'TOO_LONG'. No other rule applies.
|
|
3. If the exhibit is insured, the request is approved. The reason is 'INSURED'.
|
|
The insurance rule has priority over the fragility rule.
|
|
4. If the exhibit is fragile, the request is rejected. The reason is 'FRAGILE'.
|
|
The fragility rule has priority over the insurance rule.
|
|
5. If the exhibit is neither insured nor fragile, the request is approved. The
|
|
reason is 'OK'.
|
|
6. Rules 3, 4 and 5 apply to a loan period of 1 to 90 days.
|
|
|
|
# 6. Constraints
|
|
- Release target: SAP_BASIS 816 (ABAP Platform 2025).
|
|
- Coding standards: Clean ABAP. Keep each method below 40 statements.
|
|
- Out of scope: do not change {{P}}LOAN_SAMPLE.
|
|
|
|
# 7. Acceptance
|
|
- The function module is active and has no syntax error.
|
|
- The tests of the check module pass.
|
|
- Write ABAP Unit tests for the function module in a global test class.
|