2.4 KiB
2.4 KiB
1. Goal
A well-drilling company drills boreholes for farms and small businesses. The company needs one database table that stores every drilling job. A report and an OData service will read the jobs later. Therefore the table must be a transparent database table in the ABAP Dictionary.
2. Open questions
None.
3. Context
- Package: $TMP.
- No source table exists. Create the table from scratch.
- One row of the table is one drilling job.
4. Contract
- Create the transparent database table {{P}}WELL in package $TMP.
- The table has these fields, with these names: client, job_id, site_name, drilled_on, depth_m, depth_unit, price, currency_code, permit_no, crew_size.
- Key fields: client and job_id.
5. Business rules
- client is the client field. Data type abap.clnt. It is a key field and it is not null.
- job_id is the number of the drilling job. Data type abap.char(10). It is a key field and it is not null.
- site_name is the name of the drilling site. Data type abap.char(40).
- drilled_on is the date of the drilling. Data type abap.dats.
- depth_m is the drilled depth. Data type abap.dec(7,2). It is a quantity. The unit of measure of the quantity is the value of the field depth_unit of the same row.
- depth_unit is the unit of depth_m. Data type abap.unit(3).
- price is the price of the drilling job. Data type abap.dec(15,2). It is an amount. The currency of the amount is the value of the field currency_code of the same row.
- currency_code is the currency of price. Data type abap.cuky.
- permit_no is the permit number of the water authority. Data type abap.numc(8).
- crew_size is the number of workers on the drilling job. Data type abap.int4.
- Only client and job_id are key fields. All other fields are not key fields and can be empty. Two jobs on the same site are two rows with different job_id values.
6. Constraints
- Release target: SAP_BASIS 816 (ABAP Platform 2025), client 001.
- Create the table with a DDL source (define table ...). Do not use the classic Dictionary maintenance screens.
- Coding standard: Clean ABAP. The table must be active and must have no syntax error.
- Out of scope: do not create a CDS view, a report, a function module, or a business class in this task.
7. Acceptance
- The table {{P}}WELL is active.
- The hidden tests pass.
- Write ABAP Unit tests for the table in a global test class in package $TMP. Use CL_OSQL_TEST_ENVIRONMENT as the test double.