I_LockedUtilsContrToBeInvcd

DDL: I_LOCKEDUTILSCONTRTOBEINVCD SQL: IELCONTRTBINVCD Type: view COMPOSITE

Locked Contract to Be Invoiced

I_LockedUtilsContrToBeInvcd is a Composite CDS View (Cube) that provides data about "Locked Contract to Be Invoiced" in SAP S/4HANA. It reads from 5 data sources (I_ActvUtilsCAInvcgLockRsn, I_ActvUtilsContrInvcgLockRsn, I_ContractAccountPartner, P_SuppressedUtilsBillingOrder, I_UtilsContrToBeBlldData) and exposes 27 fields with key fields UtilitiesContract, ScheduledUtilitiesBillingDate, UtilitiesPortion, ScheduledMeterReadingDate. It has 1 association to related views.

Data Sources (5)

SourceAliasJoin Type
I_ActvUtilsCAInvcgLockRsn ActvUtilsCAInvcgLockRsn left_outer
I_ActvUtilsContrInvcgLockRsn ActvUtilsContrInvcgLockRsn left_outer
I_ContractAccountPartner ContractAccountPartner inner
P_SuppressedUtilsBillingOrder SuppressedUtilsBillingOrder left_outer
I_UtilsContrToBeBlldData UtilsContrToBeBlldData from

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_CAInvcgLockReason _CAInvcgLockReason $projection.CABusinessLockReason = _CAInvcgLockReason.CAInvcgLockReason

Annotations (10)

NameValueLevelField
EndUserText.label Locked Contract to Be Invoiced view
VDM.viewType #COMPOSITE view
Analytics.dataCategory #CUBE view
AbapCatalog.sqlViewName IELCONTRTBINVCD view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.allowExtensions true view

Fields (27)

KeyFieldSource TableSource FieldDescription
KEY UtilitiesContract I_UtilsContrToBeBlldData UtilitiesContract
KEY ScheduledUtilitiesBillingDate I_UtilsContrToBeBlldData ScheduledUtilitiesBillingDate
KEY UtilitiesPortion I_UtilsContrToBeBlldData UtilitiesPortion
KEY ScheduledMeterReadingDate I_UtilsContrToBeBlldData ScheduledMeterReadingDate
BusinessPartner I_ContractAccountPartner BusinessPartner
ContractAccount I_UtilsContrToBeBlldData ContractAccount
CompanyCode I_UtilsContrToBeBlldData CompanyCode
Division I_UtilsContrToBeBlldData Division
UtilitiesInstallation I_UtilsContrToBeBlldData UtilitiesInstallation
UtilitiesAccountDetnCode I_UtilsContrToBeBlldData UtilitiesAccountDetnCode
CAAccountDeterminationCode
UtilitiesRateCategory I_UtilsContrToBeBlldData UtilitiesRateCategory
UtilitiesBillingClass I_UtilsContrToBeBlldData UtilitiesBillingClass
AltvContractAcctForCollvBills
AuthorizationGroup I_UtilsContrToBeBlldData AuthorizationGroup
NmbrOfUtilsContrLockedForInvcg
_UtilitiesPortion I_UtilsContrToBeBlldData _UtilitiesPortion
_BusinessPartner I_ContractAccountPartner _BusinessPartner
_CompanyCode I_UtilsContrToBeBlldData _CompanyCode
_Division I_UtilsContrToBeBlldData _Division
_UtilitiesInstallation I_UtilsContrToBeBlldData _UtilitiesInstallation
_UtilsAccountDetnCode I_UtilsContrToBeBlldData _UtilsAccountDetnCode
_AcctDetnCode I_ContractAccountPartner _AcctDetnCode
_UtilitiesRateCategory I_UtilsContrToBeBlldData _UtilitiesRateCategory
_UtilsBillingClass I_UtilsContrToBeBlldData _UtilsBillingClass
_AltvContrAcc I_ContractAccountPartner _AltvContrAcc
_CAInvcgLockReason _CAInvcgLockReason
@EndUserText.label: 'Locked Contract to Be Invoiced'
@VDM.viewType: #COMPOSITE
@Analytics.dataCategory: #CUBE
@AbapCatalog.sqlViewName: 'IELCONTRTBINVCD'
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.allowExtensions:true
define view I_LockedUtilsContrToBeInvcd
  as select from    I_UtilsContrToBeBlldData      as UtilsContrToBeBlldData
    left outer join P_SuppressedUtilsBillingOrder as SuppressedUtilsBillingOrder on  SuppressedUtilsBillingOrder.UtilitiesContract              = UtilsContrToBeBlldData.UtilitiesContract
                                                                                 and SuppressedUtilsBillingOrder.UtilitiesInstallation          = UtilsContrToBeBlldData.UtilitiesInstallation
                                                                                 and SuppressedUtilsBillingOrder.SuppressedUtilsSchedldBillgDte = UtilsContrToBeBlldData.ScheduledUtilitiesBillingDate
                                                                                 and SuppressedUtilsBillingOrder.SuppressedUtilsBillgReason     = '01'
    left outer join I_ActvUtilsCAInvcgLockRsn     as ActvUtilsCAInvcgLockRsn     on ActvUtilsCAInvcgLockRsn.ContractAccount = UtilsContrToBeBlldData.ContractAccount
    left outer join I_ActvUtilsContrInvcgLockRsn  as ActvUtilsContrInvcgLockRsn  on ActvUtilsContrInvcgLockRsn.CABusinessLockObject = UtilsContrToBeBlldData.UtilitiesContract
    inner join      I_ContractAccountPartner      as ContractAccountPartner      on ContractAccountPartner.ContractAccount = UtilsContrToBeBlldData.ContractAccount
  association [0..1] to I_CAInvcgLockReason as _CAInvcgLockReason on $projection.CABusinessLockReason = _CAInvcgLockReason.CAInvcgLockReason

