1.4 KiB
1.4 KiB
1. Goal
Show the subscriptions of each magazine in an ALV list. The publisher uses the list to compare the magazines for a period.
2. Open questions
None.
3. Context
- Table {{P}}SUBS exists in package $TMP. It contains data. Fields: SUBS_ID (INT4, key), MAGAZINE (CHAR 12), SUB_STATUS (CHAR 1), START_DATE (DATS), MONTHLY_FEE (DEC 15,2).
- SUB_STATUS is 'A' for an active subscription and 'C' for a cancelled subscription.
4. Contract
- Create the executable program {{P}}SUBS_SUM in package $TMP.
- Selection screen:
- Parameter P_FROM, type DATS, mandatory: the first start date to include.
- Select-option S_MAG for the magazine.
- Show the result with CL_SALV_TABLE. The output table has these columns, with these names: MAGAZINE, NUM_SUBS (number of included subscriptions), REVENUE (sum of MONTHLY_FEE).
5. Business rules
- Include a subscription only if SUB_STATUS is 'A', START_DATE is on or after P_FROM, and MAGAZINE is in S_MAG.
- Show one line for each magazine that has at least two included subscriptions.
- Sort the lines by REVENUE, the highest revenue first.
6. Constraints
- Release target: 7.40 SP05. Use only syntax that this release supports.
- Coding standards: Clean ABAP. Read the data with one database access.
- Out of scope: do not change {{P}}SUBS.
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.