# 1. Goal Show every open order together with the name and country of its customer. A list report and an OData service read this data, so the data must be prepared in the database, in a CDS view entity. # 2. Open questions None. # 3. Context - Table {{P}}CUST (customer master), package $TMP. Key: CUST_ID (CHAR 10). Further fields: CUST_NAME (CHAR 40), COUNTRY (CHAR 3). - Table {{P}}ORD (order header), package $TMP. Key: ORDER_ID (CHAR 10). Further fields: CUST_ID (CHAR 10), ORDER_DATE (DATS), STATUS (CHAR 1). STATUS is 'O' for an open order and 'C' for a closed order. # 4. Contract - Create the CDS view entity {{P}}I_ORDER in package $TMP. - Elements, with these names: ORDER_ID (key), CUST_ID, ORDER_DATE, CUSTOMER_NAME, COUNTRY. - Define an association named _Customer in {{P}}I_ORDER. The association has cardinality [0..1] and points to the customer master table {{P}}CUST. The association condition compares the CUST_ID of the order with the CUST_ID of the customer. - Expose the association _Customer in the element list of {{P}}I_ORDER and read CUSTOMER_NAME and COUNTRY with path expressions through this association. - The view entity has no authorization check (#NOT_REQUIRED). # 5. Business rules 1. {{P}}I_ORDER shows one row for each order with STATUS 'O'. An order with STATUS 'C' is not shown. 2. CUSTOMER_NAME is the CUST_NAME and COUNTRY is the COUNTRY of the customer whose CUST_ID is the CUST_ID of the order. 3. If an order has a CUST_ID for which no customer exists, the order is still shown. CUSTOMER_NAME and COUNTRY are then empty. 4. ORDER_ID, CUST_ID and ORDER_DATE are the values of the order. # 6. Constraints - Release target: 7.58. - Coding standards: Clean ABAP. - Out of scope: do not change {{P}}CUST and {{P}}ORD. # 7. Acceptance - The view entity 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.