C_ChmlCmplncMktCmplRqRslt

DDL: C_CHMLCMPLNCMKTCMPLRQRSLT SQL: CCCMKTCRR Type: view CONSUMPTION Package: EHPMA_CNS_ASSESS_MARKETABILITY

Compliance Requirement Results

C_ChmlCmplncMktCmplRqRslt is a Consumption CDS View that provides data about "Compliance Requirement Results" in SAP S/4HANA. It reads from 2 data sources (I_ChmlCmplncCmplRqRslt, I_CmplRqVersCntry) and exposes 24 fields with key fields Country, ChmlCmplncInfoUUID, CmplRqVersUUID. It has 7 associations to related views. Part of development package EHPMA_CNS_ASSESS_MARKETABILITY.

Data Sources (2)

SourceAliasJoin Type
I_ChmlCmplncCmplRqRslt CmplRqRslt from
I_CmplRqVersCntry Cntry left_outer

Associations (7)

CardinalityTargetAliasCondition
[0..1] I_CmplRqVersEnhanced _CmplRqVers $projection.CmplRqVersUUID = _CmplRqVers.CmplRqVersUUID
[0..*] I_CmplncRqmtRsltCmplncStsTxt _ReldCmplncStsTxt $projection.CmplRqRsltReldCmplncSts = _ReldCmplncStsTxt.CmplRqRsltCmplncSts
[0..*] I_CmplRqRsltRskAssmtStsTxt _CmplRqRsltRskAssmtStsTxt $projection.CmplRqRsltReldCmplncSts = _CmplRqRsltRskAssmtStsTxt.CmplRqRsltCmplncSts --
[0..1] I_CmplncRqmtRsltStsConstants _CmplncStsConstants $projection.CmplRqRsltReldCmplncSts = _CmplncStsConstants.CmplRqRsltCmplncSts
[0..1] C_PckgdChmlCmplncInfoTP _PckgdChmlCmplncInfo $projection.ChmlCmplncInfoUUID = _PckgdChmlCmplncInfo.ChmlCmplncInfoUUID -- user description
[0..1] I_BusinessUserBasic _ReleasedByUser $projection.ReleasedByUser = _ReleasedByUser.BusinessPartner --
[1..1] I_ChmlCmplncInfo _ChmlCmplncInfo $projection.ChmlCmplncProdUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName CCCMKTCRR view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Compliance Requirement Results view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #D view
Search.searchable true view
Consumption.ranked true view

Fields (24)

KeyFieldSource TableSource FieldDescription
KEY Country
KEY ChmlCmplncInfoUUID ChmlCmplncInfoUUID
KEY CmplRqVersUUID I_ChmlCmplncCmplRqRslt CmplRqVersUUID
ChmlCmplncProdUUID ChmlCmplncProdUUID
CmplRqVersName
CmplRqVers
CmplRqVersEnglishName _CmplRqVers CmplRqVersEnglishName
ComplianceRequirement _CmplRqVers ComplianceRequirement
CmplRqPattern _CmplRqVers CmplRqPattern
CmplRqRsltUUIDendasCmplRqRsltNavgnLink
ChmlCmplncInfoCombinedName
MaterialName
ChmlCmplncInternalName _PckgdChmlCmplncInfo ChmlCmplncInternalName
Material
CmplRqRsltReldCmplncSts
CmplRqRsltCmplncSts
ReleaseDate ReleaseDate
ReleasedByUser ReleasedByUser
CmplRqRsltProcessorName _ReleasedByUser PersonFullName
_CmplRqVers _CmplRqVers
_ReldCmplncStsTxt _ReldCmplncStsTxt
_CmplRqRsltRskAssmtStsTxt _CmplRqRsltRskAssmtStsTxt
_PckgdChmlCmplncInfo _PckgdChmlCmplncInfo
_ChmlCmplncInfo _ChmlCmplncInfo
@AbapCatalog.sqlViewName: 'CCCMKTCRR'
@AbapCatalog.compiler.compareFilter: true
@EndUserText.label: 'Compliance Requirement Results'

@AccessControl:
{
  authorizationCheck: #CHECK,
  // blocking of personal data not required (no personal data fields exposed for material; user can not be blocked)

  personalData.blocking: #NOT_REQUIRED
}

@ClientHandling.algorithm: #SESSION_VARIABLE

@VDM.viewType: #CONSUMPTION

@ObjectModel:
{
  semanticKey:  [ 'CmplRqVersName' ],
  usageType:
  {
    dataClass: #MIXED,
    sizeCategory: #XL,
    serviceQuality: #D //Shouldn't be D but having it classified as C causes an ATC issue

  }
}

