P_InspSpecificationFieldCtrl is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_InspSpecificationVersion) and exposes 3 fields with key fields InspectionSpecificationPlant, InspectionSpecification, InspectionSpecificationVersion.
@AbapCatalog.sqlViewName: 'PINSPSPECFC'
@AbapCatalog.compiler.compareFilter: true@AbapCatalog.preserveKey: true@ClientHandling.algorithm: #SESSION_VARIABLE@AccessControl.authorizationCheck: #NOT_REQUIRED@VDM: {
viewType: #COMPOSITE,
private: true
}@ObjectModel.usageType: {
dataClass: #MASTER,
sizeCategory: #M, //expected number of rows < 100.000
serviceQuality: #A
}@Metadata.ignorePropagatedAnnotations: truedefineview P_InspSpecificationFieldCtrl
//P_MODE = R : Read-Only Modus, U: Update Modus, I: Insert
//Output = 0:Hidden, 1:Read-Only, 3:Option, 7:Mandatory
withparameters P_ApplicationMode : qbemod
asselectfrom I_InspSpecificationVersion
{
key InspectionSpecificationPlant,
key InspectionSpecification,
key InspectionSpecificationVersion,
// Active fields for quantitative characteristic
/* Fields depending on InspSpecIsQuantitative *///InspSpecTargetValue
case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecTargetValue
//InspectionSpecificationUnit
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspectionSpecificationUnit
//InspSpecDecimalPlaces
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecDecimalPlaces
// InspSpecDeterminationRule
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecDeterminationRule
// InspSpecIsDetnRuleActive
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecIsDetnRuleActive
// InspToleranceSpecification
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspToleranceSpecification
// InspSpecToleranceChgValidFrom
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecToleranceChgValidFrom
// InspSpecToleranceChgValidTo
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecToleranceChgValidTo
//InspSpecIsUpperLimitRequired
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecIsUpperLimitRequired
//InspSpecIsLowerLimitRequired
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecIsLowerLimitRequired
//InspSpecIsTargetValueInLimit
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecIsTargetValueInLimit
//InspSpecIsSampleQtyAdditive
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecIsSampleQtyAdditive
//InspSpecIsSamplingProcedRqd
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecIsSamplingProcedRqd
// InspSpecIsMeasuredValueRqd
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecIsMeasuredValueRqd
// InspSpecResultCalculation
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecResultCalculation
//InspSpecTargetValueText
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecTargetValueText
//InspSpecToleranceLimitsText
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecToleranceLimitsText
//InspSpecPlausibilityLimitsText
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecPlausibilityLimitsText
//InspSpecFirstSpecLimitsText
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecFirstSpecLimitsText
//InspSpecSecondSpecLimitsText
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecSecondSpecLimitsText
// // InspSpecDefectCodeGrpRjcnLower
// ,case I_InspSpecificationVersion.InspSpecIsQuantitative
// when 'X' then// case :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end //Optional or Read-Only
// else 0
// endas InspSpecDefectCodeGrpRjcnLower
// // InspSpecDefectCodeRjcnLower
// ,case I_InspSpecificationVersion.InspSpecIsQuantitative
// when 'X' then// case :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end //Optional or Read-Only
// else 0
// endas InspSpecDefectCodeRjcnLower
// // InspSpecDefectCodeGrpRjcnUpper
// ,case I_InspSpecificationVersion.InspSpecIsQuantitative
// when 'X' then// case :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end //Optional or Read-Only
// else 0
// endas InspSpecDefectCodeGrpRjcnUpper
// // InspSpecDefectCodeRjcnUpper
// ,case I_InspSpecificationVersion.InspSpecIsQuantitative
// when 'X' then// case :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end //Optional or Read-Only
// else 0
// endas InspSpecDefectCodeRjcnUpper
/* Fields depending on InspSpecIsLowerLimitRequired */// InspSpecLowerLimit
,case I_InspSpecificationVersion.InspSpecIsLowerLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecLowerLimit
// InspSpecLowerSpecLimitChange
,case I_InspSpecificationVersion.InspSpecIsLowerLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecLowerSpecLimitChange
//InspSpecLowerSpecLmtChangeTxt
,case I_InspSpecificationVersion.InspSpecIsLowerLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecLowerSpecLmtChangeTxt
// InspSpecDefectCodeGrpRjcnLower
,case I_InspSpecificationVersion.InspSpecIsLowerLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecDefectCodeGrpRjcnLower
// InspSpecDefectCodeRjcnLower
,case I_InspSpecificationVersion.InspSpecIsLowerLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecDefectCodeRjcnLower
/* Fields depending on InspSpecIsUpperLimitRequired *///InspSpecUpperSpecLmtChangeTxt
,case I_InspSpecificationVersion.InspSpecIsUpperLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecUpperSpecLmtChangeTxt
// InspSpecUpperLimit
,case I_InspSpecificationVersion.InspSpecIsUpperLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecUpperLimit
// InspSpecUpperSpecLimitChange
,case I_InspSpecificationVersion.InspSpecIsUpperLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecUpperSpecLimitChange
// InspSpecDefectCodeGrpRjcnUpper
,case I_InspSpecificationVersion.InspSpecIsUpperLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecDefectCodeGrpRjcnUpper
// InspSpecDefectCodeRjcnUpper
,case I_InspSpecificationVersion.InspSpecIsUpperLimitRequired
when 'X' thencase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
else 0
endas InspSpecDefectCodeRjcnUpper
// Active fields for non-quantitative characteristic
//InspSpecIsSelectedSetRequired
,case I_InspSpecificationVersion.InspSpecIsQuantitative
when 'X' then 0
elsecase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
endas InspSpecIsSelectedSetRequired
// Class Characteristic (depending if corresponding field for the internalId is initial ornot)
,case I_InspSpecificationVersion.CharcInternalID
when '0000000000' then 0
elsecase :P_ApplicationMode when 'I' then 3 when 'U' then 3 else 1 end//Optional or Read-Only
endas Characteristic
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_INSPSPECIFICATIONVERSION"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/