@EndUserText.label: 'Associated Compositions of Product'
@AbapCatalog.sqlViewName: 'CASSOCPRODCMPSTN'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
--Client Handling of the view
@ClientHandling.algorithm: #SESSION_VARIABLE
--VDM view type
@VDM.viewType: #CONSUMPTION
--ObjectModel Usage Type
@ObjectModel:
{
representativeKey: 'ChmlCmplncInfoUUID',
semanticKey: [ 'ChmlCmplncInfoUUID', 'ChmlCompositionTypeName', 'ProdCmplncLegalAreaName' ],
usageType:
{
serviceQuality: #C,
dataClass: #MIXED,
sizeCategory: #L
}
}
--Header information
/*define data for the header*/
@UI:
{
headerInfo:
{
typeName: 'Composition',
typeNamePlural: 'Compositions',
title:
{
label: 'Compositions',
value: 'ChmlCompositionTypeName'
}
},
presentationVariant:
[{
sortOrder:
[
{
by: 'ChmlCompositionSort',
direction: #ASC
},
{
by: 'ChmlCompositionType',
direction: #ASC
},
{
by: '_ProdCmplncLegalAreaText.ProdCmplncLegalAreaName',
direction: #ASC
}
],
requestAtLeast: [
'ChmlCompositionInProcessUUID',
'ChmlCmpstnInProcStatus',
'ChmlCompositionReleasedUUID',
'ChmlCmpstnReldStatus',
'ChmlCompositionType',
'ChmlCompositionTypeName',
'ProdCmplncLegalArea',
'ProdCmplncLegalAreaName',
'SemanticObject',
'SemanticObjectAction',
'ChmlCmpstnNavgnLinkParamName',
'ChmlCmpstnActiveIndParamName',
'ChmlCmpstnNavgnLinkUUID',
'ChmlCmpstnIsActive',
'MaterialIsProduced',
'MaterialIsSold',
'MaterialIsSourced',
'MaterialIsTransported'
]
}]
}
define view C_AssociatedProductComposition
as select from P_AssociatedProductComposition as Composition
--Link to customizing data (Composition Type Name)
association [0..1] to I_ChmlCompositionType as _CompositionType on $projection.ChmlCompositionType = _CompositionType.ChmlCompositionType
association [0..1] to I_ChmlCompositionTypeText as _CompositionTypeText on $projection.ChmlCompositionType = _CompositionTypeText.ChmlCompositionType
and _CompositionTypeText.Language = $session.system_language
association [0..1] to I_ProdCmplncLegalAreaText as _ProdCmplncLegalAreaText on $projection.ProdCmplncLegalArea = _ProdCmplncLegalAreaText.ProdCmplncLegalArea
and _ProdCmplncLegalAreaText.Language = $session.system_language
-- needed for CCI role and DCL
association [0..1] to I_ChmlCmplncInfo as _ChmlCmplncInfo on $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] } */
association [0..1] to P_CChmlCmplConstants as _Constants on _Constants.Constant1 = _Constants.Constant1
{
@UI.hidden: true
key ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
@ObjectModel.foreignKey.association: '_CompositionType'
key ChmlCompositionType as ChmlCompositionType,
key ProdCmplncLegalArea as ProdCmplncLegalArea,
@Semantics.text: true
@UI.lineItem: [{
position: 10,
label: 'Composition'
}]
@ObjectModel.readOnly: true
@ObjectModel:{
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT',
sort.transformedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
}
cast('' as ehfnd_cci_ccmps_type_dsc ) as ChmlCompositionTypeName,
@UI: {
textArrangement: #TEXT_ONLY,
lineItem: [{
position: 20,
label: 'Legal Area'
}]
}
@ObjectModel:{
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT',
sort.transformedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
}
cast('' as ehfnd_cci_ccmps_type_dsc ) as ProdCmplncLegalAreaName,
-- Composition Status for Navigation
@UI:{
lineItem: [{
position: 40,
label: 'Processing Status',
criticality: 'ChmlCmpstnNavgnStatusCritlty',
criticalityRepresentation: #WITHOUT_ICON
}],
textArrangement: #TEXT_ONLY
}
@ObjectModel.text.element: ['ChmlCmpstnNavgnStatusName']
@ObjectModel.readOnly: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
cast('' as ehfnd_cci_ccmps_status) as ChmlCmpstnNavgnStatus,
-- Text of Composition Status for Navigation
@ObjectModel.readOnly: true
@UI.hidden: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
cast('' as val_text) as ChmlCmpstnNavgnStatusName,
-- Criticality of Composition Status for Navigation
@ObjectModel.readOnly: true
@UI.hidden: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
cast(0 as abap.int1) as ChmlCmpstnNavgnStatusCritlty,
-- Navigation Link UUID
@ObjectModel.readOnly: true
@UI.hidden: true
ChmlCmpstnNavgnLinkUUID as ChmlCmpstnNavgnLinkUUID,
-- Criticality of Composition Status for Navigation
@ObjectModel.readOnly: true
@UI.hidden: true
@Semantics.booleanIndicator: true
cast( _Constants[inner].ConstantTrue as sdraft_is_active preserving type ) as ChmlCmpstnIsActive,
--SemanticObject and Action for Navigation
@ObjectModel.readOnly: true
@UI.hidden: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
cast('' as val_text) as SemanticObject,
@ObjectModel.readOnly: true
@UI.hidden: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
cast('' as val_text) as SemanticObjectAction,
--Parameter Name for Navigation Link
@ObjectModel.readOnly: true
@UI.hidden: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
cast('' as val_text) as ChmlCmpstnNavgnLinkParamName,
--Parameter Name for Active Indicator
@ObjectModel.readOnly: true
@UI.hidden: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CMPSTN_ASSGN_CALC_EXT'
cast('' as val_text) as ChmlCmpstnActiveIndParamName,
-- In Process Composition UUID
@UI.hidden: true
@ObjectModel.readOnly: true
ChmlCompositionInProcessUUID as ChmlCompositionInProcessUUID,
-- In Process Status
@UI.hidden: true
@ObjectModel.readOnly: true
ChmlCmpstnInProcStatus as ChmlCmpstnInProcStatus,
-- Released Composition UUID
@UI.hidden: true
@ObjectModel.readOnly: true
ChmlCompositionReleasedUUID as ChmlCompositionReleasedUUID,
-- Released Status
@UI.hidden: true
@ObjectModel.readOnly: true
ChmlCmpstnReldStatus as ChmlCmpstnReldStatus,
-- Sorting Order
@UI.hidden: true
case
when Composition.ChmlCompositionType = 'MATLBSD2'
then _Constants[inner].Constant1
when Composition.ChmlCompositionType = 'ANALYTIC1'
then _Constants[inner].Constant2
when Composition.ChmlCompositionType = 'TS'
then _Constants[inner].Constant4
else
_Constants[inner].Constant3
end as ChmlCompositionSort,
-- Indicator Material is Produced
@ObjectModel.readOnly: true
@UI.hidden: true
_ChmlCmplncInfo.MaterialIsProduced as MaterialIsProduced,
-- Indicator Material is Sold
@ObjectModel.readOnly: true
@UI.hidden: true
_ChmlCmplncInfo.MaterialIsSold as MaterialIsSold,
-- Indicator Material is Sourced
@ObjectModel.readOnly: true
@UI.hidden: true
_ChmlCmplncInfo.MaterialIsSourced as MaterialIsSourced,
-- Indicator Material is Transported
@ObjectModel.readOnly: true
@UI.hidden: true
_ChmlCmplncInfo.MaterialIsTransported as MaterialIsTransported,
--- Product Categorization
@ObjectModel.text.element: ['ChmlCmplncProdCatztnPhrsText']
@UI:{
lineItem: [{ position: 30 }],
textArrangement: #TEXT_ONLY
}
cast(ChmlCmplncProdCatztnPhrsUUID as ehfnd_chm_prod_catztnphrs_uuid preserving type ) as ChmlCmplncProdCatztnPhrsUUID,
@ObjectModel.readOnly: true
@ObjectModel:{
virtualElement: true,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_PRPTY_PHRS_EXIT'
}
cast('' as ehfnd_phrs_text ) as ChmlCmplncProdCatztnPhrsText,
-- needed for DCL
_ChmlCmplncInfo,
_CompositionType,
_CompositionTypeText,
_ProdCmplncLegalAreaText
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCINFO",
"P_ASSOCIATEDPRODUCTCOMPOSITION",
"P_CCHMLCMPLCONSTANTS"
],
"ASSOCIATED":
[
"I_CHMLCMPLNCINFO",
"I_CHMLCOMPOSITIONTYPE",
"I_CHMLCOMPOSITIONTYPETEXT",
"I_PRODCMPLNCLEGALAREATEXT",
"P_CCHMLCMPLCONSTANTS"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/