new CodeList

This commit is contained in:
Wolfgang Koch
2021-05-11 15:27:52 +02:00
parent 0089f65385
commit 792887011c
6 changed files with 61 additions and 13 deletions

View File

@@ -0,0 +1,4 @@
Z_regionCode
AMER
EMEA
APJ
1 Z_regionCode
2 AMER
3 EMEA
4 APJ

View File

@@ -1,19 +1,21 @@
using {sap.capire.bookshop} from '_base/db/schema';
using {sap.capire.orders} from '_base/db/schema';
using {sap.capire.orders} from '_base/db/schema';
using from '_base/db/capire_common';
using {
cuid, managed, Country
cuid, managed, Country, sap.common.CodeList
} from '@sap/cds/common';
namespace Z_bookshop.extension;
// extend existing entity
extend orders.Orders with {
Z_Customer : Association to one Z_Customers;
Z_Remarks : Composition of many Z_Remarks on Z_Remarks.Z_parent = $self;
Z_priority : String @assert.range enum {high; medium; low} default 'medium';
Z_Customer : Association to one Z_Customers;
Z_SalesRegion : Association to one Z_SalesRegion;
Z_priority : String @assert.range enum {high; medium; low} default 'medium';
Z_Remarks : Composition of many Z_Remarks on Z_Remarks.Z_parent = $self;
}
// new entity - as association target
@@ -47,6 +49,12 @@ entity Z_CustomerPostalAddresses // :
Z_country : Country;
};
// new entity - as code list
entity Z_SalesRegion: CodeList {
key Z_regionCode : String(11);
}
// new entity - as composition target
entity Z_Remarks // : cuid, managed
{