I_ChmlCmplncMktKeyFig is a Composite CDS View that provides data about "Key Figures for Marketability of Product" in SAP S/4HANA. It reads from 1 data source (I_ChmlCmplncInfo) and exposes 15 fields with key field ChmlCmplncInfoUUID. It has 7 associations to related views. Part of development package EHFND_BO_CCI.
@EndUserText.label: 'Key Figures for Marketability of Product'
@AbapCatalog:
{
sqlViewName: 'ICCMKTKEYFIG',
compiler.compareFilter: true,
preserveKey: true
}@AccessControl.authorizationCheck: #CHECK@ClientHandling.algorithm: #SESSION_VARIABLE@VDM.viewType: #COMPOSITE@ObjectModel:
{
usageType:
{
dataClass: #MIXED,
sizeCategory: #L,
serviceQuality: #C
},
representativeKey: 'ChmlCmplncInfoUUID'
}
defineview I_ChmlCmplncMktKeyFig
asselectfrom I_ChmlCmplncInfo as _ChmlCmplncInfo
association [0..1] to P_ChmlCmplMktReqAndCovGrpSum as _SumReqAndCov on $projection.ChmlCmplncInfoUUID = _SumReqAndCov.chemicalcomplianceuuid
association [0..1] to P_ChmlCmplncInfoRelPPCt as _RelatedPPCount on $projection.ChmlCmplncInfoUUID = _RelatedPPCount.chemicalcomplianceproduuid
association [0..1] to P_ChmlCmplMktCovCt as _CoverageCt on $projection.ChmlCmplncInfoUUID = _CoverageCt.chemicalcomplianceuuid
association [0..1] to P_ChmlCmplRqRsltInProcCt as _ComplReqIpCt on $projection.ChmlCmplncInfoUUID = _ComplReqIpCt.ChmlCmplncInfoUUID
association [0..1] to P_ChmlCmplRqRsltReldCt as _ComplReqReCt on $projection.ChmlCmplncInfoUUID = _ComplReqReCt.ChmlCmplncInfoUUID
association [0..1] to P_ChmlCmplRqRsltCt as _ComplReqCt on $projection.ChmlCmplncInfoUUID = _ComplReqCt.ChmlCmplncInfoUUID
association [0..*] to I_OTRText as _OTRText on _OTRText.Language = $session.system_language
{
key _ChmlCmplncInfo.ChmlCmplncInfoUUID,
cast(_RelatedPPCount.CountRelPP as ehpma_number_of_pp preserving type ) as NmbrOfChmlCmplncPckgdProducts,
cast( coalesce(
concat_with_space( concat_with_space( cast(_SumReqAndCov.SumUnprocessedGroupTotal asabap.char( 20 )),
_OTRText[1: OnlnTxtRpstryConceptID = '42F2E9AFC4EF1EE886E15535408E05E2'].Text ,1),
cast(_SumReqAndCov.SumRequestedGroupTotal asabap.char(20) ),1 ) ,
'0') as ehpma_number_of_open_req ) as NmbrOfChmlCmplncReqOpnWithTot,
// Number of all marketability coverages (number of countries)
cast(_CoverageCt.recordCount as ehpma_number_of_countries preserving type ) as NmbrOfChmlCmplncMktCountries,
// Number of processed (allowed/not allowed) marketability coverages
case// Isnullwhen no market reuquest exists for the CCI
when _SumReqAndCov.SumProcessedGroupTotal isnullthen 0
when _SumReqAndCov.SumProcessedGroupTotal isnotnullthen _SumReqAndCov.SumProcessedGroupTotal
endas NmbrOfChmlCmplncProcdMktCvrgs,
// Number of requested coverages
case// Isnullwhen no market reuquest exists for the CCI
when _SumReqAndCov.SumRequestedGroupTotal isnullthen 0
when _SumReqAndCov.SumRequestedGroupTotal isnotnullthen _SumReqAndCov.SumRequestedGroupTotal
endas NmbrOfChmlCmplncReqReqd,
// All open (unknown) coverages
case// Isnullwhen no market reuquest exists for the CCI
when _SumReqAndCov.SumUnprocessedGroupTotal isnullthen 0
when _SumReqAndCov.SumUnprocessedGroupTotal isnotnullthen _SumReqAndCov.SumUnprocessedGroupTotal
endas NmbrOfChmlCmplncReqOpn,
// Number of compliance requirements processed
casewhen _SumReqAndCov.SumRequestedGroupTotal isnullor _SumReqAndCov.SumUnprocessedGroupTotal isnullthen 0
when _SumReqAndCov.SumRequestedGroupTotal isnotnulland _SumReqAndCov.SumUnprocessedGroupTotal isnotnullthencast((_SumReqAndCov.SumRequestedGroupTotal - _SumReqAndCov.SumUnprocessedGroupTotal) as ehpma_number_of_cov_req preserving type )
endas NmbrOfChmlCmplncReqProcd,
cast(_ComplReqCt.recordCount as ehfnd_cci_number_of_crr preserving type ) as NmbrOfCmplRqRslts,
// Number of compliance requirement results in process
cast(_ComplReqIpCt.recordCount as ehfnd_cci_number_of_crr_ip preserving type ) as NmbrOfInProcessCmplRqRslts,
// Number of compliance requirement results released
cast(_ComplReqReCt.recordCount as ehfnd_cci_number_of_crr_re preserving type ) as NmbrOfReleasedCmplRqRslts,
// - 0.5 as ceil always rounds up
casewhen _ComplReqReCt.recordCount = 0 or _ComplReqReCt.recordCount isnullthen 0
when _ComplReqCt.recordCount = 0 or _ComplReqCt.recordCount isnullthen 0
else
ceil( cast( _ComplReqReCt.recordCount as float ) / cast( _ComplReqCt.recordCount as float ) * 100.0 - 0.5 )
endas ReleasedCmplRqRsltsPct,
casewhen _ComplReqIpCt.recordCount = 0 or _ComplReqIpCt.recordCount isnullthen 0
when _ComplReqCt.recordCount = 0 or _ComplReqCt.recordCount isnullthen 0
else
ceil( cast( _ComplReqIpCt.recordCount as float ) / cast( _ComplReqCt.recordCount as float ) * 100.0 - 0.5 )
endas InProcessCmplRqRsltsPct,
casewhen _ComplReqReCt.recordCount = 0 or _ComplReqReCt.recordCount isnullthencast ( concat_with_space( '0', '%', 1 ) as ehfnd_cci_crr_re )
when _ComplReqCt.recordCount = 0 or _ComplReqCt.recordCount isnullthencast ( concat_with_space( '0', '%', 1 ) as ehfnd_cci_crr_re )
elsecast(
concat_with_space(
cast( ceil( cast( _ComplReqReCt.recordCount as float ) / cast( _ComplReqCt.recordCount as float ) * 100.0 - 0.5 ) asabap.char( 12 ) ),
'%',
1
)
as ehfnd_cci_crr_re )
endas ReleasedCmplRqRsltsPctName,
casewhen _ComplReqIpCt.recordCount = 0 or _ComplReqIpCt.recordCount isnullthencast ( concat_with_space( '0', '%', 1 ) as ehfnd_cci_crr_ip )
when _ComplReqCt.recordCount = 0 or _ComplReqCt.recordCount isnullthencast ( concat_with_space( '0', '%', 1 ) as ehfnd_cci_crr_ip )
elsecast(
concat_with_space(
cast( ceil( cast( _ComplReqIpCt.recordCount as float ) / cast( _ComplReqCt.recordCount as float ) * 100.0 - 0.5 ) asabap.char( 12 ) ),
'%',
1
)
as ehfnd_cci_crr_ip)
endas InProcessCmplRqRsltsPctName,
//Repsonsible Unit & roles - used by the DCL
ProdStewardshipRespUnit,
MaterialIsSold,
MaterialIsTransported,
MaterialIsSourced,
MaterialIsProduced,
MaterialIsDisposed,
MaterialIsEmissionRelevant
}
where//limit key figure calculation only for UPs and PPs
MaterialIsSold = 'X'
or MaterialIsTransported = 'X'
or MaterialIsProduced = 'X'