@AbapCatalog.sqlViewName: 'CCRRCCICCCTP'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'CRR CCI Customer Compliance Check'
// TODO: Clarify, whether annotation "@AccessControl.personalData.blocking" is required, similar
// to CDS view "C_CmplRqRsltChmCmInSubChkTP"
// this view is not exposing person related fields like the customer
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@Metadata.allowExtensions: true
@VDM.viewType: #CONSUMPTION
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel:
{
compositionRoot: true,
draftEnabled: true,
transactionalProcessingDelegated: true,
createEnabled: false,
updateEnabled: 'EXTERNAL_CALCULATION',
// TODO: Clarify, whether "deleteEnabled" shall be "false" or "EXTERNAL_CALCULATION"
deleteEnabled: 'EXTERNAL_CALCULATION',
// although this CDS view doesn't serve a List Report, we provide a semantic key to support other
// (unknown) consumers of that field
//
// TODO: Clarify how to define the semantic key in order to be able to directly navigate to the
// edit mode of a potentially existing draft instance from a list report.
// (see backlog items PSSTEAM1-2741 and LROPBANGALORE5-1094)
semanticKey: [ 'CmplRqVersName', 'ChmlCmplncInfoCombinedName' ],
usageType:
{
dataClass: #MIXED,
sizeCategory: #XL,
serviceQuality: #C
}
}
define view C_CmplRqRsltChmCmInCstCmChkTP
as select from I_CmplRqRsltCustCmplncChkTP as ComplianceRequirementResult
// CRR Customer Compliance Check Details
/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ] }*/
association [0..1] to C_CmplRqRsltCstCmChkDetsTP as _CmplRqRsltCstCmChkDets on $projection.CmplRqRsltUUID = _CmplRqRsltCstCmChkDets.CmplRqRsltUUID
association [0..1] to I_CmplRqRslt as _ReleasedCmplRqRslt on $projection.ChmlCmplncInfoUUID = _ReleasedCmplRqRslt.ChmlCmplncInfoUUID
and $projection.CmplRqVersUUID = _ReleasedCmplRqRslt.CmplRqVersUUID
and _ReleasedCmplRqRslt.CmplRqRsltProcessingStatus = 'RE'
association [0..1] to I_CmplRqRsltRskAssmtSts as _PreliminaryStsVH on $projection.CmplRqRsltPrelimCmplncSts = _PreliminaryStsVH.CmplRqRsltCmplncSts
association [0..1] to I_CmplRqRsltRskAssmtSts as _ReleasedCmplncStsVH on $projection.CmplRqRsltReldCmplncSts = _ReleasedCmplncStsVH.CmplRqRsltCmplncSts
association [1..1] to I_CmplRqVersEnhanced as _CmplRqVers on $projection.CmplRqVersUUID = _CmplRqVers.CmplRqVersUUID
{
@ObjectModel.readOnly: true
key ComplianceRequirementResult.CmplRqRsltUUID,
@ObjectModel.readOnly: true
ComplianceRequirementResult.ActiveCmplRqRsltUUID,
@ObjectModel.readOnly: true
ComplianceRequirementResult.ChmlCmplncInfoUUID,
@ObjectModel.readOnly: true
ComplianceRequirementResult.CmplRqVersUUID,
@ObjectModel.readOnly: true
ComplianceRequirementResult.ComplianceRequirement,
@ObjectModel.readOnly: true
ComplianceRequirementResult.ChemicalCustomerMaterialUUID,
@ObjectModel.readOnly: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT3'
// TODO: Fix issue with typing of field (deviation of data type length from GFN default data element)
// Lengths of data elements "ehpma_application" and "ehfnd_cci_application" differ.
// Which one is the correct one to use?
cast( '' as ehpma_application ) as ChmlCmplncApplication,
@Semantics.text: true
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRV_NAME_EXIT'
}
cast( '' as ehfnd_crr_crv_name ) as CmplRqVersName,
//====================================================================================================
// Processor
//====================================================================================================
// This value help defintion is necessary in order for the OData service to contain the
// entity set required by the "Change Processor" extension action
@Consumption.valueHelpDefinition: [
{
entity: {
name: 'C_CmplRqRsltProcsrByCmplRqVH',
element: 'Processor'
}
}
]
@ObjectModel.readOnly: true
@ObjectModel.text.element: ['CmplRqRsltProcessorName']
// TODO: Fix issue with typing of field (deviation of data type length from GFN default data element)
ComplianceRequirementResult.Processor,
// Full name used as (readable) text element for (technical) processor
@Semantics.text: true
@ObjectModel.readOnly: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRR_PROCESSOR_EXIT'
cast( '' as ad_namtext ) as CmplRqRsltProcessorName,
//====================================================================================================
// Released By
//====================================================================================================
@ObjectModel.readOnly: true
@ObjectModel.text.element: ['ReleasedByUserName']
ComplianceRequirementResult.ReleasedByUser,
@Semantics.text: true
@ObjectModel.readOnly: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRR_RELEASEDBY_EXIT'
cast( '' as ad_namtext ) as ReleasedByUserName,
//====================================================================================================
// Preliminary Compliance Status
//====================================================================================================
@ObjectModel.readOnly: true
@ObjectModel.text.element: [ 'CmplRqRsltPrelimCmplncStsName' ]
cast(ComplianceRequirementResult.CmplRqRsltPrelimCmplncSts
as ehpma_crr_mkt_status preserving type) as CmplRqRsltPrelimCmplncSts,
@ObjectModel.readOnly: true
@Semantics.text: true
cast(_PreliminaryStsVH._Text[1: Language = $session.system_language ].CmplRqRsltCmplncStsTxt
as ehpma_crr_mkt_stat_text preserving type) as CmplRqRsltPrelimCmplncStsName,
@ObjectModel.readOnly: true
_PreliminaryStsVH.CmplRqRsltCmplncStsCriticality as CmplRqRsltPrelimCmplncStsCritl,
//====================================================================================================
// Released Compliance Status
//====================================================================================================
@ObjectModel.readOnly: true
@ObjectModel.text.element: [ 'CmplRqRsltReldCmplncStsName' ]
cast(ComplianceRequirementResult.CmplRqRsltReldCmplncSts
as ehpma_crr_mkt_status preserving type ) as CmplRqRsltReldCmplncSts,
@UI.hidden: true
@Semantics.text: true
@ObjectModel.readOnly: true
cast(_ReleasedCmplncStsVH._Text[1: Language = $session.system_language ].CmplRqRsltCmplncStsTxt
as ehpma_crr_mkt_stat_text preserving type) as CmplRqRsltReldCmplncStsName,
@ObjectModel.readOnly: true
_ReleasedCmplncStsVH.CmplRqRsltCmplncStsCriticality as CmplRqRsltReldCmplncStsCritlty,
//====================================================================================================
// Unpackaged Product Name
//====================================================================================================
@Semantics.text: true
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CCI_PRIMMATL_EXIT'
}
cast( '' as ehfnd_cci_up ) as ChmlCmplncInfoCombinedName,
// Required for the CL_EHFND_CCI_PRIMMATL_EXIT as one of the fallbacks
@ObjectModel.readOnly: true
ComplianceRequirementResult._ChmlCmplncInfo.ChmlCmplncInternalName as ChmlCmplncInternalName,
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CCI_PRIMMATL_EXIT'
}
cast ( '' as ehfnd_cci_raw_material_name ) as ChmlCmplncInfoCombinedMaterial,
@ObjectModel.readOnly: true
CmplRqRsltProcessingStatus,
CmplRqRsltStatusRemark,
@ObjectModel.readOnly: true
ComplianceRequirementResult._ChmlCmplncInfo.ChmlCmplncInfoType,
@ObjectModel.readOnly: true
ComplianceRequirementResult._ChmlCmplncInfo.ChmlCmplncProdIsResearched,
//====================================================================================================
// Logistics Roles
//====================================================================================================
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRR_LOGS_ROLES_EXIT'
}
cast( '' as ehfnd_cci_is_sold ) as MaterialIsSold,
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRR_LOGS_ROLES_EXIT'
}
cast( '' as ehfnd_cci_is_transported ) as MaterialIsTransported,
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRR_LOGS_ROLES_EXIT'
}
cast( '' as ehfnd_cci_is_sourced ) as MaterialIsSourced,
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_EHFND_CRR_LOGS_ROLES_EXIT'
}
cast( '' as ehfnd_cci_is_produced ) as MaterialIsProduced,
// Required for using any of the "Chemical Compliance Information"-related navigation links
// offered by the "Logistics Roles" in the object page header, for example:
// - UnpackagedChemicalInfo-manageMarketability ("Assess Products for Markets")
// - UnpackagedChemicalInfo-manageBasicData ("Unpackaged Product - Basic Compliance Data")
// - UnpackagedChemicalInfo-displayWorkview ("Unpackaged Product - Work View")
@ObjectModel.readOnly: true
ComplianceRequirementResult.ChmlCmplncInfoUUID as ChmlCmplncInfoNavgnLink,
// Required for "View Released Version" link in processing status message strip
@ObjectModel.readOnly: true
_ReleasedCmplRqRslt.CmplRqRsltUUID as ChmlCmplncNavgnLinkToReldVers,
// Required for "Valid from"/"Valid to" dates in processing status message strip of
// "historical" compliance requirement results
@ObjectModel.readOnly: true
ComplianceRequirementResult.ValidityStartDateTime as ValidityStartDateTime,
@ObjectModel.readOnly: true
ComplianceRequirementResult.ValidityEndDateTime as ValidityEndDateTime,
//====================================================================================================
// Associations
//====================================================================================================
@ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
_CmplRqRsltCstCmChkDets,
// Required for authorization check
ComplianceRequirementResult._ChmlCmplncInfo,
// Required for binding of "Compliance Requirement Details" dialog ("View Details" button)
_CmplRqVers,
// Required for resolving the corresponding text and criticality of the
// ("Risk Assessment"-specific) preliminary marketability status
_PreliminaryStsVH,
// Required for resolving the corresponding text and criticality of the
// ("Risk Assessment"-specific) marketability status of a released compliance requirement
// result
_ReleasedCmplncStsVH
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCINFO",
"I_CMPLRQRSLT",
"I_CMPLRQRSLTCUSTCMPLNCCHKTP",
"I_CMPLRQRSLTRSKASSMTSTS",
"I_CMPLRQRSLTRSKASSMTSTSTXT"
],
"ASSOCIATED":
[
"C_CMPLRQRSLTCSTCMCHKDETSTP",
"I_CHMLCMPLNCINFO",
"I_CMPLRQRSLT",
"I_CMPLRQRSLTRSKASSMTSTS",
"I_CMPLRQVERSENHANCED"
],
"BASE":
[
"I_CMPLRQRSLTCUSTCMPLNCCHKTP"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/