ADT fallback: Accept headers for FUNC; G0189 accepted; regen2 results
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
@@ -1,52 +1,71 @@
|
||||
# 1. Goal
|
||||
A coffee roastery plans its daily production. A planning program calls one
|
||||
function module for each production day. The function module groups the roast
|
||||
order lines of the day by coffee blend and returns the total green coffee
|
||||
quantity of each blend. The planning program shows the blend with the largest
|
||||
quantity first.
|
||||
A regional emergency control centre collects the open emergency calls of two
|
||||
control centres. The dispatch program calls one function module for each
|
||||
dispatch run. The function module must merge the calls of both control centres
|
||||
and must return the figures of the dispatch list.
|
||||
|
||||
# 2. Open questions
|
||||
None.
|
||||
|
||||
# 3. Context
|
||||
- Function group {{P}}FG_ROAST exists in package $TMP.
|
||||
- Table {{P}}ROASTS exists in package $TMP. It stores the roast order lines of
|
||||
a production day.
|
||||
- Table {{P}}BLENDS exists in package $TMP. It is the line type of the result
|
||||
- Function group {{P}}FG_ALERT exists in package $TMP.
|
||||
- The database table {{P}}ALERT_A exists in package $TMP. It contains the open
|
||||
emergency calls of control centre A.
|
||||
- The database table {{P}}ALERT_B exists in package $TMP. It contains the open
|
||||
emergency calls of control centre B.
|
||||
- Both tables have the same fields:
|
||||
- CALL_ID: the call number, 10 characters.
|
||||
- PRIORITY: the urgency. 1 is the highest urgency, 5 is the lowest urgency.
|
||||
- CALL_DATE: the date on which the call was reported.
|
||||
- CALL_TIME: the time at which the call was reported.
|
||||
- DISTRICT: the district of the caller, 4 characters.
|
||||
- CALL_ID is the key of each table. A call ID occurs at most one time in each
|
||||
table.
|
||||
- The class {{P}}ROAST_SEED fills {{P}}ROASTS with sample data. Run it to get
|
||||
test data.
|
||||
|
||||
# 4. Contract
|
||||
- Create the function module {{P}}ROAST_SUM in function group {{P}}FG_ROAST.
|
||||
- Interface of {{P}}ROAST_SUM:
|
||||
- IMPORTING it_orders TYPE STANDARD TABLE OF {{P}}ROASTS
|
||||
- EXPORTING et_totals TYPE STANDARD TABLE OF {{P}}BLENDS
|
||||
- EXPORTING ev_grand_total TYPE decfloat34
|
||||
- The function module has no exceptions.
|
||||
- Create the function module {{P}}ALERT_MERGE in function group {{P}}FG_ALERT.
|
||||
- The function module has this interface:
|
||||
- Importing parameter IV_MAX_PRIORITY, type i.
|
||||
- Exporting parameter EV_COUNT, type i.
|
||||
- Exporting parameter EV_DUPLICATES, type i.
|
||||
- Exporting parameter EV_FIRST_CALL_ID, type string.
|
||||
- Exporting parameter EV_FIRST_DISTRICT, type string.
|
||||
- Exporting parameter EV_LAST_CALL_ID, type string.
|
||||
- Exception INVALID_PRIORITY.
|
||||
|
||||
# 5. Business rules
|
||||
1. A line of it_orders is a production line if its quantity is greater than 0.
|
||||
A line with a quantity of 0 or less is not a production line.
|
||||
2. et_totals has exactly one line for each blend that has at least one
|
||||
production line in it_orders.
|
||||
3. The total quantity of a blend is the sum of the quantities of all its
|
||||
production lines.
|
||||
4. Sort et_totals by total quantity. The largest total quantity comes first.
|
||||
5. If two blends have the same total quantity, the blend that is smaller in the
|
||||
character order comes first.
|
||||
6. ev_grand_total is the sum of the total quantities of all lines of et_totals.
|
||||
7. If it_orders is empty, or if it_orders has no production line, et_totals is
|
||||
empty and ev_grand_total is 0.
|
||||
1. The function module reads the open calls of both control centres from the
|
||||
tables {{P}}ALERT_A and {{P}}ALERT_B.
|
||||
2. The dispatch list contains each call ID at most one time.
|
||||
3. If one call ID is in both tables, the dispatch list contains the call with
|
||||
the earlier report time. The report time is CALL_DATE first and CALL_TIME
|
||||
second.
|
||||
4. If both calls with the same call ID have the same report time, the dispatch
|
||||
list contains the call from {{P}}ALERT_A.
|
||||
5. The dispatch list contains only calls with a PRIORITY that is at most
|
||||
IV_MAX_PRIORITY.
|
||||
6. The dispatch list is sorted by PRIORITY in ascending order. Lines with the
|
||||
same PRIORITY are sorted by CALL_DATE in ascending order, then by CALL_TIME
|
||||
in ascending order, then by CALL_ID in ascending order.
|
||||
7. EV_COUNT is the number of lines in the dispatch list.
|
||||
8. EV_DUPLICATES is the number of call IDs that are in both tables. Rule 5
|
||||
does not change EV_DUPLICATES.
|
||||
9. EV_FIRST_CALL_ID and EV_FIRST_DISTRICT are the call ID and the district of
|
||||
the first line of the dispatch list. EV_LAST_CALL_ID is the call ID of the
|
||||
last line of the dispatch list. If the dispatch list is empty, these three
|
||||
parameters are empty strings.
|
||||
10. If IV_MAX_PRIORITY is smaller than 1 or larger than 5, raise the exception
|
||||
INVALID_PRIORITY.
|
||||
11. If a call in {{P}}ALERT_A or in {{P}}ALERT_B has a PRIORITY that is smaller
|
||||
than 1 or larger than 5, raise the exception INVALID_PRIORITY.
|
||||
|
||||
# 6. Constraints
|
||||
- Release target: 7.58.
|
||||
- Package: $TMP. Do not use transports.
|
||||
- Coding standard: Clean ABAP. Keep the function module short. Choose the
|
||||
internal table kind and the access path that fit the task.
|
||||
- Out of scope: do not change {{P}}ROASTS, {{P}}BLENDS, {{P}}ROAST_SEED.
|
||||
- Apply the coding standards of Clean ABAP.
|
||||
- Out of scope: do not change the tables {{P}}ALERT_A and {{P}}ALERT_B and the
|
||||
function group {{P}}FG_ALERT.
|
||||
|
||||
# 7. Acceptance
|
||||
- The function module {{P}}ROAST_SUM is active and has no syntax error.
|
||||
- The function module is active and has no syntax error.
|
||||
- The hidden tests pass.
|
||||
- Write ABAP Unit tests for the function module in a global test class.
|
||||
|
||||
Reference in New Issue
Block a user