# 1. Goal Show the effort of each project. A report and an OData service read the effort, so the calculation must be in the database, in a CDS view. # 2. Open questions None. # 3. Context - Table {{P}}PROJ (project), package $TMP. Key: PROJ_ID (CHAR 10). Fields: PROJ_NAME (CHAR 30), BUDGET (DEC 15,2). - Table {{P}}ASGN (project assignment), package $TMP. Key: PROJ_ID (CHAR 10), EMP_ID (CHAR 10). Fields: WORK_HOURS (INT4, the hours of the assignment), RATE (DEC 15,2, cost of one hour), STATUS (CHAR 1). # 4. Contract - Create the CDS view entity {{P}}I_PROJ_EFFORT in package $TMP. - Elements, with these names: PROJ_ID (key), PROJ_NAME, ASSIGN_COUNT, TOTAL_HOURS, TOTAL_COST, OVER_BUDGET. - No authorization check (#NOT_REQUIRED). # 5. Business rules 1. Show one row for each project that has at least one active assignment. An assignment is active when its STATUS is 'A'. An assignment with another status is not active. A project without active assignments does not appear in the view. 2. ASSIGN_COUNT is the number of active assignments of the project. 3. TOTAL_HOURS is the sum of WORK_HOURS of the active assignments of the project. 4. TOTAL_COST is the sum of WORK_HOURS multiplied by RATE of the active assignments of the project, with 2 decimals. 5. OVER_BUDGET is 'X' when TOTAL_COST is greater than the BUDGET of the project. Otherwise OVER_BUDGET is 'N'. # 6. Constraints - Release target: 7.58. - Coding standards: Clean ABAP. - Out of scope: do not change {{P}}PROJ and {{P}}ASGN. # 7. Acceptance - The view is active and has no syntax error. - The hidden tests pass. - Write ABAP Unit tests with CL_CDS_TEST_ENVIRONMENT in a global test class.