I_UtilsContrToBeInvcd

DDL: I_UTILSCONTRTOBEINVCD SQL: IECONTRTBINVCD Type: view COMPOSITE

Contract to Be Invoiced

I_UtilsContrToBeInvcd is a Composite CDS View (Cube) that provides data about "Contract to Be Invoiced" in SAP S/4HANA. It reads from 8 data sources and exposes 30 fields with key fields UtilitiesContract, ScheduledUtilitiesBillingDate, UtilitiesPortion, ScheduledMeterReadingDate. It has 4 associations to related views.

Data Sources (8)

SourceAliasJoin Type
I_ActvUtilsCAInvcgLockRsn ActvUtilsCAInvcgLockRsn left_outer
I_ActvUtilsContrInvcgLockRsn ActvUtilsContrInvcgLockRsn left_outer
I_ContractAccountPartner ContractAccountPartner inner
P_SuppressedUtilsBillingOrder SuppressedUtilsBillingOrder left_outer
I_UtilitiesBillingDocument UtilitiesBillingDocument left_outer
I_UtilitiesInvoicingDocument UtilitiesInvoicingDocument left_outer
I_UtilsBillgDocInvcgHistory UtilsBillgDocInvcgHistory left_outer
I_UtilsContrToBeBlldData UtilsContrToBeBlldData from

Associations (4)

CardinalityTargetAliasCondition
[1..1] I_ContractAccountHeader _ContractAccountHeader $projection.ContractAccount = _ContractAccountHeader.ContractAccount
[1..1] I_UtilsContrToBeInvcdPrgrs _UtilsContrToBeInvcdPrgrs $projection.UtilsContrToBeInvcdPrgrs = _UtilsContrToBeInvcdPrgrs.UtilsContrToBeInvcdPrgrs
[0..1] I_UtilsContrToBeInvcdPrgrsSts _UtilsContrToBeInvcdPrgrsSts $projection.UtilsContrToBeInvcdPrgrsSts = _UtilsContrToBeInvcdPrgrsSts.UtilsContrToBeInvcdPrgrsSts
[0..1] I_CAInvcgLockReason _CAInvcgLockReason $projection.CABusinessLockReason = _CAInvcgLockReason.CAInvcgLockReason

Annotations (10)

