I_UtilsInvcgDocBillingData

DDL: I_UTILSINVCGDOCBILLINGDATA SQL: IEINVDOCBILLDATA Type: view COMPOSITE

Billing Data for Invoicing Document

I_UtilsInvcgDocBillingData is a Composite CDS View that provides data about "Billing Data for Invoicing Document" in SAP S/4HANA. It reads from 9 data sources and exposes 55 fields. It has 3 associations to related views.

Data Sources (9)

SourceAliasJoin Type
I_ActvUtilsCAInvcgLockRsn ActvUtilsCAInvcgLockRsn left_outer
I_ActvUtilsContrInvcgLockRsn ActvUtilsContrInvcgLockRsn left_outer
I_ContractAccountPartner ContractAccountPartner inner
I_UtilitiesBillingDocument UtilitiesBillingDocument inner
I_UtilitiesContract UtilitiesContract inner
I_UtilitiesInstallationHist UtilitiesInstallationHist inner
I_UtilitiesInvoicingDocument UtilitiesInvoicingDocument from
I_UtilsBillgDocInvcgHistory UtilsBillgDocInvcgHistory inner
I_UtilsInvcgDocOutsrtgDataCntr UtilsInvcgDocOutsrtgDataCntr left_outer

Associations (3)

CardinalityTargetAliasCondition
[0..1] I_UtilitiesPortionScheduleRecd _UtilitiesPortionScheduleRecd $projection.UtilitiesPortion = _UtilitiesPortionScheduleRecd.UtilitiesPortion and $projection.UtilsPortionScheduleRecordDate = _UtilitiesPortionScheduleRecd.UtilsPortionScheduleRecordDate
[0..1] I_UtilsBillgDocIntAndExtPoD _UtilsBillgDocIntAndExtPoD $projection.UtilitiesBillingDocument = _UtilsBillgDocIntAndExtPoD.UtilitiesBillingDocument
[0..1] I_CAInvcgLockReason _CAInvcgLockReason $projection.CABusinessLockReason = _CAInvcgLockReason.CAInvcgLockReason

Annotations (8)

NameValueLevelField
EndUserText.label Billing Data for Invoicing Document view
VDM.viewType #COMPOSITE view
AbapCatalog.sqlViewName IEINVDOCBILLDATA 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

Fields (55)

