I_UtilitiesInvoicingDocumentC

DDL: I_UTILITIESINVOICINGDOCUMENTC SQL: IEINVCGDOCC Type: view COMPOSITE

Invoicing Document Cube

I_UtilitiesInvoicingDocumentC is a Composite CDS View (Cube) that provides data about "Invoicing Document Cube" in SAP S/4HANA. It reads from 1 data source (I_UtilitiesInvoicingDocument) and exposes 43 fields with key field UtilitiesInvoicingDocument. It has 1 association to related views.

Data Sources (1)

SourceAliasJoin Type
I_UtilitiesInvoicingDocument I_UtilitiesInvoicingDocument from

Parameters (2)

NameTypeDefault
P_ExchangeRateType kurst_curr
P_DisplayCurrency e_tcurr_curr_vdm

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_ExchangeRateType _ExchangeRateType $projection.ExchangeRateType = _ExchangeRateType.ExchangeRateType

Annotations (13)

NameValueLevelField
EndUserText.label Invoicing Document Cube view
Analytics.dataCategory #CUBE view
VDM.viewType #COMPOSITE view
AbapCatalog.sqlViewName IEINVCGDOCC view
AccessControl.authorizationCheck #CHECK view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.representativeKey UtilitiesInvoicingDocument view
Metadata.allowExtensions true view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view

Fields (43)

KeyFieldSource TableSource FieldDescription
KEY UtilitiesInvoicingDocument UtilitiesInvoicingDocument
UtilitiesInvoicingDocPrintDate UtilitiesInvoicingDocPrintDate
NetDueDate NetDueDate
CashDiscountDueDate CashDiscountDueDate
CashDiscountPercent CashDiscountPercent
PostingDate PostingDate
DocumentDate DocumentDate
TotalAmountInTransactionCrcy TotalAmountInTransactionCrcy
TransactionCurrency TransactionCurrency
DisplayCurrency
ExchangeRateType
PaymentMethod PaymentMethod
UtilitiesInvoicingReason UtilitiesInvoicingReason
UtilsInvcgDocIsReversed UtilsInvcgDocIsReversed
UtilsInvcgDocReversalRsn UtilsInvcgDocReversalRsn
ReversalUtilsInvcgDocument ReversalUtilsInvcgDocument
UtilsInvcgDocIsNotReleased UtilsInvcgDocIsNotReleased
UtilsInvcgDocIsSimulated UtilsInvcgDocIsSimulated
UtilsInvcgDocumentIsPosted UtilsInvcgDocumentIsPosted
BusinessPartner BusinessPartner
ContractAccount ContractAccount
UtilitiesPortion UtilitiesPortion
UtilitiesBillingReason UtilitiesBillingReason
UtilitiesInvoicingParty UtilitiesInvoicingParty
UtilsInvcgDocCreationDate UtilsInvcgDocCreationDate
UtilsInvcgDocCreatedByUser UtilsInvcgDocCreatedByUser
UtilsInvcgDocLastChangeDate UtilsInvcgDocLastChangeDate
UtilsInvcgDocLastChangedByUser UtilsInvcgDocLastChangedByUser
OriginalUtilsInvcgDocRvslDate OriginalUtilsInvcgDocRvslDate
OriginalUtilsInvcgDocument OriginalUtilsInvcgDocument
AuthorizationGroup AuthorizationGroup
UtilsInvcgDocPrintBlockRsn UtilsInvcgDocPrintBlockRsn
NmbrOfUtilsInvoicingDocuments
_UtilitiesInvoicingReason _UtilitiesInvoicingReason
_UtilsInvcgDocReversalRsn _UtilsInvcgDocReversalRsn
_UtilsInvcgPrntBlockRsn _UtilsInvcgPrntBlockRsn
_UtilitiesPortion _UtilitiesPortion
_UtilitiesBillingReason _UtilitiesBillingReason
_BusinessPartner _BusinessPartner
_Currency _Currency
_ExchangeRateType _ExchangeRateType
_CreatedByUser _CreatedByUser
_LastChangedByUser _LastChangedByUser
@EndUserText.label: 'Invoicing Document Cube'
@Analytics.dataCategory: #CUBE
@VDM.viewType: #COMPOSITE
@AbapCatalog.sqlViewName: 'IEINVCGDOCC'
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.representativeKey: 'UtilitiesInvoicingDocument'
@AccessControl.privilegedAssociations:  [ '_CreatedByUser', '_LastChangedByUser' ]
@Metadata.allowExtensions: true
@AbapCatalog.compiler.compareFilter:true
@AbapCatalog.preserveKey:true

