I_BillingDocumentBasic

DDL: I_BILLINGDOCUMENTBASIC SQL: ISDBILLDOCBASIC Type: view BASIC Package: VDM_SD_BIL

Billing Process Document

I_BillingDocumentBasic is a Basic CDS View (Dimension) that provides data about "Billing Process Document" in SAP S/4HANA. It reads from 1 data source (vbrk) and exposes 173 fields with key field BillingDocument. It has 66 associations to related views. Part of development package VDM_SD_BIL.

Data Sources (1)

SourceAliasJoin Type
vbrk vbrk from

Associations (66)

CardinalityTargetAliasCondition
[0..*] I_DunningAreaText _DunningAreaText $projection.DunningArea = _DunningAreaText.DunningArea and $projection.CompanyCode = _DunningAreaText.CompanyCode
[0..*] I_CreditControlAreaText _CreditControlAreaText $projection.CreditControlArea = _CreditControlAreaText.CreditControlArea
[0..*] I_BillingDocumentItemBasic _ItemBasic $projection.BillingDocument = _ItemBasic.BillingDocument
[1..*] I_BillingDocumentPartnerBasic _PartnerBasic $projection.BillingDocument = _PartnerBasic.BillingDocument
[0..*] I_BillingDocPrcgElmntBasic _PricingElementBasic $projection.BillingDocument = _PricingElementBasic.BillingDocument
[0..1] I_SDDocumentCategory _SDDocumentCategory $projection.SDDocumentCategory = _SDDocumentCategory.SDDocumentCategory
[0..1] I_SDDocumentCategory _BillgDocReqRefSDDocCategory $projection.BillgDocReqRefSDDocCategory = _BillgDocReqRefSDDocCategory.SDDocumentCategory
[0..1] I_BillingDocumentCategory _BillingDocumentCategory $projection.BillingDocumentCategory = _BillingDocumentCategory.BillingDocumentCategory
[0..1] I_BillingDocumentType _BillingDocumentType $projection.BillingDocumentType = _BillingDocumentType.BillingDocumentType
[0..1] I_BillingDocumentType _ProposedBillingDocumentType $projection.ProposedBillingDocumentType = _ProposedBillingDocumentType.BillingDocumentType
[0..1] I_User _CreatedByUser $projection.CreatedByUser = _CreatedByUser.UserID
[0..1] I_LogicalSystem _LogicalSystem $projection.LogicalSystem = _LogicalSystem.LogicalSystem
[0..1] I_SalesOrganization _SalesOrganization $projection.SalesOrganization = _SalesOrganization.SalesOrganization
[0..1] I_DistributionChannel _DistributionChannel $projection.DistributionChannel = _DistributionChannel.DistributionChannel
[0..1] I_Division _Division $projection.Division = _Division.Division
[0..1] I_BillingDocumentBasic _CancelledBillingDocumentBasic $projection.CancelledBillingDocument = _CancelledBillingDocumentBasic.BillingDocument
[0..1] I_Currency _TransactionCurrency $projection.TransactionCurrency = _TransactionCurrency.Currency
[0..1] I_Currency _StatisticsCurrency $projection.StatisticsCurrency = _StatisticsCurrency.Currency
[0..1] I_CustomerPriceGroup _CustomerPriceGroup $projection.CustomerPriceGroup = _CustomerPriceGroup.CustomerPriceGroup
[0..1] I_PriceListType _PriceListType $projection.PriceListType = _PriceListType.PriceListType
[0..1] I_Country _TaxDepartureCountry $projection.TaxDepartureCountry = _TaxDepartureCountry.Country
[0..1] I_VATRegistrationOrigin _VATRegistrationOrigin $projection.VATRegistrationOrigin = _VATRegistrationOrigin.VATRegistrationOrigin
[0..1] I_Country _VATRegistrationCountry $projection.VATRegistrationCountry = _VATRegistrationCountry.Country
[0..1] I_SlsPricingProcedure _SDPricingProcedure $projection.SDPricingProcedure = _SDPricingProcedure.PricingProcedure
[0..1] I_ShippingCondition _ShippingCondition $projection.ShippingCondition = _ShippingCondition.ShippingCondition
[0..1] I_IncotermsClassification _IncotermsClassification $projection.IncotermsClassification = _IncotermsClassification.IncotermsClassification
[0..1] I_IncotermsVersion _IncotermsVersion $projection.IncotermsVersion = _IncotermsVersion.IncotermsVersion
[0..1] I_Customer _PayerParty $projection.PayerParty = _PayerParty.Customer
[0..1] I_CustomerPaymentTerms _CustomerPaymentTerms $projection.CustomerPaymentTerms = _CustomerPaymentTerms.CustomerPaymentTerms
[0..1] I_PaymentMethod _PaymentMethod $projection.PaymentMethod = _PaymentMethod.PaymentMethod and $projection.Country = _PaymentMethod.Country
[0..1] I_CompanyCode _CompanyCode $projection.CompanyCode = _CompanyCode.CompanyCode
[0..1] I_FiscalYearForCompanyCode _FiscalYear $projection.FiscalYear = _FiscalYear.FiscalYear and $projection.CompanyCode = _FiscalYear.CompanyCode
[0..1] I_AccountingDocument _AccountingDocument $projection.CompanyCode = _AccountingDocument.CompanyCode and $projection.FiscalYear = _AccountingDocument.FiscalYear and $projection.AccountingDocument = _AccountingDocument.AccountingDocument
[1..1] I_FiscalYearPeriodForCmpnyCode _FiscalPeriod $projection.CompanyCode = _FiscalPeriod.CompanyCode and $projection.FiscalYear = _FiscalPeriod.FiscalYear and $projection.FiscalPeriod = _FiscalPeriod.FiscalPeriod
[0..1] I_CustomerAccountAssgmtGroup _CustomerAccountAssgmtGroup $projection.CustomerAccountAssignmentGroup = _CustomerAccountAssgmtGroup.CustomerAccountAssignmentGroup
[0..1] I_ExchangeRateType _ExchangeRateType $projection.ExchangeRateType = _ExchangeRateType.ExchangeRateType
[0..1] I_ReversalReason _ReversalReason $projection.ReversalReason = _ReversalReason.ReversalReason
[0..1] I_DunningArea _DunningArea $projection.DunningArea = _DunningArea.DunningArea and $projection.CompanyCode = _DunningArea.CompanyCode
[0..1] I_DunningBlockingReasonCode _DunningBlockingReason $projection.DunningBlockingReason = _DunningBlockingReason.DunningBlockingReason
[0..1] I_DunningKey _DunningKey $projection.DunningKey = _DunningKey.DunningKey
[0..1] I_BillingDocumentType _InvoiceListType $projection.InvoiceListType = _InvoiceListType.BillingDocumentType
[0..1] I_Customer _SoldToParty $projection.SoldToParty = _SoldToParty.Customer
[0..1] I_CustomerGroup _CustomerGroup $projection.CustomerGroup = _CustomerGroup.CustomerGroup
[0..1] I_Country _Country $projection.Country = _Country.Country
[0..1] I_CityCode _CityCode $projection.CityCode = _CityCode.CityCode and $projection.Country = _CityCode.Country and $projection.Region = _CityCode.Region
[0..1] I_SalesDistrict _SalesDistrict $projection.SalesDistrict = _SalesDistrict.SalesDistrict
[0..1] I_Region _Region $projection.Region = _Region.Region and $projection.Country = _Region.Country
[0..1] I_CountyCode _County $projection.Country = _County.Country and $projection.Region = _County.Region and $projection.County = _County.County
[0..1] I_TaxingCounty _County_2 $projection.Country = _County_2.Country and $projection.Region = _County_2.Region and $projection.County = _County_2.TaxingCounty
[0..1] I_CreditControlArea _CreditControlArea $projection.CreditControlArea = _CreditControlArea.CreditControlArea
[0..1] I_OverallSDProcessStatus _OverallSDProcessStatus $projection.OverallSDProcessStatus = _OverallSDProcessStatus.OverallSDProcessStatus
[0..1] I_OverallBillingStatus _OverallBillingStatus $projection.OverallBillingStatus = _OverallBillingStatus.OverallBillingStatus
[0..1] I_OvrlBillingDocReqStatus _OvrlBillingDocReqStatus $projection.OverallBillingDocReqStatus = _OvrlBillingDocReqStatus.OverallBillingDocReqStatus
[0..1] I_PrelimBillgDocStatus _PrelimBillingDocumentStatus $projection.PrelimBillingDocumentStatus = _PrelimBillingDocumentStatus.PrelimBillingDocumentStatus
[0..1] I_AccountingPostingStatus _AccountingPostingStatus $projection.AccountingPostingStatus = _AccountingPostingStatus.AccountingPostingStatus
[0..1] I_AccountingTransferStatus _AccountingTransferStatus $projection.AccountingTransferStatus = _AccountingTransferStatus.AccountingTransferStatus
[0..1] I_BillingIssueType _BillingIssueType $projection.BillingIssueType = _BillingIssueType.BillingIssueType
[0..1] I_InvoiceListStatus _InvoiceListStatus $projection.InvoiceListStatus = _InvoiceListStatus.InvoiceListStatus
[0..1] I_OvrlItmGenIncompletionSts _OvrlItmGeneralIncompletionSts $projection.OvrlItmGeneralIncompletionSts = _OvrlItmGeneralIncompletionSts.OvrlItmGeneralIncompletionSts
[0..1] I_OverallPrcIncompletionSts _OverallPricingIncompletionSts $projection.OverallPricingIncompletionSts = _OverallPricingIncompletionSts.OverallPricingIncompletionSts
[0..1] I_SDApprovalStatus _BillgProcDocApprovalStatus $projection.BillgProcDocApprovalStatus = _BillgProcDocApprovalStatus.SDApprovalStatus
[0..1] I_BillgProcDocApprovalReason _BillgProcDocApprovalReason $projection.SDDocumentCategory = _BillgProcDocApprovalReason.SDDocumentCategory and $projection.BillgProcDocApprovalReason = _BillgProcDocApprovalReason.BillgProcDocApprovalReason
[0..*] I_SDApprovalStatusT _BillgProcDocApprovalStatusT $projection.BillgProcDocApprovalStatus = _BillgProcDocApprovalStatusT.SDApprovalStatus
[0..*] I_SDApprovalReasonT _BillgProcDocApprovalReasonT $projection.BillgProcDocApprovalReason = _BillgProcDocApprovalReasonT.SDApprovalReason
[0..1] I_InvoiceClearingStatus _InvoiceClearingStatus $projection.InvoiceClearingStatus = _InvoiceClearingStatus.InvoiceClearingStatus
[0..1] E_BillingDocument _Extension $projection.BillingDocument = _Extension.BillingDocument