KeyFieldSource TableSource FieldDescription
UtilitiesInvoicingDocument I_UtilitiesInvoicingDocument UtilitiesInvoicingDocument
UtilitiesBillingDocument I_UtilsBillgDocInvcgHistory UtilitiesBillingDocument
BusinessPartner I_UtilitiesInvoicingDocument BusinessPartner
ContractAccount I_UtilitiesInvoicingDocument ContractAccount
UtilitiesContract I_UtilitiesBillingDocument UtilitiesContract
CompanyCode I_UtilitiesContract CompanyCode
Division I_UtilitiesContract UtilitiesDivision
UtilitiesInstallation I_UtilitiesContract UtilitiesInstallation
UtilitiesMoveInDate I_UtilitiesContract UtilitiesMoveInDate
UtilitiesMoveOutDate I_UtilitiesContract UtilitiesMoveOutDate
UtilitiesAccountDetnCode I_UtilitiesContract UtilitiesAccountDetnCode
UtilsContrJointInvcType I_UtilitiesContract UtilsContrJointInvcType
UtilsBillgOutsortingReason I_UtilitiesContract UtilsBillgOutsortingReason
UtilitiesBillingReason I_UtilitiesBillingDocument UtilitiesBillingReason
UtilsBillgPeriodStartDate I_UtilitiesBillingDocument UtilsBillgPeriodStartDate
UtilsBillgPeriodEndDate I_UtilitiesBillingDocument UtilsBillgPeriodEndDate
UtilitiesPortion I_UtilitiesBillingDocument UtilitiesPortion
ScheduledUtilitiesBillingDate I_UtilitiesBillingDocument ScheduledUtilitiesBillingDate
UtilsPortionScheduleRecordDate I_UtilitiesBillingDocument UtilsPortionScheduleRecordDate
MeterReadingUnit I_UtilitiesBillingDocument MeterReadingUnit
ScheduledMeterReadingDate I_UtilitiesBillingDocument ScheduledMeterReadingDate
UtilsBillgDocCreationDate I_UtilitiesBillingDocument UtilsBillgDocCreationDate
UtilitiesAccountClass I_UtilitiesBillingDocument UtilitiesAccountClass
UtilsContrSpcfcBdgtBillgCycle I_UtilitiesContract UtilsContrSpcfcBdgtBillgCycle
UtilsDefaultBdgtBillgCycle
UtilitiesRateCategory I_UtilitiesInstallationHist UtilitiesRateCategory
UtilitiesBillingClass I_UtilitiesInstallationHist UtilitiesBillingClass
AltvContractAcctForCollvBills
UtilsInvcgDocIsNotReleased I_UtilitiesInvoicingDocument UtilsInvcgDocIsNotReleased
UtilsInvcgDocIsSimulated I_UtilitiesInvoicingDocument UtilsInvcgDocIsSimulated
UtilsInvcgDocIsReversed I_UtilitiesInvoicingDocument UtilsInvcgDocIsReversed
AuthorizationGroup I_UtilitiesInvoicingDocument AuthorizationGroup
NmbrOfUtilsInvoicingDocuments
NumberOfUtilitiesContracts
_UtilitiesBillingDocument I_UtilsBillgDocInvcgHistory _UtilitiesBillingDocument
_BusinessPartner I_UtilitiesInvoicingDocument _BusinessPartner
_UtilitiesContract I_UtilitiesBillingDocument _UtilitiesContract
_CompanyCode I_UtilitiesContract _CompanyCode
_Division I_UtilitiesContract _Division
_UtilitiesInstallation I_UtilitiesContract _UtilitiesInstallation
_UtilsAccountDetnCode I_UtilitiesContract _UtilsAccountDetnCode
_InvcUtilsContractsJointly I_UtilitiesContract _InvcUtilsContractsJointly
_UtilsBillgOutsortingGroup I_UtilitiesContract _UtilsBillgOutsortingGroup
_UtilitiesBillingReason I_UtilitiesBillingDocument _UtilitiesBillingReason
_UtilitiesPortion I_UtilitiesBillingDocument _UtilitiesPortion
_MeterReadingUnit I_UtilitiesBillingDocument _MeterReadingUnit
_UtilsAccountClass I_UtilitiesBillingDocument _UtilsAccountClass
_UtilsContrSpcfcBdgtBillgCyc I_UtilitiesContract _UtilsContrSpcfcBdgtBillgCyc
_UtilitiesBdgtBillgCyc
_UtilitiesRateCategory I_UtilitiesInstallationHist _UtilitiesRateCategory
_UtilsBillingClass I_UtilitiesInstallationHist _UtilsBillingClass
_AltvContrAcc I_ContractAccountPartner _AltvContrAcc
_UtilitiesPortionScheduleRecd _UtilitiesPortionScheduleRecd
_UtilsBillgDocIntAndExtPoD _UtilsBillgDocIntAndExtPoD
_CAInvcgLockReason _CAInvcgLockReason
@EndUserText.label: 'Billing Data for Invoicing Document'
@VDM.viewType: #COMPOSITE
@AbapCatalog.sqlViewName: 'IEINVDOCBILLDATA'
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XXL
@ClientHandling.algorithm: #SESSION_VARIABLE
define view I_UtilsInvcgDocBillingData
  as select from    I_UtilitiesInvoicingDocument   as UtilitiesInvoicingDocument
    inner join      I_UtilsBillgDocInvcgHistory    as UtilsBillgDocInvcgHistory    on UtilsBillgDocInvcgHistory.UtilitiesInvoicingDocument = UtilitiesInvoicingDocument.UtilitiesInvoicingDocument
    inner join      I_UtilitiesBillingDocument     as UtilitiesBillingDocument     on UtilitiesBillingDocument.UtilitiesBillingDocument = UtilsBillgDocInvcgHistory.UtilitiesBillingDocument
    inner join      I_UtilitiesContract            as UtilitiesContract            on UtilitiesContract.UtilitiesContract = UtilitiesBillingDocument.UtilitiesContract
    inner join      I_UtilitiesInstallationHist    as UtilitiesInstallationHist    on UtilitiesInstallationHist.UtilitiesInstallation = UtilitiesContract.UtilitiesInstallation
    inner join      I_ContractAccountPartner       as ContractAccountPartner       on  ContractAccountPartner.ContractAccount = UtilitiesInvoicingDocument.ContractAccount
                                                                                   and ContractAccountPartner.BusinessPartner = UtilitiesInvoicingDocument.BusinessPartner
    left outer join I_ActvUtilsCAInvcgLockRsn      as ActvUtilsCAInvcgLockRsn      on ActvUtilsCAInvcgLockRsn.ContractAccount = UtilitiesInvoicingDocument.ContractAccount
    left outer join I_ActvUtilsContrInvcgLockRsn   as ActvUtilsContrInvcgLockRsn   on ActvUtilsContrInvcgLockRsn.CABusinessLockObject = UtilitiesContract.UtilitiesContract
  //    left outer join I_UtilsInvcgDocOutsrtgData   as UtilsInvcgDocOutsrtgData   on  UtilitiesInvoicingDocument.UtilitiesInvoicingDocument  = UtilsInvcgDocOutsrtgData.UtilitiesInvoicingDocument

  //                                                                               and UtilsInvcgDocOutsrtgData.UtilsInvcgDocIsReldBackground = ''

    left outer join I_UtilsInvcgDocOutsrtgDataCntr as UtilsInvcgDocOutsrtgDataCntr on UtilitiesInvoicingDocument.UtilitiesInvoicingDocument = UtilsInvcgDocOutsrtgDataCntr.UtilitiesInvoicingDocument
  association [0..1] to I_UtilitiesPortionScheduleRecd as _UtilitiesPortionScheduleRecd on  $projection.UtilitiesPortion               = _UtilitiesPortionScheduleRecd.UtilitiesPortion
                                                                                        and $projection.UtilsPortionScheduleRecordDate = _UtilitiesPortionScheduleRecd.UtilsPortionScheduleRecordDate
  association [0..1] to I_UtilsBillgDocIntAndExtPoD    as _UtilsBillgDocIntAndExtPoD    on  $projection.UtilitiesBillingDocument = _UtilsBillgDocIntAndExtPoD.UtilitiesBillingDocument
  association [0..1] to I_CAInvcgLockReason            as _CAInvcgLockReason            on  $projection.CABusinessLockReason = _CAInvcgLockReason.CAInvcgLockReason
{
  UtilitiesInvoicingDocument.UtilitiesInvoicingDocument,

  @ObjectModel.foreignKey.association: '_UtilitiesBillingDocument'
  UtilsBillgDocInvcgHistory.UtilitiesBillingDocument,

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

  UtilitiesInvoicingDocument.ContractAccount,

  @ObjectModel.foreignKey.association: '_UtilitiesContract'
  UtilitiesBillingDocument.UtilitiesContract,

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

  @ObjectModel.foreignKey.association: '_Division'
  UtilitiesContract.UtilitiesDivision                                                               as Division,

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

  UtilitiesContract.UtilitiesMoveInDate,

  UtilitiesContract.UtilitiesMoveOutDate,

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

  @ObjectModel.foreignKey.association: '_InvcUtilsContractsJointly'
  UtilitiesContract.UtilsContrJointInvcType,

  @ObjectModel.foreignKey.association: '_UtilsBillgOutsortingGroup'
  UtilitiesContract.UtilsBillgOutsortingReason,

  @ObjectModel.foreignKey.association: '_UtilitiesBillingReason'
  UtilitiesBillingDocument.UtilitiesBillingReason,

  UtilitiesBillingDocument.UtilsBillgPeriodStartDate,

  UtilitiesBillingDocument.UtilsBillgPeriodEndDate,

  @ObjectModel.foreignKey.association: '_UtilitiesPortion'
  UtilitiesBillingDocument.UtilitiesPortion,

  @Semantics.businessDate.at: true
  UtilitiesBillingDocument.ScheduledUtilitiesBillingDate,

  UtilitiesBillingDocument.UtilsPortionScheduleRecordDate,

  @ObjectModel.foreignKey.association: '_MeterReadingUnit'
  UtilitiesBillingDocument.MeterReadingUnit,

  UtilitiesBillingDocument.ScheduledMeterReadingDate,

  UtilitiesBillingDocument.UtilsBillgDocCreationDate,

  @ObjectModel.foreignKey.association: '_UtilsAccountClass'
  UtilitiesBillingDocument.UtilitiesAccountClass,

  @ObjectModel.foreignKey.association: '_UtilsContrSpcfcBdgtBillgCyc'
  UtilitiesContract.UtilsContrSpcfcBdgtBillgCycle,

  @ObjectModel.foreignKey.association: '_UtilitiesBdgtBillgCyc'
  UtilitiesBillingDocument._UtilitiesPortion.UtilsDefaultBdgtBillgCycle,

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

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

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

  UtilitiesInvoicingDocument.UtilsInvcgDocIsNotReleased,

  UtilitiesInvoicingDocument.UtilsInvcgDocIsSimulated,

  UtilitiesInvoicingDocument.UtilsInvcgDocIsReversed,

  @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,

  case
    when UtilitiesBillingDocument.ScheduledUtilitiesBillingDate     >= UtilitiesContract.UtilitiesMoveInDate
         and UtilitiesBillingDocument.ScheduledUtilitiesBillingDate <= UtilitiesContract.UtilitiesMoveOutDate
      then 'X'
  end                                                                                               as UtilitiesContractIsActive,

  case
    when UtilitiesBillingDocument.ScheduledUtilitiesBillingDate     >= UtilitiesInstallationHist.UtilsInstHistValidityStartDate
         and UtilitiesBillingDocument.ScheduledUtilitiesBillingDate <= UtilitiesInstallationHist.UtilsInstHistValidityEndDate
      then 'X'
  end                                                                                               as UtilsInstTimeSliceIsValid,

  UtilitiesInvoicingDocument.AuthorizationGroup,

  //  @Aggregation: { referenceElement:  [ 'UtilitiesInvoicingDocument' ],  default: #COUNT_DISTINCT }

  cast(1 as e_invoicingdoc_vdm)                                                                     as NmbrOfUtilsInvoicingDocuments,

  //To exclude outsorted invoicing documents that were released in background

  //  case

  //      when UtilsInvcgDocOutsrtgData.UtilitiesInvoicingDocument is not null

  //       then UtilsInvcgDocOutsrtgData.UtilitiesInvoicingDocument

  //  end


  //  To exclude outsorted invoicing documents that were released in background

  case
      when UtilsInvcgDocOutsrtgDataCntr.UtilitiesInvoicingDocument is not null
       then UtilsInvcgDocOutsrtgDataCntr.UtilitiesInvoicingDocument
  end                                                                                               as UtilsInvcgDocNotReleased,


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


  /* Associations */
  UtilsBillgDocInvcgHistory._UtilitiesBillingDocument,
  UtilitiesInvoicingDocument._BusinessPartner,
  UtilitiesBillingDocument._UtilitiesContract,
  UtilitiesContract._CompanyCode,
  UtilitiesContract._Division,
  UtilitiesContract._UtilitiesInstallation,
  UtilitiesContract._UtilsAccountDetnCode,
  UtilitiesContract._InvcUtilsContractsJointly,
  UtilitiesContract._UtilsBillgOutsortingGroup,
  UtilitiesBillingDocument._UtilitiesBillingReason,
  UtilitiesBillingDocument._UtilitiesPortion,
  UtilitiesBillingDocument._MeterReadingUnit,
  UtilitiesBillingDocument._UtilsAccountClass,
  UtilitiesContract._UtilsContrSpcfcBdgtBillgCyc,
  UtilitiesBillingDocument._UtilitiesPortion._UtilitiesBdgtBillgCyc,
  UtilitiesInstallationHist._UtilitiesRateCategory,
  UtilitiesInstallationHist._UtilsBillingClass,
  ContractAccountPartner._AltvContrAcc,
  _UtilitiesPortionScheduleRecd,
  _UtilsBillgDocIntAndExtPoD,
  _CAInvcgLockReason
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ACTVUTILSCAINVCGLOCKRSN",
"I_ACTVUTILSCONTRINVCGLOCKRSN",
"I_CONTRACTACCOUNTPARTNER",
"I_UTILITIESBILLINGDOCUMENT",
"I_UTILITIESCONTRACT",
"I_UTILITIESINSTALLATIONHIST",
"I_UTILITIESINVOICINGDOCUMENT",
"I_UTILITIESPORTION",
"I_UTILSBILLGDOCINVCGHISTORY",
"I_UTILSCAINVCGLOCKRSN",
"I_UTILSINVCGDOCOUTSRTGDATACNTR"
],
"ASSOCIATED":
[
"I_BUSINESSPARTNER",
"I_CAINVCGLOCKREASON",
"I_COMPANYCODE",
"I_CONTRACTACCOUNTHEADER",
"I_DIVISION",
"I_INVCUTILSCONTRACTSJOINTLY",
"I_METERREADINGUNIT",
"I_UTILITIESBILLINGDOCUMENT",
"I_UTILITIESBILLINGREASON",
"I_UTILITIESCONTRACT",
"I_UTILITIESINSTALLATION",
"I_UTILITIESPORTION",
"I_UTILITIESPORTIONSCHEDULERECD",
"I_UTILITIESRATECATEGORY",
"I_UTILSACCOUNTCLASS",
"I_UTILSACCOUNTDETNCODE",
"I_UTILSBILLGDOCINTANDEXTPOD",
"I_UTILSBILLGOUTSORTINGGROUP",
"I_UTILSBILLINGCLASS",
"I_UTILSCONTRSPCFCBDGTBILLGCYC",
"I_UTILSPORTNDFLTBDGTBILLGCYC"
],
"BASE":
[
"I_CONTRACTACCOUNTPARTNER",
"I_UTILITIESBILLINGDOCUMENT",
"I_UTILITIESCONTRACT",
"I_UTILITIESINSTALLATIONHIST",
"I_UTILITIESINVOICINGDOCUMENT",
"I_UTILITIESPORTION",
"I_UTILSBILLGDOCINVCGHISTORY"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/