44 lines
1.8 KiB
Markdown
44 lines
1.8 KiB
Markdown
# 1. Goal
|
|
A textile mill inspects the fabric rolls of its looms. The quality team needs
|
|
one row for each roll with the fabric name, the fibre class, the loom, the
|
|
area and the grade. A report and an OData service will read the rows, so the
|
|
calculation must be in the database, in a CDS view.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Table {{P}}FABRIC (fabric master), package $TMP. Key: FABRIC (CHAR 10).
|
|
Fields: FABRIC_NAME (CHAR 20), FIBRE (CHAR 1).
|
|
FIBRE is 'C' for cotton, 'W' for wool, 'S' for silk and 'P' for polyester.
|
|
- Table {{P}}ROLL (fabric roll), package $TMP. Key: ROLL_ID (CHAR 10).
|
|
Fields: FABRIC (CHAR 10), LENGTH_CM (INT4), WIDTH_CM (INT4), DEFECTS (INT4).
|
|
The first three characters of ROLL_ID identify the loom that wove the roll.
|
|
|
|
# 4. Contract
|
|
- Create the CDS view entity {{P}}I_ROLL_GRADE in package $TMP.
|
|
- Elements, with these names: ROLL_ID (key), FABRIC_NAME, FIBRE_CLASS, LOOM,
|
|
AREA_SQM, GRADE.
|
|
- No authorization check (#NOT_REQUIRED).
|
|
|
|
# 5. Business rules
|
|
1. Show one row for each roll that has a fabric in {{P}}FABRIC. Do not show a
|
|
roll when its fabric is not in {{P}}FABRIC.
|
|
2. FABRIC_NAME is the name of the fabric of the roll.
|
|
3. FIBRE_CLASS is 'N' when the fibre is cotton, wool or silk. FIBRE_CLASS is
|
|
'S' for every other fibre.
|
|
4. LOOM is the first three characters of the roll ID.
|
|
5. AREA_SQM is LENGTH_CM multiplied by WIDTH_CM and divided by 10000. Round
|
|
the result to 2 decimals.
|
|
6. GRADE is 'A' when the roll has no defect. GRADE is 'B' when the roll has 1
|
|
to 3 defects. GRADE is 'C' when the roll has more than 3 defects.
|
|
|
|
# 6. Constraints
|
|
- Release target: 7.58.
|
|
- Out of scope: do not change {{P}}FABRIC and {{P}}ROLL.
|
|
|
|
# 7. Acceptance
|
|
- The view 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.
|