C_ChmlCmplncReqCountryVH is a Consumption CDS View that provides data about "Value Help for Countries/Regions with Filter" in SAP S/4HANA. It reads from 1 data source (I_Country) and exposes 3 fields. It has 1 association to related views.
@EndUserText.label: 'Value Help for Countries/Regions withFilter'
@AbapCatalog:
{
sqlViewName: 'CCCREQCNTRYVH',
compiler.compareFilter: true,
preserveKey: true
}
--Access Control: Authorization checks
@AccessControl:
{
authorizationCheck: #MANDATORY,
// blocking of personal data not required (no personal data fields exposed for businesspartner (BUT000); user data can not be blocked and no BP info from user exposed)
personalData.blocking: #NOT_REQUIRED
}
--Client Handling of the view@ClientHandling.algorithm: #SESSION_VARIABLE
--VDM view type
@VDM.viewType: #CONSUMPTION@ObjectModel:
{
dataCategory: #VALUE_HELP,
representativeKey: 'Country',
// semanticKey: [ 'Country' ],
usageType:
{
dataClass: #MIXED,
// set to sizeCategory XL because of SizeCategory XL of underlying views
sizeCategory: #XL,
serviceQuality: #C
}
}
@Metadata.ignorePropagatedAnnotations: true
--Header information
@UI:
{
headerInfo:
{
typeName: 'Country/Region',
typeNamePlural: 'Countries/Regions'
}
}
@UI.presentationVariant: [ {
requestAtLeast: [ 'CountryName' ],
sortOrder: [ {by: 'CountryName', direction: #ASC } ]
}]
------
--Search
@Search.searchable : true@Consumption.ranked: truedefineview C_ChmlCmplncReqCountryVH
withparameters
P_ChmlCmplncRequestUUID : sysuuid_x
--Select data from customizing table 'Country
asselectfrom I_Country as Country
--Join market request to shrink on business process
join C_ChmlCmplncReqProcMkt as _Request on _Request.ChmlCmplncRequestUUID = $parameters.P_ChmlCmplncRequestUUID
--Join data of market countries to exclude the assigned countries
leftouter to many join C_ChmlCmplncReqMktCntry as _MarketCountries on Country.Country = _MarketCountries.Country
and _MarketCountries.ChmlCmplncRequestUUID = $parameters.P_ChmlCmplncRequestUUID
and _MarketCountries.ChmlCmplncBusinessProcess = _Request.ChmlCmplncBusinessProcess
-- needed for DCL
association [1..1] to C_ChmlCmplncReqProcMkt as _ChmlCmplncReq on _ChmlCmplncReq.ChmlCmplncRequestUUID = $parameters.P_ChmlCmplncRequestUUID
{
--Country
@UI:
{
textArrangement: #TEXT_FIRST,
lineItem: [ { position: 10 } ]
}
@ObjectModel.text.element: [ 'CountryName' ]key Country.Country,
--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,
-- Chemical Compliance Request UUID
@UI.hidden: true
$parameters.P_ChmlCmplncRequestUUID as ChmlCmplncRequestUUID,
/* Associations */
_ChmlCmplncReq
}
where
--Select countries which are not assigned in market requests in the current table
_MarketCountries.ChmlCmplncRequestUUID isnull