@UI:
{
  presentationVariant: {
    sortOrder: [{by: 'ReldCmplncStsForSorting', direction: #ASC },
                {by: 'CmplRqVersName', direction: 'ASC' }],
    requestAtLeast : [ 'CmplRqPattern', 'CmplRqRsltNavgnLink', 'CmplRqVersName' ]
   }
}

--Search
@Search.searchable : true

@Consumption.ranked:true

// other CRR views in master data apps:

// C_ChmlCmplncCmplRqRsltInPrgrs - CRRs for UPs and PPs - in progress view

// C_ChmlCmplncCmplRqRslt - CRRs for UPs and PPs - all view

// C_RawChmlCmplncCmplRqRslt - CRRs for raw materials - in progress view

// C_ChmlSuplrMatlCmplRqRslt - CRRs for supplier materials


// All View (In Progress and Released Versions) for Compliance Requirement Results for UPs and PPs showing only the released compliance status

// used in marketability assessment app in sub object page and therefore needed per country

/*+[hideWarning] { "IDS" : [ "CARDINALITY_CHECK" ]  } */
define view C_ChmlCmplncMktCmplRqRslt
  as select from    I_ChmlCmplncCmplRqRslt as CmplRqRslt
    left outer join I_CmplRqVersCntry      as Cntry on Cntry.CmplRqVersUUID = CmplRqRslt.CmplRqVersUUID

  association [0..1] to I_CmplRqVersEnhanced         as _CmplRqVers               on $projection.CmplRqVersUUID = _CmplRqVers.CmplRqVersUUID

  association [0..*] to I_CmplncRqmtRsltCmplncStsTxt as _ReldCmplncStsTxt         on $projection.CmplRqRsltReldCmplncSts = _ReldCmplncStsTxt.CmplRqRsltCmplncSts
  association [0..*] to I_CmplRqRsltRskAssmtStsTxt   as _CmplRqRsltRskAssmtStsTxt on $projection.CmplRqRsltReldCmplncSts = _CmplRqRsltRskAssmtStsTxt.CmplRqRsltCmplncSts

  -- Association to status constants
  association [0..1] to I_CmplncRqmtRsltStsConstants as _CmplncStsConstants       on $projection.CmplRqRsltReldCmplncSts = _CmplncStsConstants.CmplRqRsltCmplncSts

  association [0..1] to C_PckgdChmlCmplncInfoTP      as _PckgdChmlCmplncInfo      on $projection.ChmlCmplncInfoUUID = _PckgdChmlCmplncInfo.ChmlCmplncInfoUUID

  -- user description
  association [0..1] to I_BusinessUserBasic          as _ReleasedByUser           on $projection.ReleasedByUser = _ReleasedByUser.BusinessPartner

  -- Association used in DCL to determine responsible unit of unpackaged product
  association [1..1] to I_ChmlCmplncInfo             as _ChmlCmplncInfo           on $projection.ChmlCmplncProdUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
{

        @UI.hidden: true
        @ObjectModel.readOnly: true
  key   coalesce( Cntry.Country, 'Worldwide' )                                                                                     as Country,

        // UUID of packaged or unpackaged product

        @UI.hidden: true
        @ObjectModel.readOnly: true
  key   ChmlCmplncInfoUUID,

        // UUID of compliance requirement version

        @UI.hidden: true
        @ObjectModel.readOnly: true
  key   CmplRqRslt.CmplRqVersUUID,

        // UUID of unpackaged product

        @UI.hidden: true
        @ObjectModel.readOnly: true
        ChmlCmplncProdUUID,

        @Semantics.text: true
        @ObjectModel.readOnly: true
        @UI.hidden: true        
        cast( _CmplRqVers.CmplRqVersName as ehfnd_crr_crv_name preserving type )                                                   as CmplRqVersName,

        @Search: { defaultSearchElement: true, fuzzinessThreshold: 0.8 }
        @UI.hidden: true
        _CmplRqVers._CmplRqVersTextInCurrentLang.CmplRqVersName                                                                    as CmplRqVers,

        @Search: { defaultSearchElement: true, fuzzinessThreshold: 0.9 }
        @UI.hidden: true
        @ObjectModel.readOnly: true
        _CmplRqVers.CmplRqVersEnglishName,

        @Search: { defaultSearchElement: true, fuzzinessThreshold: 0.8 }
        @UI.hidden: true
        _CmplRqVers.ComplianceRequirement,

        @UI.hidden: true
        @ObjectModel.readOnly: true
        _CmplRqVers.CmplRqPattern,

        //Navigation link: If a released version exists, navigate into this first (BCP 1880410823)

        @UI.hidden: true
        @ObjectModel.readOnly: true
        case
          when CmplRqRslt.ReldCmplRqRsltUUID is not null
            then CmplRqRslt.ReldCmplRqRsltUUID
          else
            CmplRqRslt.CmplRqRsltUUID
        end                                                                                                                        as CmplRqRsltNavgnLink,

        @UI:
        {
          lineItem:
          [{
            position: 20,
            importance: #HIGH
          }]
        }
        @ObjectModel.readOnly: true
        // search not possible on field with coalesce

        cast( _PckgdChmlCmplncInfo._MaterialDataPrimary.ChmlCmplncInfoCombinedName as  ehpma_packaged_product_dsc preserving type) as ChmlCmplncInfoCombinedName,

        // needed for searching for packaged product

        @ObjectModel.readOnly: true
        @UI.hidden: true
        @Search: { defaultSearchElement: true, fuzzinessThreshold: 0.7 }
        _PckgdChmlCmplncInfo._MaterialDataPrimary.MaterialName,

        // needed for searching for packaged product

        @ObjectModel.readOnly: true
        @UI.hidden: true
        @Search: { defaultSearchElement: true, fuzzinessThreshold: 0.7 }
        _PckgdChmlCmplncInfo.ChmlCmplncInternalName,

        @UI:
        {
          lineItem:
          {
            position: 25,
            exclude : true,
            importance: #MEDIUM
          }
        }
        @ObjectModel.readOnly: true
        @Search: { defaultSearchElement: true, fuzzinessThreshold: 0.7 }
        _PckgdChmlCmplncInfo._MaterialDataPrimary.Material                                                                         as Material,

        @ObjectModel.readOnly: true
        @UI.hidden: true
        // released status for on condition of association

        cast(CmplRqRsltReldCmplncSts as ehpma_crr_mkt_status preserving type)                                                      as CmplRqRsltReldCmplncSts,

        @UI:
        {
          lineItem:
          [{
            position: 30,
            label: 'Marketability Status',
            importance: #HIGH,
            criticality: 'CmplRqRsltCmplncStsCriticality',
            criticalityRepresentation: #WITHOUT_ICON
          }],
          textArrangement: #TEXT_ONLY
        }
        @ObjectModel:
        {
          readOnly: true,
          text.element:  [ 'CmplRqRsltReldCmplncStsTxt' ]
        }
        cast(CmplRqRsltReldCmplncSts as ehpma_crr_mkt_status)                                                                      as CmplRqRsltCmplncSts,

        @UI.hidden: true
        @Semantics.text: true
        @ObjectModel.readOnly: true
        // Resolving dynamic compliance/marketability status texts via a "case" expression like

        // this constitutes a pragmatic, intermediate solution to a general issue regarding the

        // extensibility of the compliance/marketability status, as described in backlog item

        // PSSTEAM1-3544. For the long-term refactoring aiming to solve this issue please refer to

        // backlog item PSSTEAM1-3639.

        case
        // "Customer Compliance Check"-related risk assessments of products

          when _CmplRqVers.CmplRqPattern = 'CompliancePatternCustCmplncChk' and CmplRqRslt.ChmlCmplncInfoUUID is not null
            then _CmplRqRsltRskAssmtStsTxt[1: Language = $session.system_language ].CmplRqRsltCmplncStsTxt
        // Other compliance requirement results

          else
            _ReldCmplncStsTxt[1: Language = $session.system_language ].CmplRqRsltCmplncStsTxt
        end                                                                                                                        as CmplRqRsltReldCmplncStsTxt,

        --Sort sequence of status
        @UI.hidden: true
        @ObjectModel.readOnly: true
        _CmplncStsConstants.CmplRqRsltCmplncStsForSorting                                                                          as ReldCmplncStsForSorting,

        --Criticality of status
        @UI.hidden: true
        @ObjectModel.readOnly: true
        _CmplncStsConstants.CmplRqRsltCmplncStsCriticality                                                                         as CmplRqRsltCmplncStsCriticality,

        // Released On

        @UI:
        {
        lineItem:
        {
        position: 40,
        importance: #HIGH
        },
        textArrangement: #TEXT_ONLY
        }
        @ObjectModel.readOnly: true
        ReleaseDate,

        @UI:
        {
          lineItem:
          [{
            position: 50,
            importance: #HIGH
          }],
          textArrangement: #TEXT_ONLY
        }
        @ObjectModel.readOnly: true
        @Search: { defaultSearchElement: true, fuzzinessThreshold: 0.7 }
        @ObjectModel.text.element:  [ 'CmplRqRsltProcessorName' ]
        ReleasedByUser,

        // Full name used as (readable) text element for released by user (business user)

        @UI.hidden: true
        @Semantics.text: true
        @ObjectModel.readOnly: true
        @Search: { defaultSearchElement: true, fuzzinessThreshold: 0.7 }
        _ReleasedByUser.PersonFullName                                                                                             as CmplRqRsltProcessorName,


        -- Indicator that there is an in progress version
        @UI:
        {
          lineItem:
          {
            position: 60,
            exclude: true
          }
        }
        @ObjectModel.readOnly: true
        CmplRqRsltHasInProgressVersion,

        /* Associations */
        _CmplRqVers,
        _ReldCmplncStsTxt,
        _CmplRqRsltRskAssmtStsTxt,
        _PckgdChmlCmplncInfo,
        _ChmlCmplncInfo
}
where
      CmplRqRslt.CmplRqVersUUID              is not null
  and _CmplRqVers.CmplRqApplicationComponent <> 'DG'
  and _CmplRqVers.CmplRqApplicationComponent <> 'SDS'
  and  _CmplRqVers.CmplRqPattern             <> 'CompliancePatternRgtyDataAssmt'  -- D054696: Regulatory data assessments shall be ignored