# 1. Goal The view entity {{P}}I_STAR_NIGHT in package $TMP lists the stargazing nights of a city observatory. Today the view reads the same master table twice. Remove that repetition. The view keeps its name, its key element and all its element names. Its result must not change. # 2. Open questions None. # 3. Context A city observatory opens its domes on clear nights. Each stargazing night takes place in one dome and uses one telescope. Tables in package $TMP: - {{P}}NIGHT - the stargazing nights. Key NIGHT_ID (CHAR 10). Further fields: DOME_ID (CHAR 4), SCOPE_ID (CHAR 4), VISITORS (INT4), NIGHT_DATE (DATS). - {{P}}DOME - the domes of the observatory. Key DOME_ID (CHAR 4). Further fields: DOME_NAME (CHAR 30), CITY (CHAR 20), CAPACITY (INT4). - {{P}}SCOPE - the telescopes. Key SCOPE_ID (CHAR 4). Further fields: SCOPE_NAME (CHAR 30), APERTURE_MM (INT4), MOUNT_KIND (CHAR 10). The view entity {{P}}I_STAR_NIGHT is active and reads the three tables. A report and an OData service consume it. Take the current source of the view as the definition of its result. Read the source before you touch it. # 4. Contract - The view entity {{P}}I_STAR_NIGHT stays in package $TMP. - Key element: NIGHT_ID. - Element names, unchanged: NIGHT_ID, DOME_ID, DOME_NAME, DOME_CITY, SCOPE_ID, SCOPE_NAME, APERTURE_MM, VISITORS, NIGHT_DATE, FREE_SEATS. - Authorization check: #NOT_REQUIRED. # 5. Business rules 1. The row set of the view does not change. A night appears exactly as often as it appears today, and no night appears that does not appear today. 2. Every element keeps its value. NIGHT_ID, DOME_ID, SCOPE_ID, VISITORS and NIGHT_DATE come from the night. DOME_NAME and DOME_CITY describe the dome of the night. SCOPE_NAME and APERTURE_MM describe the telescope of the night. FREE_SEATS is the capacity of the dome minus the visitors of the night. It may be negative. 3. The element types and the meaning of the key stay as they are. # 6. Constraints - Release target: SAP_BASIS 816 (ABAP Platform 2025). - Quality goal: no master table is read more than once by the view. A master table that is needed twice must still be read only once. - Coding standards: Clean ABAP. The view must activate without a syntax error. - Out of scope: {{P}}NIGHT, {{P}}DOME, {{P}}SCOPE. # 7. Acceptance - {{P}}I_STAR_NIGHT is active and syntax-clean. - All hidden tests pass. - Add ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.