Files
2026-10-05 22:08:59 +02:00

70 lines
2.9 KiB
Markdown

# 1. Goal
The bowling alley "Strike Lane" needs a database table for its lane bookings.
The booking desk will read the bookings with ABAP SQL and later with a CDS view.
In their daily work the staff use the words hours, mode, order, date, count,
group and value. These words are reserved words in ABAP SQL. The new table must
therefore use safe field names.
# 2. Open questions
None.
# 3. Context
The bowling alley has 12 lanes. A guest books one lane for a time slot. The
booking desk writes one row for each booking into the new table. The table is
the first object of the bowling alley in package $TMP. No other object exists.
# 4. Contract
Create the transparent database table {{P}}BOWL in package $TMP. The table has
the following fields, in this order, with these names:
- client: CLNT 3, key
- booking_id: CHAR 10, key
- lane_no: NUMC 2, key
- play_hours: DEC 4,2
- game_mode: CHAR 1
- order_no: CHAR 10
- play_date: DATS
- player_count: INT4
- league_code: CHAR 4
- price_value: DEC 11,2
# 5. Business rules
1. The key of the table is the combination of client, booking_id and lane_no.
No other field is a key field.
2. play_hours is the booked time in hours. It has 4 characters and 2 decimals.
3. game_mode is a single character. 'N' means a normal game, 'L' means a league
game.
4. order_no is the number of the order that the guest paid at the counter. It
has 10 characters.
5. play_date is the day of the booking.
6. player_count is the number of players on the lane. It is a whole number.
7. league_code is the code of the league. It has 4 characters. For a normal
game the field is empty.
8. price_value is the value of the booking in the local currency. It has 11
characters and 2 decimals.
9. No field name is a reserved word of ABAP SQL. The table must not have a
field with the name hours, mode, order, date, count, group or value.
10. The booking number is unique for one client and one lane. A second INSERT
with the same client, the same booking number and the same lane number does
not change the table and gives sy-subrc = 4.
# 6. Constraints
- Release target: ABAP Platform 2025 (SAP_BASIS 816). Package $TMP. No
transport.
- Use only the built-in Dictionary types abap.clnt, abap.char, abap.numc,
abap.dats, abap.int4 and abap.dec. Do not use abap.curr or abap.quan.
- Write the table as a DDL source with the annotations @EndUserText.label,
@AbapCatalog.enhancement.category : #NOT_EXTENSIBLE,
@AbapCatalog.tableCategory : #TRANSPARENT, @AbapCatalog.deliveryClass : #A
and @AbapCatalog.dataMaintenance : #RESTRICTED. Declare the key fields as
not null.
- Do not create any other repository object than the table and your own test
class.
- Out of scope: a CDS view, a report, a function module and a class with
business logic.
# 7. Acceptance
- The table {{P}}BOWL is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests with CL_OSQL_TEST_ENVIRONMENT in a global test class.