define view I_UtilitiesInvoicingDocumentC
  with parameters
    @Consumption.valueHelp: '_ExchangeRateType'
    P_ExchangeRateType : kurst_curr,
    P_DisplayCurrency  : e_tcurr_curr_vdm
  as select from I_UtilitiesInvoicingDocument
  association [0..1] to I_ExchangeRateType as _ExchangeRateType on $projection.ExchangeRateType = _ExchangeRateType.ExchangeRateType
{

  key UtilitiesInvoicingDocument,

      UtilitiesInvoicingDocPrintDate,

      NetDueDate,

      CashDiscountDueDate,

      @DefaultAggregation: #NONE
      CashDiscountPercent,

      PostingDate,

      DocumentDate,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      TotalAmountInTransactionCrcy,
      // Commented because of ATC error POC_ANNOTA-SHFT

      //      cast ( decimal_shift(

      //          amount => TotalAmountInTransactionCrcy,

      //          currency => TransactionCurrency,

      //          error_handling => 'SET_TO_NULL'

      //      ) as e_total_amount_trans_crcy_vdm)                      as TotalAmountInTransactionCrcy,


      @Semantics.currencyCode: true
      TransactionCurrency,

      @DefaultAggregation: #SUM
      @Semantics.amount.currencyCode: 'DisplayCurrency'
      cast (currency_conversion(
          amount => TotalAmountInTransactionCrcy,
          source_currency => TransactionCurrency,
          target_currency => $parameters.P_DisplayCurrency,
          exchange_rate_date => UtilsInvcgDocCreationDate,
          exchange_rate_type => $parameters.P_ExchangeRateType,
          round => #cdsboolean.TRUE,
      //          decimal_shift => #cdsboolean.TRUE,       // Commented because of ATC error POC_ANNOTA-SHFT

      //          decimal_shift_back => #cdsboolean.TRUE,

          error_handling => 'SET_TO_NULL'
      )    as e_total_amount_disp_crcy_vdm )                   as TotalAmountInDisplayCrcy,

      @Semantics.currencyCode: true
      cast ($parameters.P_DisplayCurrency as e_tcurr_curr_vdm) as DisplayCurrency,

      @Consumption.valueHelp: '_ExchangeRateType' //value help for parameter

      cast ($parameters.P_ExchangeRateType as kurst_curr)      as ExchangeRateType,

      PaymentMethod,

      @ObjectModel.foreignKey.association: '_UtilitiesInvoicingReason'
      UtilitiesInvoicingReason,

      UtilsInvcgDocIsReversed,

      @ObjectModel.foreignKey.association: '_UtilsInvcgDocReversalRsn'
      UtilsInvcgDocReversalRsn,

      ReversalUtilsInvcgDocument,

      UtilsInvcgDocIsNotReleased,

      UtilsInvcgDocIsSimulated,

      UtilsInvcgDocumentIsPosted,

      BusinessPartner,

      //@ObjectModel.foreignKey.association: '_ContractAccount'

      ContractAccount,

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

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

      UtilitiesInvoicingParty,

      UtilsInvcgDocCreationDate,

      UtilsInvcgDocCreatedByUser,

      UtilsInvcgDocLastChangeDate,

      UtilsInvcgDocLastChangedByUser,

      OriginalUtilsInvcgDocRvslDate,

      OriginalUtilsInvcgDocument,

      AuthorizationGroup,

      @ObjectModel.foreignKey.association: '_UtilsInvcgPrntBlockRsn'
      UtilsInvcgDocPrintBlockRsn,

      @DefaultAggregation: #SUM
      cast (1 as e_invoicingdoc_vdm)                           as NmbrOfUtilsInvoicingDocuments,

      @DefaultAggregation: #SUM
      case when UtilsInvcgDocumentIsPosted = 'X' and //Field active

                UtilsInvcgDocIsReversed = '' //Field inactive

      then cast(1 as e_postedinvcgdoc_vdm)
      else cast(0 as e_postedinvcgdoc_vdm)
      end                                                      as NmbrOfPostedUtilsInvcgDocs,

      @DefaultAggregation: #SUM
      case when UtilsInvcgDocIsReversed = 'X' //Field active

      then cast(1 as e_reversedinvcgdoc_vdm)
      else cast(0 as e_reversedinvcgdoc_vdm)
      end                                                      as NmbrOfReversedUtilsInvcgDocs,

      @DefaultAggregation: #SUM
      case when UtilsInvcgDocIsNotReleased = 'X' //Field active

      then cast(1 as e_outsortedinvcgdoc_vdm)
      else cast(0 as e_outsortedinvcgdoc_vdm)
      end                                                      as NmbrOfOutsortedUtilsInvcgDocs,

      @DefaultAggregation: #SUM
      case when UtilitiesInvoicingDocPrintDate != '00000000' //No date

      then cast(1 as e_printedinvcgdoc_vdm)
      else cast(0 as e_printedinvcgdoc_vdm)
      end                                                      as NmbrOfPrintedUtilsInvcgDocs,

      @DefaultAggregation: #SUM
      case when UtilsInvcgDocIsSimulated = 'X' //Field active

      then cast(1 as e_simulatedinvcgdoc_vdm)
      else cast(0 as e_simulatedinvcgdoc_vdm)
      end                                                      as NmbrOfSimulatedUtilsInvcgDocs,


      _UtilitiesInvoicingReason,
      _UtilsInvcgDocReversalRsn,
      _UtilsInvcgPrntBlockRsn,
      _UtilitiesPortion,
      _UtilitiesBillingReason,
      _BusinessPartner,
      //_ContractAccount,

      _Currency,
      _ExchangeRateType,
      _CreatedByUser,
      _LastChangedByUser
};
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_UTILITIESINVOICINGDOCUMENT"
],
"ASSOCIATED":
[
"I_BUSINESSPARTNER",
"I_CURRENCY",
"I_EXCHANGERATETYPE",
"I_USER",
"I_UTILITIESBILLINGREASON",
"I_UTILITIESINVOICINGREASON",
"I_UTILITIESPORTION",
"I_UTILSINVCGDOCREVERSALRSN",
"I_UTILSINVCGPRNTBLOCKRSN"
],
"BASE":
[
"I_UTILITIESINVOICINGDOCUMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/