A_BillingDocument
Billing Document Header
A_BillingDocument is a Composite CDS View that provides data about "Billing Document Header" in SAP S/4HANA. It reads from 1 data source (I_BillingDocument) and exposes 100 fields with key field BillingDocument. It has 5 associations to related views.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_BillingDocument | I_BillingDocument | from |
Associations (5)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..*] | A_BillingDocumentItem | _Item | $projection.BillingDocument = _Item.BillingDocument |
| [0..*] | A_BillingDocumentPartner | _Partner | $projection.BillingDocument = _Partner.BillingDocument |
| [0..*] | A_BillingDocumentPrcgElmnt | _PricingElement | $projection.BillingDocument = _PricingElement.BillingDocument |
| [0..*] | A_BillingDocumentText | _Text | $projection.BillingDocument = _Text.BillingDocument |
| [0..1] | E_BillingDocument | _Extension | $projection.BillingDocument = _Extension.BillingDocument |
Annotations (16)
| Name | Value | Level | Field |
|---|---|---|---|
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| EndUserText.label | Billing Document Header | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.lifecycle.contract.type | #PUBLIC_REMOTE_API | view | |
| AbapCatalog.sqlViewName | ASDBILLINGDOC | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #CHECK | view | |
| ObjectModel.representativeKey | BillingDocument | view | |
| ObjectModel.createEnabled | false | view | |
| ObjectModel.updateEnabled | false | view | |
| ObjectModel.deleteEnabled | false | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ObjectModel.usageType.serviceQuality | #A | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| Metadata.ignorePropagatedAnnotations | true | view |
Fields (100)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | BillingDocument | BillingDocument | ||
| SDDocumentCategory | SDDocumentCategory | |||
| BillingDocumentCategory | BillingDocumentCategory | |||
| BillingDocumentType | BillingDocumentType | |||
| CreationDate | CreationDate | |||
| CreationTime | CreationTime | |||
| LastChangeDate | LastChangeDate | |||
| LogicalSystem | LogicalSystem | |||
| SalesOrganization | SalesOrganization | |||
| DistributionChannel | DistributionChannel | |||
| Division | Division | |||
| BillingDocumentDate | BillingDocumentDate | |||
| BillingDocumentIsCancelled | BillingDocumentIsCancelled | |||
| CancelledBillingDocument | CancelledBillingDocument | |||
| ForeignTrade | ||||
| IsExportDelivery | ||||
| BillingDocCombinationCriteria | BillingDocCombinationCriteria | |||
| ManualInvoiceMaintIsRelevant | ManualInvoiceMaintIsRelevant | |||
| IsIntrastatReportingRelevant | IsIntrastatReportingRelevant | |||
| IsIntrastatReportingExcluded | IsIntrastatReportingExcluded | |||
| TotalNetAmount | TotalNetAmount | |||
| TransactionCurrency | TransactionCurrency | |||
| StatisticsCurrency | StatisticsCurrency | |||
| TaxAmount | TotalTaxAmount | |||
| TotalGrossAmount | ||||
| CustomerPriceGroup | CustomerPriceGroup | |||
| PriceListType | PriceListType | |||
| TaxDepartureCountry | TaxDepartureCountry | |||
| VATRegistration | VATRegistration | |||
| VATRegistrationOrigin | VATRegistrationOrigin | |||
| VATRegistrationCountry | VATRegistrationCountry | |||
| HierarchyTypePricing | HierarchyTypePricing | |||
| CustomerTaxClassification1 | CustomerTaxClassification1 | |||
| CustomerTaxClassification2 | CustomerTaxClassification2 | |||
| CustomerTaxClassification3 | CustomerTaxClassification3 | |||
| CustomerTaxClassification4 | CustomerTaxClassification4 | |||
| CustomerTaxClassification5 | CustomerTaxClassification5 | |||
| CustomerTaxClassification6 | CustomerTaxClassification6 | |||
| CustomerTaxClassification7 | CustomerTaxClassification7 | |||
| CustomerTaxClassification8 | CustomerTaxClassification8 | |||
| CustomerTaxClassification9 | CustomerTaxClassification9 | |||
| IsEUTriangularDeal | IsEUTriangularDeal | |||
| SDPricingProcedure | SDPricingProcedure | |||
| ShippingCondition | ShippingCondition | |||
| IncotermsVersion | IncotermsVersion | |||
| IncotermsClassification | IncotermsClassification | |||
| IncotermsTransferLocation | IncotermsTransferLocation | |||
| IncotermsLocation1 | IncotermsLocation1 | |||
| IncotermsLocation2 | IncotermsLocation2 | |||
| PayerParty | PayerParty | |||
| ContractAccount | ContractAccount | |||
| CustomerPaymentTerms | CustomerPaymentTerms | |||
| PaymentMethod | PaymentMethod | |||
| PaymentReference | PaymentReference | |||
| FixedValueDate | FixedValueDate | |||
| AdditionalValueDays | AdditionalValueDays | |||
| SEPAMandate | SEPAMandate | |||
| CompanyCode | CompanyCode | |||
| FiscalYear | FiscalYear | |||
| AccountingDocument | AccountingDocument | |||
| CustomerAccountAssignmentGroup | CustomerAccountAssignmentGroup | |||
| AccountingExchangeRateIsSet | AccountingExchangeRateIsSet | |||
| AbsltAccountingExchangeRate | ||||
| AcctgExchangeRateIsIndrctQtan | ||||
| ExchangeRateDate | ExchangeRateDate | |||
| ExchangeRateType | ExchangeRateType | |||
| DocumentReferenceID | DocumentReferenceID | |||
| AssignmentReference | AssignmentReference | |||
| DunningArea | DunningArea | |||
| DunningBlockingReason | DunningBlockingReason | |||
| DunningKey | DunningKey | |||
| InternalFinancialDocument | InternalFinancialDocument | |||
| IsRelevantForAccrual | IsRelevantForAccrual | |||
| SoldToParty | SoldToParty | |||
| PartnerCompany | PartnerCompany | |||
| PurchaseOrderByCustomer | PurchaseOrderByCustomer | |||
| CustomerGroup | CustomerGroup | |||
| Country | Country | |||
| CityCode | CityCode | |||
| SalesDistrict | SalesDistrict | |||
| Region | Region | |||
| County | County | |||
| CreditControlArea | CreditControlArea | |||
| CustomerRebateAgreement | CustomerRebateAgreement | |||
| SalesDocumentCondition | PricingDocument | |||
| OverallSDProcessStatus | OverallSDProcessStatus | |||
| OverallBillingStatus | OverallBillingStatus | |||
| AccountingPostingStatus | AccountingPostingStatus | |||
| AccountingTransferStatus | AccountingTransferStatus | |||
| BillingIssueType | BillingIssueType | |||
| InvoiceListStatus | InvoiceListStatus | |||
| OvrlItmGeneralIncompletionSts | OvrlItmGeneralIncompletionSts | |||
| OverallPricingIncompletionSts | OverallPricingIncompletionSts | |||
| InvoiceClearingStatus | InvoiceClearingStatus | |||
| BillingDocumentListType | InvoiceListType | |||
| BillingDocumentListDate | InvoiceListBillingDate | |||
| _Item | _Item | |||
| _Partner | _Partner | |||
| _PricingElement | _PricingElement | |||
| _Text | _Text |
@ClientHandling.algorithm:#SESSION_VARIABLE
@EndUserText.label: 'Billing Document Header'
@VDM: {
viewType: #COMPOSITE,
lifecycle.contract.type: #PUBLIC_REMOTE_API
}
@AbapCatalog: {
sqlViewName: 'ASDBILLINGDOC',
compiler.compareFilter: true,
preserveKey: true
}
@AccessControl: {
authorizationCheck: #CHECK,
personalData.blocking: #('TRANSACTIONAL_DATA')
}
@ObjectModel: {
representativeKey: 'BillingDocument',
createEnabled: false,
updateEnabled: false,
deleteEnabled: false,
usageType: {
dataClass: #TRANSACTIONAL,
serviceQuality: #A,
sizeCategory: #XL
}
}
@Metadata: {
ignorePropagatedAnnotations: true
}
define view A_BillingDocument
as select from I_BillingDocument
association [0..*] to A_BillingDocumentItem as _Item on $projection.BillingDocument = _Item.BillingDocument
association [0..*] to A_BillingDocumentPartner as _Partner on $projection.BillingDocument = _Partner.BillingDocument
association [0..*] to A_BillingDocumentPrcgElmnt as _PricingElement on $projection.BillingDocument = _PricingElement.BillingDocument
association [0..*] to A_BillingDocumentText as _Text on $projection.BillingDocument = _Text.BillingDocument
//Extensibility
association [0..1] to E_BillingDocument as _Extension on $projection.BillingDocument = _Extension.BillingDocument
{
//key
key BillingDocument,
//category
@ObjectModel.sapObjectNodeTypeReference: 'SDDocumentCategory'
SDDocumentCategory,
@ObjectModel.sapObjectNodeTypeReference: 'BillingDocumentCategory'
BillingDocumentCategory,
@ObjectModel.sapObjectNodeTypeReference: 'BillingDocumentType'
BillingDocumentType,
//admin
CreationDate,
CreationTime,
LastChangeDate,
case tstmp_is_valid(LastChangeDateTime)
when 0 then cast( dats_tims_to_tstmp( CreationDate, CreationTime, 'UTC', $session.client, 'NULL' ) as timestampl )
else LastChangeDateTime
end as LastChangeDateTime,
LogicalSystem,
//org
SalesOrganization,
DistributionChannel,
@ObjectModel.sapObjectNodeTypeReference: 'Division'
Division,
//billing
BillingDocumentDate,
BillingDocumentIsCancelled,
CancelledBillingDocument,
cast('' as exnum) as ForeignTrade,
cast('' as expkz) as IsExportDelivery,
BillingDocCombinationCriteria,
ManualInvoiceMaintIsRelevant,
//NmbrOfPages,
IsIntrastatReportingRelevant,
IsIntrastatReportingExcluded,
//pricing
@Semantics.amount.currencyCode: 'TransactionCurrency'
TotalNetAmount,
@Semantics.currencyCode: true
@ObjectModel.sapObjectNodeTypeReference: 'Currency'
TransactionCurrency,
@Semantics.currencyCode: true
@ObjectModel.sapObjectNodeTypeReference: 'Currency'
StatisticsCurrency,
@Semantics.amount.currencyCode: 'TransactionCurrency'
TotalTaxAmount as TaxAmount,
@Semantics.amount.currencyCode: 'TransactionCurrency'
(TotalTaxAmount + TotalNetAmount) as TotalGrossAmount,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerPriceGroup'
CustomerPriceGroup,
PriceListType,
TaxDepartureCountry,
VATRegistration,
@ObjectModel.sapObjectNodeTypeReference: 'VATRegistrationOrigin'
VATRegistrationOrigin,
VATRegistrationCountry,
HierarchyTypePricing,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification1,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification2,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification3,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification4,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification5,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification6,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification7,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification8,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerTaxClassification'
CustomerTaxClassification9,
IsEUTriangularDeal,
SDPricingProcedure,
//shipping
ShippingCondition,
@ObjectModel.sapObjectNodeTypeReference: 'IncotermsVersion'
IncotermsVersion,
@ObjectModel.sapObjectNodeTypeReference: 'IncotermsClassification'
IncotermsClassification,
IncotermsTransferLocation,
IncotermsLocation1,
IncotermsLocation2,
//payment
PayerParty,
ContractAccount,
CustomerPaymentTerms,
@ObjectModel.sapObjectNodeTypeReference: 'PaymentMethod'
PaymentMethod,
PaymentReference,
FixedValueDate,
AdditionalValueDays,
SEPAMandate,
//accounting
CompanyCode,
FiscalYear,
AccountingDocument,
//FiscalPeriod, - do not include this field
@ObjectModel.sapObjectNodeTypeReference: 'CustomerAccountAssignmentGroup'
CustomerAccountAssignmentGroup,
AccountingExchangeRateIsSet,
cast(abs( AccountingExchangeRate ) as kurrf_abs) as AbsltAccountingExchangeRate,
cast(case when AccountingExchangeRate < 0 then 'X' else ' ' end as kurrf_quotatn_is_indirect) as AcctgExchangeRateIsIndrctQtan,
ExchangeRateDate,
@ObjectModel.sapObjectNodeTypeReference: 'ExchangeRateType'
ExchangeRateType,
DocumentReferenceID,
AssignmentReference,
DunningArea,
@ObjectModel.sapObjectNodeTypeReference: 'DunningBlockingReason'
DunningBlockingReason,
@ObjectModel.sapObjectNodeTypeReference: 'DunningKey'
DunningKey,
InternalFinancialDocument,
IsRelevantForAccrual,
//sales
SoldToParty,
PartnerCompany,
PurchaseOrderByCustomer,
@ObjectModel.sapObjectNodeTypeReference: 'CustomerGroup'
CustomerGroup,
@ObjectModel.sapObjectNodeTypeReference: 'Country'
Country,
CityCode,
SalesDistrict,
@ObjectModel.sapObjectNodeTypeReference: 'Region'
Region,
County,
CreditControlArea,
CustomerRebateAgreement,
PricingDocument as SalesDocumentCondition,
//status
@ObjectModel.sapObjectNodeTypeReference: 'OverallSDProcessStatus'
OverallSDProcessStatus,
@ObjectModel.sapObjectNodeTypeReference: 'OverallBillingDocumentStatus'
OverallBillingStatus,
@ObjectModel.sapObjectNodeTypeReference: 'BillingDocAcctgPostingStatus'
AccountingPostingStatus,
@ObjectModel.sapObjectNodeTypeReference: 'BillingDocAcctgTransferStatus'
AccountingTransferStatus,
@ObjectModel.sapObjectNodeTypeReference: 'BillingIssueType'
BillingIssueType,
@ObjectModel.sapObjectNodeTypeReference: 'InvoiceListStatus'
InvoiceListStatus,
OvrlItmGeneralIncompletionSts,
@ObjectModel.sapObjectNodeTypeReference: 'OverallSDDocPrcgIncompltnSts'
OverallPricingIncompletionSts,
//OverallOrdReltdBillgStatus //only relevant for BDRs
InvoiceClearingStatus,
//billing document list
@ObjectModel.sapObjectNodeTypeReference: 'InvoiceListType'
InvoiceListType as BillingDocumentListType,
InvoiceListBillingDate as BillingDocumentListDate,
//associations
@ObjectModel.readOnly: true
_Item,
@ObjectModel.readOnly: true
_Partner,
@ObjectModel.readOnly: true
_PricingElement,
@ObjectModel.readOnly: true
_Text
}
where
//SDDocumentCategory <> 'EBDR' and SDDocumentCategory <> '3' and SDDocumentCategory <> '4' and //done in I_BillingDocument already
BillingDocumentIsTemporary = ' '
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCUMENT"
],
"ASSOCIATED":
[
"A_BILLINGDOCUMENTITEM",
"A_BILLINGDOCUMENTPARTNER",
"A_BILLINGDOCUMENTPRCGELMNT",
"A_BILLINGDOCUMENTTEXT",
"E_BILLINGDOCUMENT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA