Files
abap-llm/tasks_gen/train/G1106/spec.md
2026-10-05 18:02:52 +02:00

2.0 KiB

1. Goal

Show the bread sales of each shop for one delivery day in an ALV list. The bakery manager uses the list to compare the shops.

2. Open questions

None.

3. Context

  • Table {{P}}DELIV exists in package $TMP and contains data. Fields: DELIV_ID (INT4, key), SHOP (CHAR 4), DELIV_DATE (DATS), LOAVES (INT4), UNIT_PRICE (DEC 13,2).
  • One row of {{P}}DELIV is one delivery of bread to one shop on one day. LOAVES is the number of loaves in this delivery. UNIT_PRICE is the price of one loaf in this delivery.

4. Contract

  • Create the executable program {{P}}BAKE_SALES in package $TMP.
  • Selection screen:
    • Parameter P_DATE, type DATS, mandatory: the delivery day.
    • Select-option S_SHOP for the shop.
  • Show the result with CL_SALV_TABLE. The output table has these columns with these names:
    • SHOP: the shop.
    • LOAVES: the number of loaves.
    • REVENUE: the revenue.
    • DELIVERIES: the number of deliveries.

5. Business rules

  1. Include a delivery only if DELIV_DATE is equal to P_DATE and SHOP is in S_SHOP. An empty S_SHOP includes every shop.
  2. Show one line for each shop that has at least one included delivery.
  3. LOAVES is the sum of the LOAVES of the included deliveries of the shop.
  4. REVENUE is the sum of LOAVES multiplied by UNIT_PRICE of the included deliveries of the shop.
  5. DELIVERIES is the number of included deliveries of the shop.
  6. Sort the lines by REVENUE, the highest revenue first. If two shops have the same REVENUE, the shop with the smaller SHOP value comes first.
  7. If no delivery is included, show an empty list.

6. Constraints

  • Release target: 7.02. Use only language elements that exist in release 7.02. Do not use inline declarations, constructor expressions, or table expressions.
  • Coding standards: Clean ABAP. Read the data with one database access.
  • Out of scope: do not change {{P}}DELIV.

7. Acceptance

  • The program is active and has no syntax error.
  • The hidden tests pass.
  • Write ABAP Unit tests as local test classes in the program.