C_ChmlCmplncCountryVH is a Consumption CDS View that provides data about "Countries/Regions with Filter" in SAP S/4HANA. It reads from 1 data source (I_Country) and exposes 5 fields. It has 1 association to related views.
@EndUserText.label: 'Countries/Regions withFilter'
@AbapCatalog:
{
sqlViewName: 'CCCCOUNTRYVH',
compiler.compareFilter: true
}
--Access Control: Authorization checks
@AccessControl:
{
authorizationCheck: #MANDATORY
}
--Client Handling of the view@ClientHandling.algorithm: #SESSION_VARIABLE
--VDM view type
@VDM.viewType: #CONSUMPTION@ObjectModel:
{
dataCategory: #VALUE_HELP,
semanticKey: [ 'Country' ],
usageType:
{
dataClass: #MIXED,
sizeCategory: #S,
serviceQuality: #C
}
}
@Metadata.ignorePropagatedAnnotations: true
--Header information
@UI:
{
headerInfo:
{
typeName: 'Country/Region',
typeNamePlural: 'Countries/Regions'
}
}
--Search
@Search.searchable : truedefineview C_ChmlCmplncCountryVH
withparameters
P_ChmlCmplncInfoUUID : sysuuid_x
--Select data from customizing table 'Country
asselectfrom I_Country as Country
--Join data of draft CCI to get active CCI UUID
join I_ChmlCmplncInfoDraft as ChmlCmplncInfoDraft on ChmlCmplncInfoDraft.ChmlCmplncInfoUUID = $parameters.P_ChmlCmplncInfoUUID
--Join data of draft market requests to exclude the assigned countries
leftouter to one join I_ChmlCmplncMktReqDraft as MarketRequest on Country.Country = MarketRequest.Country
and MarketRequest.ChmlCmplncInfoUUID = $parameters.P_ChmlCmplncInfoUUID
-- Association to I_ChmlCmplncInfo needed for DCL
association [1..1] to I_ChmlCmplncInfo as _ChmlCmplncInfo on _ChmlCmplncInfo.ChmlCmplncInfoUUID = $projection.ActiveChmlCmplncInfoUUID
{
-- Chemical Compliance UUID
@UI.hidden: truekey $parameters.P_ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
--Country
@UI:
{
textArrangement: #TEXT_FIRST,
lineItem.position: 10
}@ObjectModel.text.element: [ 'CountryName' ]key Country.Country,
--Active CCI UUID
@UI.hidden: true
ChmlCmplncInfoDraft.ActiveChmlCmplncInfoUUID,
--Country name
@UI.hidden: true@Semantics.text: true@Search : { defaultSearchElement : true, fuzzinessThreshold: 0.8, ranking: #HIGH }
Country._Text[ 1: Language = $session.system_language ].CountryName as CountryName,
/* Associations */
_ChmlCmplncInfo
}
where
--Select countries which are not assigned in market requests in the current draft table
MarketRequest.ChmlCmplncInfoUUID isnull/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCINFODRAFT",
"I_CHMLCMPLNCMKTREQDRAFT",
"I_COUNTRY",
"I_COUNTRYTEXT"
],
"ASSOCIATED":
[
"I_CHMLCMPLNCINFO"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/