P_StRpBillingDocumentItem
P_StRpBillingDocumentItem is a Composite CDS View in SAP S/4HANA. It reads from 6 data sources and exposes 29 fields with key fields BillingDocument, BillingDocumentItem. It has 1 association to related views.
Data Sources (6)
| Source | Alias | Join Type |
|---|---|---|
| I_BillingDocument | _BillingDocument | from |
| I_SDDocumentCompletePartners | _partnerFunction | left_outer |
| I_BillingDocumentItem | I_BillingDocumentItem | inner |
| I_PricingElement | I_PricingElement | inner |
| I_JournalEntry | JE | inner |
| I_Customer | ShipToParty | left_outer |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..*] | I_MaterialText | _MaterialText | _MaterialText.Material = $projection.material |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PSRBILLDOCITM | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.viewType | #COMPOSITE | view | |
| VDM.private | true | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| ObjectModel.usageType.sizeCategory | #XL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (29)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | BillingDocument | _Item | BillingDocument | |
| KEY | BillingDocumentItem | _Item | BillingDocumentItem | |
| BillingDocumentDate | I_BillingDocument | BillingDocumentDate | ||
| AccountingTransferStatus | I_BillingDocument | AccountingTransferStatus | ||
| SalesDocumentCondition | I_BillingDocument | PricingDocument | ||
| CustomerCountry | I_BillingDocument | Country | ||
| CustomerName | ||||
| VATRegistration | ||||
| TaxNumber1 | ||||
| OrganizationBPName4 | ||||
| AuthorizationGroup | ||||
| ShipToPartyCountry | I_Customer | Country | ||
| Material | _Item | Material | ||
| BillingDocumentItemText | _Item | BillingDocumentItemText | ||
| CompanyCode | I_JournalEntry | CompanyCode | ||
| AccountingDocument | I_JournalEntry | AccountingDocument | ||
| FiscalYear | I_JournalEntry | FiscalYear | ||
| TaxReportingDate | I_JournalEntry | TaxReportingDate | ||
| DocumentDate | I_JournalEntry | DocumentDate | ||
| PostingDate | I_JournalEntry | PostingDate | ||
| ReferenceDocumentType | I_JournalEntry | ReferenceDocumentType | ||
| CompanyCodeCurrency | ||||
| TransactionCurrency | _Item | TransactionCurrency | ||
| NetAmount | _Item | NetAmount | ||
| TaxAmount | _Item | TaxAmount | ||
| SystemClient | ||||
| SystemDate | ||||
| _MaterialText | _MaterialText | |||
| TaxCode | I_PricingElement | TaxCode |
@AbapCatalog.sqlViewName: 'PSRBILLDOCITM'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
define view P_StRpBillingDocumentItem
as select from I_BillingDocument as _BillingDocument
inner join I_JournalEntry as JE on JE.OriginalReferenceDocument = _BillingDocument.BillingDocument
inner join I_BillingDocumentItem on _BillingDocument.BillingDocument = I_BillingDocumentItem.BillingDocument
inner join I_PricingElement on I_PricingElement.PricingDocument = _BillingDocument.PricingDocument
and I_PricingElement.PricingDocumentItem = I_BillingDocumentItem.BillingDocumentItem
and I_PricingElement.ConditionCategory = 'D'
and I_PricingElement.ConditionInactiveReason = ''
and I_PricingElement.ConditionIsForStatistics = ''
and I_PricingElement.TaxCode <> ''
left outer join I_SDDocumentCompletePartners as _partnerFunction on _partnerFunction.SDDocument = _BillingDocument.BillingDocument
and _partnerFunction.PartnerFunction = 'WE'
left outer join I_Customer as ShipToParty on ShipToParty.Customer = _partnerFunction.Customer
association [0..*] to I_MaterialText as _MaterialText on _MaterialText.Material = $projection.material
{
key _Item.BillingDocument,
key _Item.BillingDocumentItem,
_BillingDocument.BillingDocumentDate,
_BillingDocument.AccountingTransferStatus,
_BillingDocument.PricingDocument as SalesDocumentCondition,
_BillingDocument.Country as CustomerCountry,
_BillingDocument._SoldToParty.CustomerName,
_BillingDocument._SoldToParty.VATRegistration,
_BillingDocument._SoldToParty.TaxNumber1,
_BillingDocument._SoldToParty._CustomerToBusinessPartner._BusinessPartner.OrganizationBPName4,
_BillingDocument._SoldToParty._CustomerToBusinessPartner._BusinessPartner.AuthorizationGroup,
ShipToParty.Country as ShipToPartyCountry,
_Item.Material,
_Item.BillingDocumentItemText,
JE.CompanyCode,
JE.AccountingDocument,
JE.FiscalYear,
JE.TaxReportingDate,
JE.DocumentDate,
JE.PostingDate,
JE.ReferenceDocumentType,
cast (
case dats_is_valid(JE.TaxReportingDate)
when 1 then
JE.TaxReportingDate
else
JE.PostingDate
end
as glo_reporting_date preserving type) as ReportingDate,
@Semantics.currencyCode: true
_BillingDocument._CompanyCode.Currency as CompanyCodeCurrency,
//JE.CompanyCodeCurrency
@Semantics.currencyCode: true
_Item.TransactionCurrency,
@Semantics.amount.currencyCode: 'TransactionCurrency'
_Item.NetAmount as NetAmount,
@Semantics.amount.currencyCode: 'TransactionCurrency'
_Item.TaxAmount,
$session.client as SystemClient,
$session.system_date as SystemDate,
_MaterialText,
I_PricingElement.TaxCode
}
where
( AccountingTransferStatus = 'C'
or AccountingTransferStatus = 'E' )
and JE.BusinessTransactionType = 'SD00'
and JE.AccountingDocumentCategory <> 'V'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCUMENT",
"I_BILLINGDOCUMENTITEM",
"I_BUSINESSPARTNER",
"I_COMPANYCODE",
"I_CUSTOMER",
"I_CUSTOMERTOBUSINESSPARTNER",
"I_JOURNALENTRY",
"I_PRICINGELEMENT",
"I_SDDOCUMENTCOMPLETEPARTNERS"
],
"ASSOCIATED":
[
"I_MATERIALTEXT"
],
"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