NameValueLevelField
EndUserText.label Contract to Be Invoiced view
VDM.viewType #COMPOSITE view
Analytics.dataCategory #CUBE view
AbapCatalog.sqlViewName IECONTRTBINVCD 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 (30)

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
NmbrOfUtilsContrToBeInvoiced
_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
_ContractAccountHeader _ContractAccountHeader
_UtilsContrToBeInvcdPrgrs _UtilsContrToBeInvcdPrgrs
_UtilsContrToBeInvcdPrgrsSts _UtilsContrToBeInvcdPrgrsSts
_CAInvcgLockReason _CAInvcgLockReason
@EndUserText.label: 'Contract to Be Invoiced'
@VDM.viewType: #COMPOSITE
@Analytics.dataCategory: #CUBE
@AbapCatalog.sqlViewName: 'IECONTRTBINVCD'
@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_UtilsContrToBeInvcd
  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_UtilitiesBillingDocument    as UtilitiesBillingDocument    on  UtilitiesBillingDocument.UtilitiesContract             = UtilsContrToBeBlldData.UtilitiesContract
                                                                                 and UtilitiesBillingDocument.ScheduledUtilitiesBillingDate = UtilsContrToBeBlldData.ScheduledUtilitiesBillingDate
                                                                                 and UtilitiesBillingDocument.UtilitiesBillingReason        = '01'       //Periodic Billing

                                                                                 and UtilitiesBillingDocument.UtilsBillgSimulationReason    = ''         //Not Simulated

                                                                                 and UtilitiesBillingDocument.UtilsBillgDocReversalDate     = '00000000' //Not Reversed

    left outer join I_UtilsBillgDocInvcgHistory   as UtilsBillgDocInvcgHistory   on  UtilsBillgDocInvcgHistory.UtilitiesBillingDocument   = UtilitiesBillingDocument.UtilitiesBillingDocument
                                                                                 and UtilsBillgDocInvcgHistory.UtilsInvcgDocIsSimulated   = ''           //Not Simulated

                                                                                 and UtilsBillgDocInvcgHistory.ReversalUtilsInvcgDocument = ''           //Not Reversed

    left outer join I_UtilitiesInvoicingDocument  as UtilitiesInvoicingDocument  on  UtilitiesInvoicingDocument.UtilitiesInvoicingDocument = UtilsBillgDocInvcgHistory.UtilitiesInvoicingDocument
                                                                                 and UtilitiesInvoicingDocument.UtilsInvcgDocIsSimulated   = ''          //Not Simulated

                                                                                 and UtilitiesInvoicingDocument.UtilsInvcgDocIsReversed    = ''          //Not Reversed

    inner join      I_ContractAccountPartner      as ContractAccountPartner      on ContractAccountPartner.ContractAccount = UtilsContrToBeBlldData.ContractAccount
    left outer join I_ActvUtilsCAInvcgLockRsn     as ActvUtilsCAInvcgLockRsn     on ActvUtilsCAInvcgLockRsn.ContractAccount = UtilsContrToBeBlldData.ContractAccount
    left outer join I_ActvUtilsContrInvcgLockRsn  as ActvUtilsContrInvcgLockRsn  on ActvUtilsContrInvcgLockRsn.CABusinessLockObject = UtilsContrToBeBlldData.UtilitiesContract
  association [1..1] to I_ContractAccountHeader       as _ContractAccountHeader       on $projection.ContractAccount = _ContractAccountHeader.ContractAccount
  association [1..1] to I_UtilsContrToBeInvcdPrgrs    as _UtilsContrToBeInvcdPrgrs    on $projection.UtilsContrToBeInvcdPrgrs = _UtilsContrToBeInvcdPrgrs.UtilsContrToBeInvcdPrgrs
  association [0..1] to I_UtilsContrToBeInvcdPrgrsSts as _UtilsContrToBeInvcdPrgrsSts on $projection.UtilsContrToBeInvcdPrgrsSts = _UtilsContrToBeInvcdPrgrsSts.UtilsContrToBeInvcdPrgrsSts
  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,

      @ObjectModel.foreignKey.association: '_ContractAccountHeader'
      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,

      @ObjectModel.foreignKey.association: '_UtilsContrToBeInvcdPrgrs'
      case
        when UtilitiesInvoicingDocument.UtilitiesInvoicingDocument is not null
             and UtilitiesInvoicingDocument.UtilsInvcgDocumentIsPosted = 'X'
             and UtilitiesInvoicingDocument.UtilsInvcgDocIsNotReleased = ''
             then cast('01' as e_contrtobebinvprgrs_vdm) //Invoiced

        when (
                UtilitiesInvoicingDocument.UtilitiesInvoicingDocument is not null
                and UtilitiesInvoicingDocument.UtilsInvcgDocumentIsPosted = ''
             ) or UtilitiesInvoicingDocument.UtilitiesInvoicingDocument is null
             then cast('02' as e_contrtobebinvprgrs_vdm) //Uninvoiced

      end                                                                                               as UtilsContrToBeInvcdPrgrs,

      @ObjectModel.foreignKey.association: '_UtilsContrToBeInvcdPrgrsSts'
      case
         when UtilitiesInvoicingDocument.UtilitiesInvoicingDocument is not null
             and UtilitiesInvoicingDocument.UtilsInvcgDocumentIsPosted = 'X'
             and UtilitiesInvoicingDocument.UtilsInvcgDocIsNotReleased = ''
             and UtilitiesInvoicingDocument.UtilitiesInvoicingDocPrintDate != '00000000'
             then cast('01' as e_contrtobebinvprsts_vdm) //Printed

         when UtilitiesInvoicingDocument.UtilitiesInvoicingDocument is not null
             and UtilitiesInvoicingDocument.UtilsInvcgDocumentIsPosted = 'X'
             and UtilitiesInvoicingDocument.UtilsInvcgDocIsNotReleased = ''
             and UtilitiesInvoicingDocument.UtilitiesInvoicingDocPrintDate = '00000000'
             then cast('02' as e_contrtobebinvprsts_vdm) //Not Printed

      end                                                                                               as UtilsContrToBeInvcdPrgrsSts,

      UtilsContrToBeBlldData.AuthorizationGroup,

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


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

  and UtilsContrToBeBlldData.UtilitiesContractIsActive       = 'X'   //Active Contracts

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

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