P_InitialOpenItem
Initial Open Item
P_InitialOpenItem is a Consumption CDS View that provides data about "Initial Open Item" in SAP S/4HANA. It reads from 2 data sources (I_AccountingDocument, I_OperationalAcctgDocItem) and exposes 33 fields with key fields CompanyCode, FiscalYear, AccountingDocument, AccountingDocumentItem. Part of development package ODATA_RESIDUAL_ITEMS.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_AccountingDocument | OpenInvoiceHeader | inner |
| I_OperationalAcctgDocItem | OpenInvoiceItem | from |
Annotations (11)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PAGROII3 | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #MANDATORY | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.representativeKey | AccountingDocumentItem | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.serviceQuality | #D | view | |
| VDM.viewType | #CONSUMPTION | view | |
| VDM.private | true | view |
Fields (33)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | CompanyCode | I_OperationalAcctgDocItem | CompanyCode | |
| KEY | FiscalYear | I_OperationalAcctgDocItem | FiscalYear | |
| KEY | AccountingDocument | I_OperationalAcctgDocItem | AccountingDocument | |
| KEY | AccountingDocumentItem | I_OperationalAcctgDocItem | AccountingDocumentItem | |
| DebitCreditCode | I_OperationalAcctgDocItem | DebitCreditCode | ||
| CompanyCodeCurrency | I_OperationalAcctgDocItem | CompanyCodeCurrency | ||
| AmountInCompanyCodeCurrency | I_OperationalAcctgDocItem | AmountInCompanyCodeCurrency | ||
| TransactionCurrency | I_OperationalAcctgDocItem | TransactionCurrency | ||
| AmountInTransactionCurrency | I_OperationalAcctgDocItem | AmountInTransactionCurrency | ||
| Customer | I_OperationalAcctgDocItem | Customer | ||
| BillingDocument | I_OperationalAcctgDocItem | BillingDocument | ||
| AssignmentReference | I_OperationalAcctgDocItem | AssignmentReference | ||
| AccountingDocumentType | I_AccountingDocument | AccountingDocumentType | ||
| AccountingDocumentHeaderText | I_AccountingDocument | AccountingDocumentHeaderText | ||
| DocumentItemText | I_OperationalAcctgDocItem | DocumentItemText | ||
| PaymentDifferenceReason | I_OperationalAcctgDocItem | PaymentDifferenceReason | ||
| CreationDate | I_AccountingDocument | AccountingDocumentCreationDate | ||
| CreationTime | I_AccountingDocument | CreationTime | ||
| LastChangeDate | I_AccountingDocument | LastChangeDate | ||
| PostingDate | I_OperationalAcctgDocItem | PostingDate | ||
| DocumentDate | I_OperationalAcctgDocItem | DocumentDate | ||
| NetDueDate | I_OperationalAcctgDocItem | NetDueDate | ||
| CashDiscountBaseAmount | I_OperationalAcctgDocItem | CashDiscountBaseAmount | ||
| CashDiscountAmount | I_OperationalAcctgDocItem | CashDiscountAmount | ||
| PaymentTerms | I_OperationalAcctgDocItem | PaymentTerms | ||
| CashDiscount1Days | I_OperationalAcctgDocItem | CashDiscount1Days | ||
| CashDiscount2Days | I_OperationalAcctgDocItem | CashDiscount2Days | ||
| NetPaymentDays | I_OperationalAcctgDocItem | NetPaymentDays | ||
| CashDiscount1Percent | I_OperationalAcctgDocItem | CashDiscount1Percent | ||
| CashDiscount2Percent | I_OperationalAcctgDocItem | CashDiscount2Percent | ||
| DueCalculationBaseDate | I_OperationalAcctgDocItem | DueCalculationBaseDate | ||
| FixedCashDiscount | I_OperationalAcctgDocItem | FixedCashDiscount | ||
| PaymentBlockingReason | I_OperationalAcctgDocItem | PaymentBlockingReason |
@AbapCatalog.sqlViewName: 'PAGROII3'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #MANDATORY
//@EndUserText.label: 'Initial Open Item'
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.representativeKey: 'AccountingDocumentItem'
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@VDM.viewType: #CONSUMPTION
//@UI.presentationVariant.sortOrder.by: 'CreationDate, CreationTime'
//@UI.presentationVariant.sortOrder.direction: #ASC
@VDM.private: true
define view P_InitialOpenItem
as select from I_OperationalAcctgDocItem as OpenInvoiceItem
inner join I_AccountingDocument as OpenInvoiceHeader on
OpenInvoiceItem.CompanyCode = OpenInvoiceHeader.CompanyCode and
OpenInvoiceItem.AccountingDocument = OpenInvoiceHeader.AccountingDocument and
OpenInvoiceItem.FiscalYear = OpenInvoiceHeader.FiscalYear and
// We are not interested in residual items. They are already taken care by other extractors
// We are currently also not interested in partial payment items, credit memo items and down payment items.
(
OpenInvoiceItem.FollowOnDocumentType is null or
OpenInvoiceItem.FollowOnDocumentType = ''
)
and
// We are only interested in open items (i.e. no clearing happened yet)
(
OpenInvoiceItem.ClearingAccountingDocument is null or
OpenInvoiceItem.ClearingAccountingDocument = ''
)
// We are only intereseted in items of catagory '', 'S', or 'A'
and
(
OpenInvoiceItem.AccountingDocumentCategory = '' or
OpenInvoiceItem.AccountingDocumentCategory = 'S' or
OpenInvoiceItem.AccountingDocumentCategory = 'A'
)
// We are only interested in A/R items
and
OpenInvoiceItem.FinancialAccountType = 'D'
{
key OpenInvoiceItem.CompanyCode,
key OpenInvoiceItem.FiscalYear,
key OpenInvoiceItem.AccountingDocument,
key OpenInvoiceItem.AccountingDocumentItem,
OpenInvoiceItem.DebitCreditCode,
OpenInvoiceItem.CompanyCodeCurrency,
OpenInvoiceItem.AmountInCompanyCodeCurrency,
OpenInvoiceItem.TransactionCurrency,
OpenInvoiceItem.AmountInTransactionCurrency,
OpenInvoiceItem.Customer,
OpenInvoiceItem.BillingDocument,
OpenInvoiceItem.AssignmentReference,
OpenInvoiceHeader.AccountingDocumentType,
OpenInvoiceHeader.AccountingDocumentHeaderText, // as HeaderText,
OpenInvoiceItem.DocumentItemText,// as ItemtText,
OpenInvoiceItem.PaymentDifferenceReason,
OpenInvoiceHeader.AccountingDocumentCreationDate as CreationDate,
OpenInvoiceHeader.CreationTime as CreationTime,
OpenInvoiceHeader.LastChangeDate,
OpenInvoiceItem.PostingDate,
OpenInvoiceItem.DocumentDate,
OpenInvoiceItem.NetDueDate,
@Semantics.amount.currencyCode: 'TransactionCurrency'
OpenInvoiceItem.CashDiscountBaseAmount,
@Semantics.amount.currencyCode: 'TransactionCurrency'
OpenInvoiceItem.CashDiscountAmount,
OpenInvoiceItem.PaymentTerms,
OpenInvoiceItem.CashDiscount1Days,
OpenInvoiceItem.CashDiscount2Days,
OpenInvoiceItem.NetPaymentDays,
OpenInvoiceItem.CashDiscount1Percent,
OpenInvoiceItem.CashDiscount2Percent,
OpenInvoiceItem.DueCalculationBaseDate,
OpenInvoiceItem.FixedCashDiscount,
OpenInvoiceItem.PaymentBlockingReason
}
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