From f3209da2e1ef0f6bc004a0b51e22365087bc70ef Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Wed, 14 May 2025 14:09:51 +0200 Subject: [PATCH 1/3] Adding samples for Units of Measures --- common/data/sap.common-Weights.csv | 6 ++++++ common/data/sap.common-Weights_texts.csv | 11 +++++++++++ common/uom.cds | 15 +++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 common/data/sap.common-Weights.csv create mode 100644 common/data/sap.common-Weights_texts.csv create mode 100644 common/uom.cds diff --git a/common/data/sap.common-Weights.csv b/common/data/sap.common-Weights.csv new file mode 100644 index 000000000..905915b4c --- /dev/null +++ b/common/data/sap.common-Weights.csv @@ -0,0 +1,6 @@ +code;name +g;Grams +kg;Kilograms +mg;Milligrams +lb;Pounds +oz;Ounces diff --git a/common/data/sap.common-Weights_texts.csv b/common/data/sap.common-Weights_texts.csv new file mode 100644 index 000000000..01f2be135 --- /dev/null +++ b/common/data/sap.common-Weights_texts.csv @@ -0,0 +1,11 @@ +code;locale;name +g;de;Gramm +kg;de;Kilogramm +mg;de;Milligramm +lb;de;Pfund +oz;de;Unze +g;fr;Grammes +kg;fr;Kilogrammes +mg;fr;Milligrammes +lb;fr;Livres +oz;fr;Onces diff --git a/common/uom.cds b/common/uom.cds new file mode 100644 index 000000000..440ff8427 --- /dev/null +++ b/common/uom.cds @@ -0,0 +1,15 @@ +using { sap.common.CodeList } from '@sap/cds/common'; +namespace sap.common.uom; + +entity PackagingUnits : CodeList { + key code : String(3); // e.g. pc for Piece(s) + abbrev : localized String(3); // e.g. st for Stück +} + +entity Weights : CodeList { + key code : String(3); // e.g. kg for Kilogram(s) +} + +entity Lengths : CodeList { + key code : String(3); // e.g. m for Meter(s) +} From 169fda660b468677be77358fa5bd1ef80da270e3 Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Wed, 14 May 2025 14:12:19 +0200 Subject: [PATCH 2/3] feat: add UOM module import to common index --- common/index.cds | 1 + 1 file changed, 1 insertion(+) diff --git a/common/index.cds b/common/index.cds index 74f9033c0..4364c56ec 100644 --- a/common/index.cds +++ b/common/index.cds @@ -1,2 +1,3 @@ using from './currencies'; using from './regions'; +using from './uom'; From ccb61c9b6987b6ec48d4c020cb8d03b67f0fe07c Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Wed, 14 May 2025 14:13:24 +0200 Subject: [PATCH 3/3] feat: add associations for PackagingUnit, Length, and Weight types --- common/uom.cds | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/uom.cds b/common/uom.cds index 440ff8427..40802a698 100644 --- a/common/uom.cds +++ b/common/uom.cds @@ -13,3 +13,7 @@ entity Weights : CodeList { entity Lengths : CodeList { key code : String(3); // e.g. m for Meter(s) } + +type PackagingUnit : Association to PackagingUnits; +type Length : Association to Lengths; +type Weight : Association to Weights;