----------------------------------------------------
-- Draft Components of Material Based Composition
-- Used for before and after production components
-- Purpose of the CDS view: combine draft components via union to enable draft support for component change status
-- Combines the result sets of:
-- - the draft components (before production)
-- - the draft components (after production)
----------------------------------------------------
--Label of view
@EndUserText.label: 'Components after/before production draft'
@AbapCatalog:
{
-- SQL view name (16 characters)
sqlViewName: 'IMCOMPDRAFT',
--If it's true, the filter conditions are compared and, if they match, the associated join expression is evaluated only once
compiler.compareFilter: true
}
--Access Control: Authorizations Checks
@AccessControl:
{
authorizationCheck: #MANDATORY
}
--Client Handling of the view
@ClientHandling.algorithm: #SESSION_VARIABLE
--VDM view type
@VDM.viewType: #COMPOSITE
@ObjectModel:
{
--Performance Annotations
usageType:
{
dataClass: #MIXED,
sizeCategory: #XL,
serviceQuality: #C
}
}
define view I_MatlBasedCmpstnCompDraft
--Select data from master table 'Components available before production
as select from I_MatlBsdBeforeProdnCompDraft as MatlBasedCmpstnBfrProdnDraft
-- needed for DCL
association [1..1] to I_ChmlCmplncInfo as _ChmlCmplncInfo on $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
association [1..1] to P_ChmlCmplConstants as _Constant on _Constant.ConstantFalse = _Constant.ConstantFalse
{
--UUID of component
key MatlBasedCmpstnBfrProdnDraft.MatlBsdCompUUID as MatlBsdCompUUID,
MatlBasedCmpstnBfrProdnDraft.ActiveMatlBsdCompUUID as ActiveMatlBsdCompUUID,
--UUID of chemical compliance information
MatlBasedCmpstnBfrProdnDraft.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
--UUID of composition
MatlBasedCmpstnBfrProdnDraft.ChmlCompositionUUID as ChmlCompositionUUID,
--UUID of material(cci) as component
MatlBasedCmpstnBfrProdnDraft.CompChmlCmplncInfoUUID as CompChmlCmplncInfoUUID,
--Date/Time of creation
MatlBasedCmpstnBfrProdnDraft.CreationUTCDateTime as CreationUTCDateTime,
--Created by
MatlBasedCmpstnBfrProdnDraft.CreatedByUser as CreatedByUser,
--Date/Time of change
MatlBasedCmpstnBfrProdnDraft.LastChangeUTCDateTime as LastChangeUTCDateTime,
--Changed by
MatlBasedCmpstnBfrProdnDraft.LastChangedByUser as LastChangedByUser,
--Indicator: Is a component before production (I) or after production (A)
MatlBasedCmpstnBfrProdnDraft.MatlBsdCompProductionType as MatlBsdCompProductionType,
--Concentration of component
MatlBasedCmpstnBfrProdnDraft.ChmlCompQty as ChmlCompQty,
--Concentration of component (as text, preserves the number of decimals)
MatlBasedCmpstnBfrProdnDraft.ChmlCompQtyAsText as ChmlCompQtyAsText,
--Unit of measurement of concentration
MatlBasedCmpstnBfrProdnDraft.ChmlCompQtyUnit as ChmlCompQtyUnit,
--Operator Lower limit of concentration
MatlBasedCmpstnBfrProdnDraft.ChmlCompOperatorLowerLimit as ChmlCompOperatorLowerLimit,
--Lower limit of concentration
MatlBasedCmpstnBfrProdnDraft.ChmlCompQtyLowerLimit as ChmlCompQtyLowerLimit,
--Lower limit of concentration (as text, preserves the number of decimals)
MatlBasedCmpstnBfrProdnDraft.ChmlCompQtyLowerLimitAsText as ChmlCompQtyLowerLimitAsText,
--Operator Upper limit of concentration
MatlBasedCmpstnBfrProdnDraft.ChmlCompOperatorUpperLimit as ChmlCompOperatorUpperLimit,
--Upper limit of concentration
MatlBasedCmpstnBfrProdnDraft.ChmlCompQtyUpperLimit as ChmlCompQtyUpperLimit,
--Upper limit of concentration (as text, preserves the number of decimals)
MatlBasedCmpstnBfrProdnDraft.ChmlCompQtyUpperLimitAsText as ChmlCompQtyUpperLimitAsText,
--Indicator: Is a component removed - Neccessary for Calculation of Component Status
MatlBasedCmpstnBfrProdnDraft.ChmlCompIsRemoved as ChmlCompIsRemoved,
--Is a component not contained
_Constant[inner].ConstantFalse as ChmlCompIsNotContained,
_ChmlCmplncInfo
}
--Select data from master table 'Components available after production
union all select from I_MatlBsdAfterProdnCompDraft as MatlBasedCmpstnAfterProdDraft
-- needed for DCL
association [1..1] to I_ChmlCmplncInfo as _ChmlCmplncInfo on $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
association [1..1] to P_ChmlCmplConstants as _Constant on _Constant.ConstantFalse = _Constant.ConstantFalse
{
--UUID of component
key MatlBasedCmpstnAfterProdDraft.MatlBsdCompUUID as MatlBsdCompUUID,
MatlBasedCmpstnAfterProdDraft.ActiveMatlBsdCompUUID as ActiveMatlBsdCompUUID,
--UUID of chemical compliance information
MatlBasedCmpstnAfterProdDraft.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
--UUID of composition
MatlBasedCmpstnAfterProdDraft.ChmlCompositionUUID as ChmlCompositionUUID,
--UUID of material(cci) as component
MatlBasedCmpstnAfterProdDraft.CompChmlCmplncInfoUUID as CompChmlCmplncInfoUUID,
--Date/Time of creation
MatlBasedCmpstnAfterProdDraft.CreationUTCDateTime as CreationUTCDateTime,
--Created by
MatlBasedCmpstnAfterProdDraft.CreatedByUser as CreatedByUser,
--Date/Time of change
MatlBasedCmpstnAfterProdDraft.LastChangeUTCDateTime as LastChangeUTCDateTime,
--Changed by
MatlBasedCmpstnAfterProdDraft.LastChangedByUser as LastChangedByUser,
--Indicator: Is a component before production (I) or after production (A)
MatlBasedCmpstnAfterProdDraft.MatlBsdCompProductionType as MatlBsdCompProductionType,
--Concentration of component
MatlBasedCmpstnAfterProdDraft.ChmlCompQty as ChmlCompQty,
--Concentration of component (as text, preserves the number of decimals)
MatlBasedCmpstnAfterProdDraft.ChmlCompQtyAsText as ChmlCompQtyAsText,
--Unit of measurement of concentration
MatlBasedCmpstnAfterProdDraft.ChmlCompQtyUnit as ChmlCompQtyUnit,
--Operator Lower limit of concentration
MatlBasedCmpstnAfterProdDraft.ChmlCompOperatorLowerLimit as ChmlCompOperatorLowerLimit,
--Lower limit of concentration
MatlBasedCmpstnAfterProdDraft.ChmlCompQtyLowerLimit as ChmlCompQtyLowerLimit,
--Lower limit of concentration (as text, preserves the number of decimals)
MatlBasedCmpstnAfterProdDraft.ChmlCompQtyLowerLimitAsText as ChmlCompQtyLowerLimitAsText,
--Operator Upper limit of concentration
MatlBasedCmpstnAfterProdDraft.ChmlCompOperatorUpperLimit as ChmlCompOperatorUpperLimit,
--Upper limit of concentration
MatlBasedCmpstnAfterProdDraft.ChmlCompQtyUpperLimit as ChmlCompQtyUpperLimit,
--Upper limit of concentration (as text, preserves the number of decimals)
MatlBasedCmpstnAfterProdDraft.ChmlCompQtyUpperLimitAsText as ChmlCompQtyUpperLimitAsText,
--Indicator: Is a component removed - Neccessary for Calculation of Component Status
_Constant[inner].ConstantFalse as ChmlCompIsRemoved,
--Is a component not contained
MatlBasedCmpstnAfterProdDraft.ChmlCompIsNotContained as ChmlCompIsNotContained,
_ChmlCmplncInfo
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MATLBSDAFTERPRODNCOMPDRAFT",
"I_MATLBSDBEFOREPRODNCOMPDRAFT",
"P_CHMLCMPLCONSTANTS"
],
"ASSOCIATED":
[
"I_CHMLCMPLNCINFO",
"P_CHMLCMPLCONSTANTS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/