P_ChmlCmplncReqMktCntryProduce is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_ChmlCmplncMktCvrg, I_ChmlCmplncMktCvrg, I_ChmlCmplncReqMkt) and exposes 13 fields with key fields ChmlCmplncRequestUUID, Country, ChmlCmplncBusinessProcess, Country, ChmlCmplncBusinessProcess. It has 1 association to related views.
@AbapCatalog:
{
sqlViewName: 'PCRQMREQCTRYBPP',
compiler.compareFilter: true,
preserveKey: true
}@AccessControl:
{
authorizationCheck: #NOT_REQUIRED
}
--Client Handling of the view@ClientHandling.algorithm: #SESSION_VARIABLE
--VDM view type
@VDM.viewType: #COMPOSITE@VDM.private: true/*-----------------------------------------------------------------------------------
Retrieves a distinct list of all involved market countries for a chemical compliance
request which involves
1. Already existing as assessments at the CCI/UP or CCI/PP for business process Produce
2. Requested countries of a chemcial compliance Request
--------------------------------------------------------------------------------------*/defineview P_ChmlCmplncReqMktCntryProduce
asselectfrom I_ChmlCmplncReqMkt _ChmlCmplncReqMkt
join I_ChmlCmplncReq as _ChmlCmplncReqJoined on _ChmlCmplncReqMkt.ChmlCmplncRequestUUID = _ChmlCmplncReqJoined.ChmlCmplncRequestUUID
association [1..1] to I_ChmlCmplncReq as _ChmlCmplncReq on $projection.ChmlCmplncRequestUUID = _ChmlCmplncReq.ChmlCmplncRequestUUID
{
key _ChmlCmplncReqJoined.ChmlCmplncRequestUUID,
key _ChmlCmplncReqMkt.Country,
key 'PRODUCE' as ChmlCmplncBusinessProcess,
_Country,
_ChmlCmplncReq
}
//add the market assessment countries from the CCI/UP
unionselectfrom I_ChmlCmplncMktCvrg as _ChmlCmplncMktCvrg
join I_ChmlCmplncReq as _ChmlCmplncReqJoined on _ChmlCmplncMktCvrg.ChmlCmplncInfoUUID = _ChmlCmplncReqJoined.ChmlCmplncProdUUID
leftouter to one join I_ChmlCmplncMktReq as _ChmlCmplncMktReq on _ChmlCmplncMktReq.ChmlCmplncMktReqUUID = _ChmlCmplncMktCvrg.ChmlCmplncMktReqUUID
association [1..1] to I_ChmlCmplncReq as _ChmlCmplncReq on $projection.ChmlCmplncRequestUUID = _ChmlCmplncReq.ChmlCmplncRequestUUID
{
key _ChmlCmplncReqJoined.ChmlCmplncRequestUUID,
key _ChmlCmplncMktCvrg.Country,
key 'PRODUCE' as ChmlCmplncBusinessProcess,
_ChmlCmplncMktCvrg._Country,
_ChmlCmplncReq
}
where
_ChmlCmplncMktCvrg.ChmlCmplncProdnAllwd <> ''
or _ChmlCmplncMktReq.ChmlCmplncProdnIsReqd = 'X'
//add the specific market assessment countries from the CCI/PP
unionselectfrom I_ChmlCmplncMktCvrg as _ChmlCmplncMktCvrg
join I_ChmlCmplncReq as _ChmlCmplncReqJoined on _ChmlCmplncMktCvrg.ChmlCmplncInfoUUID = _ChmlCmplncReqJoined.ChmlCmplncInfoUUID
association [1..1] to I_ChmlCmplncReq as _ChmlCmplncReq on $projection.ChmlCmplncRequestUUID = _ChmlCmplncReq.ChmlCmplncRequestUUID
{
key _ChmlCmplncReqJoined.ChmlCmplncRequestUUID,
key _ChmlCmplncMktCvrg.Country,
key 'PRODUCE' as ChmlCmplncBusinessProcess,
_ChmlCmplncMktCvrg._Country,
_ChmlCmplncReq
}
where
_ChmlCmplncMktCvrg.ChmlCmplncProdnAllwd <> ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHMLCMPLNCMKTCVRG",
"I_CHMLCMPLNCMKTREQ",
"I_CHMLCMPLNCREQ",
"I_CHMLCMPLNCREQMKT"
],
"ASSOCIATED":
[
"I_CHMLCMPLNCREQ",
"I_COUNTRY"
],
"BASE":
[
"I_CHMLCMPLNCREQMKT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/