new CodeList
This commit is contained in:
4
db/data/Z_bookshop.extension-Z_SalesRegion.csv
Normal file
4
db/data/Z_bookshop.extension-Z_SalesRegion.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
Z_regionCode
|
||||
AMER
|
||||
EMEA
|
||||
APJ
|
||||
|
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user