P_ChmlCmplncReqMktCntrySell

DDL: P_CHMLCMPLNCREQMKTCNTRYSELL Type: view COMPOSITE

P_ChmlCmplncReqMktCntrySell 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.

Data Sources (3)

SourceAliasJoin Type
I_ChmlCmplncMktCvrg _ChmlCmplncMktCvrg union
I_ChmlCmplncMktCvrg _ChmlCmplncMktCvrg union
I_ChmlCmplncReqMkt I_ChmlCmplncReqMkt from

Associations (1)

CardinalityTargetAliasCondition
[1..1] I_ChmlCmplncReq _ChmlCmplncReq $projection.ChmlCmplncRequestUUID = _ChmlCmplncReq.ChmlCmplncRequestUUID

Annotations (7)

NameValueLevelField
AbapCatalog.sqlViewName PCRQMREQCTRYBPS view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY ChmlCmplncRequestUUID _ChmlCmplncReqJoined ChmlCmplncRequestUUID
KEY Country _ChmlCmplncReqMkt Country
KEY ChmlCmplncBusinessProcess
_Country _Country
ChmlCmplncRequestUUID
KEY Country I_ChmlCmplncMktCvrg Country
KEY ChmlCmplncBusinessProcess
_Country I_ChmlCmplncMktCvrg _Country
ChmlCmplncRequestUUID
KEY Country I_ChmlCmplncMktCvrg Country
KEY ChmlCmplncBusinessProcess
_Country I_ChmlCmplncMktCvrg _Country
_ChmlCmplncReq _ChmlCmplncReq
@AbapCatalog:
{
 sqlViewName: 'PCRQMREQCTRYBPS',
 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 Sell
    2. Requested countries of a chemcial compliance Request
--------------------------------------------------------------------------------------*/

define view P_ChmlCmplncReqMktCntrySell

  as select from 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          'SELL' as ChmlCmplncBusinessProcess,

               _Country,
               _ChmlCmplncReq
}

//add the market assessment countries from the CCI/UP

union select from        I_ChmlCmplncMktCvrg as _ChmlCmplncMktCvrg

  join                   I_ChmlCmplncReq     as _ChmlCmplncReqJoined on _ChmlCmplncMktCvrg.ChmlCmplncInfoUUID = _ChmlCmplncReqJoined.ChmlCmplncProdUUID
  left outer 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         'SELL' as ChmlCmplncBusinessProcess,

              _ChmlCmplncMktCvrg._Country,
              _ChmlCmplncReq
}
where
     _ChmlCmplncMktCvrg.ChmlCmplncSalesAllwd <> ''
  or _ChmlCmplncMktReq.ChmlCmplncSalesIsReqd =  'X'

//add the specific market assessment countries from the CCI/PP

union select from 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         'SELL' as ChmlCmplncBusinessProcess,

              _ChmlCmplncMktCvrg._Country,
              _ChmlCmplncReq
}
where
  _ChmlCmplncMktCvrg.ChmlCmplncSalesAllwd <> ''
/*+[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":""
}
}*/