Annotations (16)

NameValueLevelField
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AbapCatalog.sqlViewName ISDBILLDOCBASIC view
AccessControl.authorizationCheck #CHECK view
Analytics.dataCategory #DIMENSION view
ClientHandling.algorithm #SESSION_VARIABLE view
EndUserText.label Billing Process Document view
Metadata.allowExtensions true view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.compositionRoot true view
ObjectModel.modelingPattern #ANALYTICAL_DIMENSION view
ObjectModel.representativeKey BillingDocument view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #L view
VDM.viewType #BASIC view

Fields (173)

KeyFieldSource TableSource FieldDescription
KEY BillingDocument vbeln
SDDocumentCategory vbtyp
BillingDocumentCategory fktyp
BillingDocumentType fkart
ProposedBillingDocumentType fkara
CreatedByUser ernam
CreationDate erdat
CreationTime erzet
LastChangeDate aedat
LastChangeDateTime changed_on
LogicalSystem logsys
SalesOrganization vkorg
DistributionChannel vtweg
Division spart
BillingDocumentDate fkdat
BillingDocumentIsCancelled fksto
CancelledBillingDocument sfakn
BillingDocCombinationCriteria zukri
ManualInvoiceMaintIsRelevant mrnkz
NmbrOfPages numpg
IsIntrastatReportingRelevant intra_rel
IsIntrastatReportingExcluded intra_excl
BillingDocumentIsTemporary draft
TotalNetAmount netwr
TransactionCurrency waerk
StatisticsCurrency stwae
TotalTaxAmount mwsbk
CustomerPriceGroup konda
PriceListType pltyp
TaxDepartureCountry landtx
VATRegistration stceg
VATRegistrationOrigin stceg_h
VATRegistrationCountry stceg_l
HierarchyTypePricing hityp_pr
CustomerTaxClassification1 taxk1
CustomerTaxClassification2 taxk2
CustomerTaxClassification3 taxk3
CustomerTaxClassification4 taxk4
CustomerTaxClassification5 taxk5
CustomerTaxClassification6 taxk6
CustomerTaxClassification7 taxk7
CustomerTaxClassification8 taxk8
CustomerTaxClassification9 taxk9
IsEUTriangularDeal xegdr
SDPricingProcedure kalsm
ShippingCondition vsbed
PlantSupplier ico_lifnr
IncotermsVersion incov
IncotermsClassification inco1
IncotermsTransferLocation inco2
IncotermsLocation1 inco2_l
IncotermsLocation2 inco3_l
PayerParty kunrg
ContractAccount vkont
CustomerPaymentTerms zterm
PaymentMethod zlsch
PaymentReference kidno
FixedValueDate valdt
AdditionalValueDays valtg
SEPAMandate mndid
DeviatingPostingDate deviating_posting_date
CompanyCode bukrs
FiscalYear gjahr
AccountingDocument belnr
FiscalPeriod poper
CustomerAccountAssignmentGroup ktgrd
AccountingExchangeRateIsSet cpkur
AccountingExchangeRate
ExchangeRateDate kurrf_dat
ExchangeRateType kurst
DocumentReferenceID xblnr
AssignmentReference zuonr
ReversalReason stgrd
DunningArea maber
DunningBlockingReason mansp
DunningKey mschl
InternalFinancialDocument lcnum
IsRelevantForAccrual accrrel
InvoiceListType fkart_rl
InvoiceListBillingDate fkdat_rl
BillingDocRequestReference bdr_ref
BillgDocReqRefLgclSyst bdr_ref_logsys
BillgDocReqRefSDDocCategory bdr_ref_vbtyp
SoldToParty kunag
PartnerCompany vbund
PurchaseOrderByCustomer bstnk_vf
CustomerGroup kdgrp
Country land1
CityCode cityc
SalesDistrict bzirk
Region regio
County counc
CreditControlArea kkber
CustomerRebateAgreement knuma
PricingDocument knumv
OverallSDProcessStatus gbstk
OverallBillingStatus vf_status
AccountingPostingStatus buchk
AccountingTransferStatus rfbsk
BillingIssueType vf_todo
OverallBillingDocReqStatus bdr_status
InvoiceListStatus relik
OvrlItmGeneralIncompletionSts uvals
OverallPricingIncompletionSts uvprs
OverallDocumentBillingStatus fksak
PrelimBillingDocumentStatus pbd_status
InvoiceClearingStatus clrst
BillgProcDocApprovalStatus vbrk apm_approval_status
BillgProcDocApprovalReason apm_approval_reason
_ItemBasic _ItemBasic
_PartnerBasic _PartnerBasic
_PricingElementBasic _PricingElementBasic
_SDDocumentCategory _SDDocumentCategory
_BillgDocReqRefSDDocCategory _BillgDocReqRefSDDocCategory
_BillingDocumentCategory _BillingDocumentCategory
_BillingDocumentType _BillingDocumentType
_ProposedBillingDocumentType _ProposedBillingDocumentType
_CreatedByUser _CreatedByUser
_LogicalSystem _LogicalSystem
_SalesOrganization _SalesOrganization
_DistributionChannel _DistributionChannel
_Division _Division
_CancelledBillingDocumentBasic _CancelledBillingDocumentBasic
_TransactionCurrency _TransactionCurrency
_StatisticsCurrency _StatisticsCurrency
_CustomerPriceGroup _CustomerPriceGroup
_PriceListType _PriceListType
_TaxDepartureCountry _TaxDepartureCountry
_VATRegistrationOrigin _VATRegistrationOrigin
_VATRegistrationCountry _VATRegistrationCountry
_SDPricingProcedure _SDPricingProcedure
_ShippingCondition _ShippingCondition
_IncotermsClassification _IncotermsClassification
_IncotermsVersion _IncotermsVersion
_PayerParty _PayerParty
_CustomerPaymentTerms _CustomerPaymentTerms
_PaymentMethod _PaymentMethod
_CompanyCode _CompanyCode
_FiscalYear _FiscalYear
_AccountingDocument _AccountingDocument
_CustomerAccountAssgmtGroup _CustomerAccountAssgmtGroup
_ExchangeRateType _ExchangeRateType
_ReversalReason _ReversalReason
_DunningArea _DunningArea
_DunningBlockingReason _DunningBlockingReason
_DunningKey _DunningKey
_InvoiceListType _InvoiceListType
_SoldToParty _SoldToParty
_CustomerGroup _CustomerGroup
_Country _Country
_CityCode _CityCode
_SalesDistrict _SalesDistrict
_Region _Region
_County _County
_County_2 _County_2
_CreditControlArea _CreditControlArea
_OverallSDProcessStatus _OverallSDProcessStatus
_OverallBillingStatus _OverallBillingStatus
_OvrlBillingDocReqStatus _OvrlBillingDocReqStatus
_PrelimBillingDocumentStatus _PrelimBillingDocumentStatus
_AccountingPostingStatus _AccountingPostingStatus
_AccountingTransferStatus _AccountingTransferStatus
_BillingIssueType _BillingIssueType
_InvoiceListStatus _InvoiceListStatus
_OvrlItmGeneralIncompletionSts _OvrlItmGeneralIncompletionSts
_OverallPricingIncompletionSts _OverallPricingIncompletionSts
_BillgProcDocApprovalReason _BillgProcDocApprovalReason
_BillgProcDocApprovalStatus _BillgProcDocApprovalStatus
_BillgProcDocApprovalStatusT _BillgProcDocApprovalStatusT
_BillgProcDocApprovalReasonT _BillgProcDocApprovalReasonT
_InvoiceClearingStatus _InvoiceClearingStatus
_DunningAreaText _DunningAreaText
_CreditControlAreaText _CreditControlAreaText
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'ISDBILLDOCBASIC'

