52 lines
1.8 KiB
Markdown
52 lines
1.8 KiB
Markdown
# 1. Goal
|
|
The CDS view entity {{P}}I_JOB_COST in package $TMP shows the cost of the
|
|
service jobs of a wind turbine service company. The view is active. Its element
|
|
names are old abbreviations that carry stems of SQL keywords. Refactor the view
|
|
in place. Keep the view name. Keep the behavior. Rename the elements to the
|
|
safe names of the contract.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Table {{P}}JOB (service job), package $TMP. Key: JOB_ID (CHAR 10).
|
|
Fields: CUSTOMER (CHAR 10), CALC_MODE (CHAR 1), GROUP_CODE (CHAR 2),
|
|
JOB_DATE (DATS).
|
|
- Table {{P}}JOBL (work line of a service job), package $TMP.
|
|
Key: JOB_ID (CHAR 10), LINE_NO (INT4). Fields: WORK_HOURS (DEC 5,2),
|
|
RATE (DEC 15,2).
|
|
- The view {{P}}I_JOB_COST is in package $TMP and is active. The current
|
|
definition of the view is the specification of the calculation.
|
|
- A report and an OData service read the view. They use the element names of
|
|
the contract.
|
|
|
|
# 4. Contract
|
|
- The CDS view entity {{P}}I_JOB_COST in package $TMP. The view name stays the
|
|
same.
|
|
- Elements, with these names. They replace the current element names:
|
|
- JOB_ID (key)
|
|
- CUSTOMER
|
|
- CALC_MODE
|
|
- GROUP_CODE
|
|
- JOB_DATE
|
|
- WORK_HOURS
|
|
- LINE_COUNT
|
|
- JOB_VALUE
|
|
- No authorization check (#NOT_REQUIRED).
|
|
|
|
# 5. Business rules
|
|
1. The behavior of {{P}}I_JOB_COST must not change. Read the current definition
|
|
of the view in package $TMP. It is the specification of the calculation.
|
|
2. The element names are the names in the contract. No element name is a
|
|
reserved word.
|
|
|
|
# 6. Constraints
|
|
- Release target: 8.16 (ABAP Platform 2025).
|
|
- Coding standards: Clean ABAP. No ATC priority 1 or 2 findings.
|
|
- Out of scope: do not change {{P}}JOB and {{P}}JOBL.
|
|
|
|
# 7. Acceptance
|
|
- The view {{P}}I_JOB_COST is active and has no syntax error.
|
|
- The hidden tests pass.
|
|
- Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.
|