{
  key UtilsContrToBeBlldData.UtilitiesContract,

      @Semantics.businessDate.at: true
  key UtilsContrToBeBlldData.ScheduledUtilitiesBillingDate,

      @ObjectModel.foreignKey.association: '_UtilitiesPortion'
  key UtilsContrToBeBlldData.UtilitiesPortion,

      @Semantics.businessDate.at: true
  key UtilsContrToBeBlldData.ScheduledMeterReadingDate,

      @ObjectModel.foreignKey.association: '_BusinessPartner'
      ContractAccountPartner.BusinessPartner,

      UtilsContrToBeBlldData.ContractAccount,

      @ObjectModel.foreignKey.association: '_CompanyCode'
      UtilsContrToBeBlldData.CompanyCode,

      @ObjectModel.foreignKey.association: '_Division'
      UtilsContrToBeBlldData.Division,

      @ObjectModel.foreignKey.association: '_UtilitiesInstallation'
      UtilsContrToBeBlldData.UtilitiesInstallation,

      @ObjectModel.foreignKey.association: '_UtilsAccountDetnCode'
      UtilsContrToBeBlldData.UtilitiesAccountDetnCode,

      @ObjectModel.foreignKey.association: '_AcctDetnCode'
      cast(ContractAccountPartner.CAAccountDeterminationCode as e_kofiz_ca_vdm preserving type)         as CAAccountDeterminationCode,

      @ObjectModel.foreignKey.association: '_UtilitiesRateCategory'
      UtilsContrToBeBlldData.UtilitiesRateCategory,

      @ObjectModel.foreignKey.association: '_UtilsBillingClass'
      UtilsContrToBeBlldData.UtilitiesBillingClass,

      @ObjectModel.foreignKey.association: '_AltvContrAcc'
      cast(ContractAccountPartner.AltvContractAcctForCollvBills as e_collvbillacct_vdm preserving type) as AltvContractAcctForCollvBills,

      @ObjectModel.foreignKey.association: '_CAInvcgLockReason'
      case
        when ActvUtilsCAInvcgLockRsn.CABusinessLockObject is not null
             and (
                    ActvUtilsContrInvcgLockRsn.CABusinessLockObject is not null
                    or ActvUtilsContrInvcgLockRsn.CABusinessLockObject is null
                 )
             then cast(ActvUtilsCAInvcgLockRsn._UtilsCAInvcgLockRsn.CABusinessLockReason as e_invcglockreason_vdm preserving type)   //Contract Account Lock

        when ActvUtilsCAInvcgLockRsn.CABusinessLockObject is null
             and ActvUtilsContrInvcgLockRsn.CABusinessLockObject is not null
             then cast(ActvUtilsContrInvcgLockRsn._UtilsCAInvcgLockRsn.CABusinessLockReason as e_invcglockreason_vdm preserving type) //Contract Lock

      end                                                                                               as CABusinessLockReason,

      UtilsContrToBeBlldData.AuthorizationGroup,

      @DefaultAggregation: #SUM
      cast(1 as e_nrofutilscontr_vdm)                                                                   as NmbrOfUtilsContrLockedForInvcg,


      /* Associations */
      UtilsContrToBeBlldData._UtilitiesPortion,
      ContractAccountPartner._BusinessPartner,
      UtilsContrToBeBlldData._CompanyCode,
      UtilsContrToBeBlldData._Division,
      UtilsContrToBeBlldData._UtilitiesInstallation,
      UtilsContrToBeBlldData._UtilsAccountDetnCode,
      ContractAccountPartner._AcctDetnCode,
      UtilsContrToBeBlldData._UtilitiesRateCategory,
      UtilsContrToBeBlldData._UtilsBillingClass,
      ContractAccountPartner._AltvContrAcc,
      _CAInvcgLockReason
}
where
       SuppressedUtilsBillingOrder.UtilitiesContract          is null //Not Suppressed

  and  UtilsContrToBeBlldData.UtilitiesContractIsActive       = 'X'   //Contract is Active

  and  UtilsContrToBeBlldData.UtilsInstTimeSliceIsValid       = 'X'   //Installation Time Slice is Valid

  and  ContractAccountPartner._RelshpOfBP.CABPIsAccountHolder = 'X'   //Acocunt Holder

  and(
       ActvUtilsCAInvcgLockRsn.CABusinessLockObject           is not null //Contract Account lock is not empty OR

    or ActvUtilsContrInvcgLockRsn.CABusinessLockObject        is not null //Contract lock is not empty

  )