@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #('TRANSACTIONAL_DATA')
@AccessControl.privilegedAssociations: [ '_CreatedByUser', '_DunningAreaText', '_CreditControlAreaText' ]

@Analytics.dataCategory: #DIMENSION

@ClientHandling.algorithm: #SESSION_VARIABLE

@EndUserText.label: 'Billing Process Document'

@Metadata.allowExtensions: true
@Metadata.ignorePropagatedAnnotations: true

@ObjectModel.compositionRoot: true
@ObjectModel.modelingPattern: #ANALYTICAL_DIMENSION
@ObjectModel.representativeKey: 'BillingDocument'

@ObjectModel.supportedCapabilities: [ #ANALYTICAL_DIMENSION,
                                      #CDS_MODELING_DATA_SOURCE,
                                      #CDS_MODELING_ASSOCIATION_TARGET,
                                      #SQL_DATA_SOURCE ]

@ObjectModel.usageType: { dataClass: #TRANSACTIONAL, serviceQuality: #A, sizeCategory: #L }

@VDM.viewType: #BASIC

define view I_BillingDocumentBasic
  as select from vbrk
  // Association


  association [0..*] to I_DunningAreaText              as _DunningAreaText
    on  $projection.DunningArea = _DunningAreaText.DunningArea
    and $projection.CompanyCode = _DunningAreaText.CompanyCode

  association [0..*] to I_CreditControlAreaText        as _CreditControlAreaText
    on $projection.CreditControlArea = _CreditControlAreaText.CreditControlArea

  association [0..*] to I_BillingDocumentItemBasic     as _ItemBasic
    on $projection.BillingDocument = _ItemBasic.BillingDocument

  association [1..*] to I_BillingDocumentPartnerBasic  as _PartnerBasic
    on $projection.BillingDocument = _PartnerBasic.BillingDocument

  association [0..*] to I_BillingDocPrcgElmntBasic     as _PricingElementBasic
    on $projection.BillingDocument = _PricingElementBasic.BillingDocument

  association [0..1] to I_SDDocumentCategory           as _SDDocumentCategory
    on $projection.SDDocumentCategory = _SDDocumentCategory.SDDocumentCategory

  association [0..1] to I_SDDocumentCategory           as _BillgDocReqRefSDDocCategory
    on $projection.BillgDocReqRefSDDocCategory = _BillgDocReqRefSDDocCategory.SDDocumentCategory

  association [0..1] to I_BillingDocumentCategory      as _BillingDocumentCategory
    on $projection.BillingDocumentCategory = _BillingDocumentCategory.BillingDocumentCategory

  association [0..1] to I_BillingDocumentType          as _BillingDocumentType
    on $projection.BillingDocumentType = _BillingDocumentType.BillingDocumentType

  association [0..1] to I_BillingDocumentType          as _ProposedBillingDocumentType
    on $projection.ProposedBillingDocumentType = _ProposedBillingDocumentType.BillingDocumentType

  association [0..1] to I_User                         as _CreatedByUser
    on $projection.CreatedByUser = _CreatedByUser.UserID

  association [0..1] to I_LogicalSystem                as _LogicalSystem
    on $projection.LogicalSystem = _LogicalSystem.LogicalSystem

  association [0..1] to I_SalesOrganization            as _SalesOrganization
    on $projection.SalesOrganization = _SalesOrganization.SalesOrganization

  association [0..1] to I_DistributionChannel          as _DistributionChannel
    on $projection.DistributionChannel = _DistributionChannel.DistributionChannel

  association [0..1] to I_Division                     as _Division
    on $projection.Division = _Division.Division

  association [0..1] to I_BillingDocumentBasic         as _CancelledBillingDocumentBasic
    on $projection.CancelledBillingDocument = _CancelledBillingDocumentBasic.BillingDocument

  association [0..1] to I_Currency                     as _TransactionCurrency
    on $projection.TransactionCurrency = _TransactionCurrency.Currency

  association [0..1] to I_Currency                     as _StatisticsCurrency
    on $projection.StatisticsCurrency = _StatisticsCurrency.Currency

  association [0..1] to I_CustomerPriceGroup           as _CustomerPriceGroup
    on $projection.CustomerPriceGroup = _CustomerPriceGroup.CustomerPriceGroup

  association [0..1] to I_PriceListType                as _PriceListType
    on $projection.PriceListType = _PriceListType.PriceListType

  association [0..1] to I_Country                      as _TaxDepartureCountry
    on $projection.TaxDepartureCountry = _TaxDepartureCountry.Country

  association [0..1] to I_VATRegistrationOrigin        as _VATRegistrationOrigin
    on $projection.VATRegistrationOrigin = _VATRegistrationOrigin.VATRegistrationOrigin

  association [0..1] to I_Country                      as _VATRegistrationCountry
    on $projection.VATRegistrationCountry = _VATRegistrationCountry.Country

  association [0..1] to I_SlsPricingProcedure          as _SDPricingProcedure
    on $projection.SDPricingProcedure = _SDPricingProcedure.PricingProcedure

  association [0..1] to I_ShippingCondition            as _ShippingCondition
    on $projection.ShippingCondition = _ShippingCondition.ShippingCondition

  association [0..1] to I_IncotermsClassification      as _IncotermsClassification
    on $projection.IncotermsClassification = _IncotermsClassification.IncotermsClassification

  association [0..1] to I_IncotermsVersion             as _IncotermsVersion
    on $projection.IncotermsVersion = _IncotermsVersion.IncotermsVersion

  association [0..1] to I_Customer                     as _PayerParty
    on $projection.PayerParty = _PayerParty.Customer

  association [0..1] to I_CustomerPaymentTerms         as _CustomerPaymentTerms
    on $projection.CustomerPaymentTerms = _CustomerPaymentTerms.CustomerPaymentTerms

  association [0..1] to I_PaymentMethod                as _PaymentMethod
    on  $projection.PaymentMethod = _PaymentMethod.PaymentMethod
    and $projection.Country       = _PaymentMethod.Country

  association [0..1] to I_CompanyCode                  as _CompanyCode
    on $projection.CompanyCode = _CompanyCode.CompanyCode

  association [0..1] to I_FiscalYearForCompanyCode     as _FiscalYear
    on  $projection.FiscalYear  = _FiscalYear.FiscalYear
    and $projection.CompanyCode = _FiscalYear.CompanyCode

  association [0..1] to I_AccountingDocument           as _AccountingDocument
    on  $projection.CompanyCode        = _AccountingDocument.CompanyCode
    and $projection.FiscalYear         = _AccountingDocument.FiscalYear
    and $projection.AccountingDocument = _AccountingDocument.AccountingDocument

  association [1..1] to I_FiscalYearPeriodForCmpnyCode as _FiscalPeriod
    on  $projection.CompanyCode  = _FiscalPeriod.CompanyCode
    and $projection.FiscalYear   = _FiscalPeriod.FiscalYear
    and $projection.FiscalPeriod = _FiscalPeriod.FiscalPeriod

  association [0..1] to I_CustomerAccountAssgmtGroup   as _CustomerAccountAssgmtGroup
    on $projection.CustomerAccountAssignmentGroup = _CustomerAccountAssgmtGroup.CustomerAccountAssignmentGroup

  association [0..1] to I_ExchangeRateType             as _ExchangeRateType
    on $projection.ExchangeRateType = _ExchangeRateType.ExchangeRateType

  association [0..1] to I_ReversalReason               as _ReversalReason
    on $projection.ReversalReason = _ReversalReason.ReversalReason

  association [0..1] to I_DunningArea                  as _DunningArea
    on  $projection.DunningArea = _DunningArea.DunningArea
    and $projection.CompanyCode = _DunningArea.CompanyCode

  association [0..1] to I_DunningBlockingReasonCode    as _DunningBlockingReason
    on $projection.DunningBlockingReason = _DunningBlockingReason.DunningBlockingReason

  association [0..1] to I_DunningKey                   as _DunningKey
    on $projection.DunningKey = _DunningKey.DunningKey

  association [0..1] to I_BillingDocumentType          as _InvoiceListType
    on $projection.InvoiceListType = _InvoiceListType.BillingDocumentType

  association [0..1] to I_Customer                     as _SoldToParty
    on $projection.SoldToParty = _SoldToParty.Customer

  association [0..1] to I_CustomerGroup                as _CustomerGroup
    on $projection.CustomerGroup = _CustomerGroup.CustomerGroup

  association [0..1] to I_Country                      as _Country
    on $projection.Country = _Country.Country

  association [0..1] to I_CityCode                     as _CityCode
    on  $projection.CityCode = _CityCode.CityCode
    and $projection.Country  = _CityCode.Country
    and $projection.Region   = _CityCode.Region

  association [0..1] to I_SalesDistrict                as _SalesDistrict
    on $projection.SalesDistrict = _SalesDistrict.SalesDistrict

  association [0..1] to I_Region                       as _Region
    on  $projection.Region  = _Region.Region
    and $projection.Country = _Region.Country

  association [0..1] to I_CountyCode                   as _County
    on  $projection.Country = _County.Country
    and $projection.Region  = _County.Region
    and $projection.County  = _County.County

  association [0..1] to I_TaxingCounty                 as _County_2
    on  $projection.Country = _County_2.Country
    and $projection.Region  = _County_2.Region
    and $projection.County  = _County_2.TaxingCounty

  association [0..1] to I_CreditControlArea            as _CreditControlArea
    on $projection.CreditControlArea = _CreditControlArea.CreditControlArea

  association [0..1] to I_OverallSDProcessStatus       as _OverallSDProcessStatus
    on $projection.OverallSDProcessStatus = _OverallSDProcessStatus.OverallSDProcessStatus

  association [0..1] to I_OverallBillingStatus         as _OverallBillingStatus
    on $projection.OverallBillingStatus = _OverallBillingStatus.OverallBillingStatus

  association [0..1] to I_OvrlBillingDocReqStatus      as _OvrlBillingDocReqStatus
    on $projection.OverallBillingDocReqStatus = _OvrlBillingDocReqStatus.OverallBillingDocReqStatus

  association [0..1] to I_PrelimBillgDocStatus         as _PrelimBillingDocumentStatus
    on $projection.PrelimBillingDocumentStatus = _PrelimBillingDocumentStatus.PrelimBillingDocumentStatus

  association [0..1] to I_AccountingPostingStatus      as _AccountingPostingStatus
    on $projection.AccountingPostingStatus = _AccountingPostingStatus.AccountingPostingStatus

  association [0..1] to I_AccountingTransferStatus     as _AccountingTransferStatus
    on $projection.AccountingTransferStatus = _AccountingTransferStatus.AccountingTransferStatus

  association [0..1] to I_BillingIssueType             as _BillingIssueType
    on $projection.BillingIssueType = _BillingIssueType.BillingIssueType

  association [0..1] to I_InvoiceListStatus            as _InvoiceListStatus
    on $projection.InvoiceListStatus = _InvoiceListStatus.InvoiceListStatus

  association [0..1] to I_OvrlItmGenIncompletionSts    as _OvrlItmGeneralIncompletionSts
    on $projection.OvrlItmGeneralIncompletionSts = _OvrlItmGeneralIncompletionSts.OvrlItmGeneralIncompletionSts

  association [0..1] to I_OverallPrcIncompletionSts    as _OverallPricingIncompletionSts
    on $projection.OverallPricingIncompletionSts = _OverallPricingIncompletionSts.OverallPricingIncompletionSts

  association [0..1] to I_SDApprovalStatus             as _BillgProcDocApprovalStatus
    on $projection.BillgProcDocApprovalStatus = _BillgProcDocApprovalStatus.SDApprovalStatus

  association [0..1] to I_BillgProcDocApprovalReason   as _BillgProcDocApprovalReason
    on  $projection.SDDocumentCategory         = _BillgProcDocApprovalReason.SDDocumentCategory
    and $projection.BillgProcDocApprovalReason = _BillgProcDocApprovalReason.BillgProcDocApprovalReason

  association [0..*] to I_SDApprovalStatusT            as _BillgProcDocApprovalStatusT
    on $projection.BillgProcDocApprovalStatus = _BillgProcDocApprovalStatusT.SDApprovalStatus

  association [0..*] to I_SDApprovalReasonT            as _BillgProcDocApprovalReasonT
    on $projection.BillgProcDocApprovalReason = _BillgProcDocApprovalReasonT.SDApprovalReason

  association [0..1] to I_InvoiceClearingStatus        as _InvoiceClearingStatus
    on $projection.InvoiceClearingStatus = _InvoiceClearingStatus.InvoiceClearingStatus

  // Extensibility

  association [0..1] to E_BillingDocument              as _Extension
    on $projection.BillingDocument = _Extension.BillingDocument

{
      // key

  key vbeln                                              as BillingDocument,

      // category

      @ObjectModel.foreignKey.association: '_SDDocumentCategory'
      vbtyp                                              as SDDocumentCategory,

      @ObjectModel.foreignKey.association: '_BillingDocumentCategory'
      fktyp                                              as BillingDocumentCategory,

      @ObjectModel.foreignKey.association: '_BillingDocumentType'
      fkart                                              as BillingDocumentType,

      @ObjectModel.foreignKey.association: '_ProposedBillingDocumentType'
      fkara                                              as ProposedBillingDocumentType,

      // admin

      @Semantics.personalData.isPotentiallySensitive: true
      @Semantics.user.createdBy: true
      ernam                                              as CreatedByUser,

      @Semantics.systemDate.createdAt: true
      erdat                                              as CreationDate,

      @Semantics.systemTime.createdAt
      erzet                                              as CreationTime,

      @Semantics.systemDate.lastChangedAt: true
      aedat                                              as LastChangeDate,

      @Semantics.systemDateTime.lastChangedAt: true
      changed_on                                         as LastChangeDateTime,

      @ObjectModel.foreignKey.association: '_LogicalSystem'
      logsys                                             as LogicalSystem,

      // org

      @ObjectModel.foreignKey.association: '_SalesOrganization'
      vkorg                                              as SalesOrganization,

      @ObjectModel.foreignKey.association: '_DistributionChannel'
      vtweg                                              as DistributionChannel,

      @ObjectModel.foreignKey.association: '_Division'
      spart                                              as Division,

      // billing

      fkdat                                              as BillingDocumentDate,
      fksto                                              as BillingDocumentIsCancelled,


      // --[ GENERATED:012:GlBfhyFV7jY4{YyEh3zJr0

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_BillingDocumentBasicStdVH', element: 'BillingDocument' } } ]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_CancelledBillingDocumentBasic'
      sfakn                                              as CancelledBillingDocument,

      zukri                                              as BillingDocCombinationCriteria,
      mrnkz                                              as ManualInvoiceMaintIsRelevant,
      numpg                                              as NmbrOfPages,
      intra_rel                                          as IsIntrastatReportingRelevant,
      intra_excl                                         as IsIntrastatReportingExcluded,
      draft                                              as BillingDocumentIsTemporary,

      // pricing

      @Semantics.amount.currencyCode: 'TransactionCurrency'
      netwr                                              as TotalNetAmount,

      @ObjectModel.foreignKey.association: '_TransactionCurrency'
      @Semantics.currencyCode: true
      waerk                                              as TransactionCurrency,

      @ObjectModel.foreignKey.association: '_StatisticsCurrency'
      @Semantics.currencyCode: true
      stwae                                              as StatisticsCurrency,

      @Semantics.amount.currencyCode: 'TransactionCurrency'
      mwsbk                                              as TotalTaxAmount,

      @ObjectModel.foreignKey.association: '_CustomerPriceGroup'
      konda                                              as CustomerPriceGroup,

      @ObjectModel.foreignKey.association: '_PriceListType'
      pltyp                                              as PriceListType,

      @ObjectModel.foreignKey.association: '_TaxDepartureCountry'
      landtx                                             as TaxDepartureCountry,

      stceg                                              as VATRegistration,

      @ObjectModel.foreignKey.association: '_VATRegistrationOrigin'
      stceg_h                                            as VATRegistrationOrigin,

      @ObjectModel.foreignKey.association: '_VATRegistrationCountry'
      stceg_l                                            as VATRegistrationCountry,

      hityp_pr                                           as HierarchyTypePricing,

      taxk1                                              as CustomerTaxClassification1,
      taxk2                                              as CustomerTaxClassification2,
      taxk3                                              as CustomerTaxClassification3,
      taxk4                                              as CustomerTaxClassification4,
      taxk5                                              as CustomerTaxClassification5,
      taxk6                                              as CustomerTaxClassification6,
      taxk7                                              as CustomerTaxClassification7,
      taxk8                                              as CustomerTaxClassification8,
      taxk9                                              as CustomerTaxClassification9,
      xegdr                                              as IsEUTriangularDeal,

      @ObjectModel.foreignKey.association: '_SDPricingProcedure'
      kalsm                                              as SDPricingProcedure,

      // shipping

      @ObjectModel.foreignKey.association: '_ShippingCondition'
      vsbed                                              as ShippingCondition,

      ico_lifnr                                          as PlantSupplier,

      @ObjectModel.foreignKey.association: '_IncotermsVersion'
      incov                                              as IncotermsVersion,
      // to do: add incoterms labels


      @ObjectModel.foreignKey.association: '_IncotermsClassification'
      inco1                                              as IncotermsClassification,

      inco2                                              as IncotermsTransferLocation,
      inco2_l                                            as IncotermsLocation1,
      inco3_l                                            as IncotermsLocation2,

      // payment

      // --[ GENERATED:012:GlBfhyFV7jY4{YyEh3zJr0

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_Customer_VH', element: 'Customer' } } ]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_PayerParty'
      kunrg                                              as PayerParty,

      vkont                                              as ContractAccount,

      @ObjectModel.foreignKey.association: '_CustomerPaymentTerms'
      zterm                                              as CustomerPaymentTerms,

      @ObjectModel.foreignKey.association: '_PaymentMethod'
      zlsch                                              as PaymentMethod,

      kidno                                              as PaymentReference,
      valdt                                              as FixedValueDate,
      valtg                                              as AdditionalValueDays,
      mndid                                              as SEPAMandate,

      // accounting

      deviating_posting_date                             as DeviatingPostingDate,

      // --[ GENERATED:012:GlBfhyFV7jY4{YyEh3zJr0

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_CompanyCodeStdVH', element: 'CompanyCode' } } ]
      // ]--GENERATED      

      @ObjectModel.foreignKey.association: '_CompanyCode'
      bukrs                                              as CompanyCode,

      @ObjectModel.foreignKey.association: '_FiscalYear'
      gjahr                                              as FiscalYear,

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_AccountingDocumentStdVH', element: 'AccountingDocument' },
                                            additionalBinding: [ { localElement: 'CompanyCode', element: 'CompanyCode' },
                                                                 { localElement: 'FiscalYear',  element: 'FiscalYear'  } ] } ]
      @ObjectModel.foreignKey.association: '_AccountingDocument'
      belnr                                              as AccountingDocument,

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

      poper                                              as FiscalPeriod,

      @ObjectModel.foreignKey.association: '_CustomerAccountAssgmtGroup'
      ktgrd                                              as CustomerAccountAssignmentGroup,

      cpkur                                              as AccountingExchangeRateIsSet,
      cast(kurrf as kurrf_not_converted preserving type) as AccountingExchangeRate,
      kurrf_dat                                          as ExchangeRateDate,

      @ObjectModel.foreignKey.association: '_ExchangeRateType'
      kurst                                              as ExchangeRateType,

      xblnr                                              as DocumentReferenceID,
      zuonr                                              as AssignmentReference,

      @ObjectModel.foreignKey.association: '_ReversalReason'
      stgrd                                              as ReversalReason,

      // --[ GENERATED:012:GlBfhyFV7jY4{YyEh3zJr0

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_DunningAreaStdVH', element: 'DunningArea' },
                                            additionalBinding: [ { localElement: 'CompanyCode', element: 'CompanyCode' } ] } ]
      @ObjectModel.foreignKey.association: '_DunningArea'
      @ObjectModel.text.association: '_DunningAreaText'
      // ]--GENERATED

      maber                                              as DunningArea,

      @ObjectModel.foreignKey.association: '_DunningBlockingReason'
      mansp                                              as DunningBlockingReason,

      @ObjectModel.foreignKey.association: '_DunningKey'
      mschl                                              as DunningKey,

      lcnum                                              as InternalFinancialDocument,
      accrrel                                            as IsRelevantForAccrual,

      // invoice list

      @ObjectModel.foreignKey.association: '_InvoiceListType'
      fkart_rl                                           as InvoiceListType,

      fkdat_rl                                           as InvoiceListBillingDate,

      // billing document request

      bdr_ref                                            as BillingDocRequestReference,
      bdr_ref_logsys                                     as BillgDocReqRefLgclSyst,

      @ObjectModel.foreignKey.association: '_BillgDocReqRefSDDocCategory'
      bdr_ref_vbtyp                                      as BillgDocReqRefSDDocCategory,

      // sales

      // --[ GENERATED:012:GlBfhyFV7jY4{YyEh3zJr0

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_Customer_VH', element: 'Customer' } } ]
      // ]--GENERATED

      @ObjectModel.foreignKey.association: '_SoldToParty'
      kunag                                              as SoldToParty,

      vbund                                              as PartnerCompany,
      bstnk_vf                                           as PurchaseOrderByCustomer,

      @ObjectModel.foreignKey.association: '_CustomerGroup'
      kdgrp                                              as CustomerGroup,

      @ObjectModel.foreignKey.association: '_Country'
      land1                                              as Country,

      @ObjectModel.foreignKey.association: '_CityCode'
      cityc                                              as CityCode,

      @ObjectModel.foreignKey.association: '_SalesDistrict'
      bzirk                                              as SalesDistrict,

      @ObjectModel.foreignKey.association: '_Region'
      regio                                              as Region,

      @ObjectModel.foreignKey.association: '_County_2'
      counc                                              as County,

      // --[ GENERATED:012:GlBfhyFV7jY4{YyEh3zJr0

      @Consumption.valueHelpDefinition: [ { entity: { name: 'I_CreditControlAreaStdVH', element: 'CreditControlArea' } } ]
      @ObjectModel.foreignKey.association: '_CreditControlArea'
      @ObjectModel.text.association: '_CreditControlAreaText'
      // ]--GENERATED

      kkber                                              as CreditControlArea,

      knuma                                              as CustomerRebateAgreement,
      knumv                                              as PricingDocument,

      // status

      @ObjectModel.foreignKey.association: '_OverallSDProcessStatus'
      gbstk                                              as OverallSDProcessStatus,

      @ObjectModel.foreignKey.association: '_OverallBillingStatus'
      vf_status                                          as OverallBillingStatus,

      @ObjectModel.foreignKey.association: '_AccountingPostingStatus'
      buchk                                              as AccountingPostingStatus,

      @ObjectModel.foreignKey.association: '_AccountingTransferStatus'
      rfbsk                                              as AccountingTransferStatus,

      @ObjectModel.foreignKey.association: '_BillingIssueType'
      vf_todo                                            as BillingIssueType,

      @ObjectModel.foreignKey.association: '_OvrlBillingDocReqStatus'
      bdr_status                                         as OverallBillingDocReqStatus,

      @ObjectModel.foreignKey.association: '_InvoiceListStatus'
      relik                                              as InvoiceListStatus,

      @ObjectModel.foreignKey.association: '_OvrlItmGeneralIncompletionSts'
      uvals                                              as OvrlItmGeneralIncompletionSts,

      @ObjectModel.foreignKey.association: '_OverallPricingIncompletionSts'
      uvprs                                              as OverallPricingIncompletionSts,

      // foreign key association has to be defined (in next release (?)), target: I_OvrlDocBillingStatus

      fksak                                              as OverallDocumentBillingStatus,

      @ObjectModel.foreignKey.association: '_PrelimBillingDocumentStatus'
      pbd_status                                         as PrelimBillingDocumentStatus,

      @ObjectModel.foreignKey.association: '_InvoiceClearingStatus'
      clrst                                              as InvoiceClearingStatus,

      // approval

      @ObjectModel.foreignKey.association: '_BillgProcDocApprovalStatus'
      @ObjectModel.text.association: '_BillgProcDocApprovalStatusT'
      vbrk.apm_approval_status                           as BillgProcDocApprovalStatus,

      @ObjectModel.foreignKey.association: '_BillgProcDocApprovalReason'
      @ObjectModel.text.association: '_BillgProcDocApprovalReasonT'
      apm_approval_reason                                as BillgProcDocApprovalReason,

      // association

      @ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
      _ItemBasic,

      @ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
      _PartnerBasic,

      @ObjectModel.association.type: [ #TO_COMPOSITION_CHILD ]
      _PricingElementBasic,

      _SDDocumentCategory,
      _BillgDocReqRefSDDocCategory,
      _BillingDocumentCategory,
      _BillingDocumentType,
      _ProposedBillingDocumentType,

      _CreatedByUser,
      _LogicalSystem,
      _SalesOrganization,
      _DistributionChannel,
      _Division,
      _CancelledBillingDocumentBasic,
      _TransactionCurrency,
      _StatisticsCurrency,
      _CustomerPriceGroup,
      _PriceListType,
      _TaxDepartureCountry,
      _VATRegistrationOrigin,
      _VATRegistrationCountry,
      _SDPricingProcedure,
      _ShippingCondition,
      _IncotermsClassification,
      _IncotermsVersion,
      _PayerParty,
      _CustomerPaymentTerms,
      _PaymentMethod,
      _CompanyCode,
      _FiscalYear,
      _AccountingDocument,
      // _FiscalPeriod,

      _CustomerAccountAssgmtGroup,
      _ExchangeRateType,
      _ReversalReason,
      _DunningArea,

      _DunningBlockingReason,
      _DunningKey,
      _InvoiceListType,
      _SoldToParty,
      _CustomerGroup,
      _Country,
      _CityCode,
      _SalesDistrict,
      _Region,

      @API.element: { releaseState: #DEPRECATED, successor: '_County_2' }
      _County,

      _County_2,
      _CreditControlArea,

      _OverallSDProcessStatus,
      _OverallBillingStatus,
      _OvrlBillingDocReqStatus,
      _PrelimBillingDocumentStatus,
      _AccountingPostingStatus,
      _AccountingTransferStatus,
      _BillingIssueType,
      _InvoiceListStatus,
      _OvrlItmGeneralIncompletionSts,
      _OverallPricingIncompletionSts,

      _BillgProcDocApprovalReason,
      _BillgProcDocApprovalStatus,
      _BillgProcDocApprovalStatusT,
      _BillgProcDocApprovalReasonT,

      _InvoiceClearingStatus,

      @Consumption.hidden: true
      _DunningAreaText,

      @Consumption.hidden: true
      _CreditControlAreaText
}