Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
49 lines
1.9 KiB
Markdown
49 lines
1.9 KiB
Markdown
# 1. Goal
|
|
Show the ticket sales of each planetarium show in an ALV list. The operations
|
|
team uses the list to compare the shows of a period.
|
|
|
|
# 2. Open questions
|
|
None.
|
|
|
|
# 3. Context
|
|
- The table {{P}}VISIT exists in package $TMP. The table contains data.
|
|
The fields are:
|
|
- VISIT_ID (INT4, key): the number of the visit.
|
|
- SHOW_ID (CHAR 4): the show. Every show ID has exactly 4 characters.
|
|
- VISIT_DATE (DATS): the date of the visit.
|
|
- TICKETS (INT4): the number of tickets that were sold.
|
|
- TICKET_PRICE (DEC 7,2): the price of one ticket.
|
|
|
|
# 4. Contract
|
|
- Create the executable program {{P}}PLANETARIUM in package $TMP.
|
|
- The selection screen has these fields:
|
|
- The parameter P_FROM. Type DATS. Mandatory. It is the first visit date to
|
|
include.
|
|
- The select-option S_SHOW for the show ID.
|
|
- Show the result with CL_SALV_TABLE. The output table has these columns:
|
|
- SHOW_ID. Type CHAR 4. The show.
|
|
- TICKETS. Type INT4. The sum of the tickets of the show.
|
|
- REVENUE. Type DEC with length 15 and 2 decimal places. The sum of the
|
|
revenue of the show.
|
|
|
|
# 5. Business rules
|
|
1. Include a visit only if VISIT_DATE is on or after P_FROM.
|
|
2. Include a visit only if SHOW_ID is in S_SHOW.
|
|
3. Include a visit only if TICKETS is greater than zero.
|
|
4. The revenue of a visit is TICKETS multiplied by TICKET_PRICE.
|
|
5. Show one line for each show that has at least one included visit.
|
|
6. Sort the lines by REVENUE. The highest revenue comes first.
|
|
7. If two shows have the same revenue, sort these two shows by SHOW_ID in
|
|
ascending order.
|
|
|
|
# 6. Constraints
|
|
- Release target: 7.02. The program must compile on release 7.02. Do not use
|
|
syntax that is newer than release 7.02.
|
|
- Coding standards: Clean ABAP. A method has fewer than 40 statements.
|
|
- Out of scope: do not change the table {{P}}VISIT.
|
|
|
|
# 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.
|