2.0 KiB
2.0 KiB
1. Goal
The campsite "Lakeside" must store the bookings of its pitches in a database table. The reception desk, a nightly list and an OData service read this table, so the structure of the table must be fixed.
2. Open questions
None.
3. Context
- The campsite rents numbered pitches to guests.
- A booking has a booking number. A booking number occurs only once.
- The campsite runs in one client. The table is client-dependent.
4. Contract
- Create the transparent table {{P}}PITCH in package $TMP.
- Fields:
- client (abap.clnt): the client. Key field.
- booking_id (abap.char(10)): the booking number. Key field.
- pitch_no (abap.numc(4)): the number of the rented pitch.
- guest_name (abap.char(30)): the name of the guest.
- arrival_date (abap.dats): the first night of the stay.
- departure_date (abap.dats): the day of departure.
- persons (abap.int4): the number of persons.
- power_hookup (abap.char(1)): 'X' when a power hookup is booked.
- rate_per_night (abap.dec(9,2)): the price for one night.
5. Business rules
- One row of the table is one booking. The key of the table is client and booking_id. A booking number occurs only once.
- booking_id has 10 characters.
- pitch_no has 4 characters. The characters are digits.
- guest_name has 30 characters.
- arrival_date and departure_date are dates. arrival_date is the first night of the stay. departure_date is the day of departure.
- persons is a whole number.
- power_hookup has 1 character. The value is 'X' when the guest booked a power hookup. Otherwise the value is empty.
- rate_per_night has 9 digits and 2 decimals. It is the price for one night.
- The table has exactly these 9 fields.
6. Constraints
- Release target: SAP_BASIS 816 (ABAP Platform 2025).
- Use Clean ABAP.
- Out of scope: no other objects.
7. Acceptance
- The table {{P}}PITCH is active and has no syntax error.
- The hidden tests pass.
- Write ABAP Unit tests in a global test class. Use CL_OSQL_TEST_ENVIRONMENT for the database access.