52 lines
2.2 KiB
Markdown
52 lines
2.2 KiB
Markdown
# 1. Goal
|
|
Fix the CDS view entity {{P}}I_MELT_OUT in package $TMP. The view reports the
|
|
output of the casting melts of a foundry. The production team says that the
|
|
figures in the view are wrong for many melts.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- Table {{P}}MELT (melt header), package $TMP. Key: FURNACE_ID (CHAR 4),
|
|
MELT_DATE (DATS), MELT_NO (NUMC 4). Fields: ALLOY (CHAR 10), CREW (CHAR 10).
|
|
- Table {{P}}CASTING (casting), package $TMP. Key: FURNACE_ID (CHAR 4),
|
|
MELT_DATE (DATS), MELT_NO (NUMC 4), PART_NO (INT4). Fields: PART_NAME
|
|
(CHAR 10), WEIGHT (DEC 15,2, the weight of one casting in kilograms).
|
|
- A melt number is not unique in the foundry. The same melt number occurs in
|
|
other furnaces and on other dates.
|
|
- The CDS view entity {{P}}I_MELT_OUT already exists in package $TMP.
|
|
|
|
The production team reports these symptoms:
|
|
- The pieces and the net weight of a melt are too high when the melt number of
|
|
the melt also occurs in another furnace or on another date.
|
|
- The view shows melts that have no castings.
|
|
|
|
# 4. Contract
|
|
- Fix the CDS view entity {{P}}I_MELT_OUT in package $TMP. The name stays the
|
|
same.
|
|
- Elements, with these names: FURNACE_ID (key), MELT_DATE (key), MELT_NO (key),
|
|
ALLOY, PIECES, NET_WEIGHT.
|
|
- No authorization check (#NOT_REQUIRED).
|
|
|
|
# 5. Business rules
|
|
1. The view shows one row for each melt that has castings. A melt without
|
|
castings must not appear in the view.
|
|
2. PIECES is the number of castings of the melt.
|
|
3. NET_WEIGHT is the sum of the weights of the castings of the melt, in
|
|
kilograms with 2 decimals.
|
|
4. A casting belongs to the melt of its own furnace, its own date and its own
|
|
melt number. Castings of another furnace, of another date or of another melt
|
|
number must not contribute to the figures of a melt.
|
|
5. All other behavior of the view stays the same.
|
|
|
|
# 6. Constraints
|
|
- Release target: ABAP Platform 2025 (SAP_BASIS 816).
|
|
- Coding standard: Clean ABAP.
|
|
- Out of scope: do not change {{P}}MELT and {{P}}CASTING. Do not change the
|
|
element names or the data types of the view.
|
|
|
|
# 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.
|