P_StRpSalesInvoiceItem

DDL: P_STRPSALESINVOICEITEM SQL: PSALEINVLITEM Type: view CONSUMPTION

Private View for Sales Invoice List

P_StRpSalesInvoiceItem is a Consumption CDS View that provides data about "Private View for Sales Invoice List" in SAP S/4HANA. It reads from 7 data sources and exposes 20 fields with key fields CompanyCode, BillingDocument, BillingDocumentItem, FiscalYear, StatryRptCategory. It has 2 associations to related views.

Data Sources (7)

SourceAliasJoin Type
I_BillingDocumentBasic I_BillingDocumentBasic inner
I_BillingDocumentItemBasic I_BillingDocumentItemBasic from
I_Customer I_Customer inner
I_DeliveryDocument I_DeliveryDocument left_outer
I_DeliveryDocumentItem I_DeliveryDocumentItem left_outer
I_JournalEntry I_JournalEntry inner
P_PlantsAndBranchesItem P_PlantsAndBranchesItem left_outer

Associations (2)

CardinalityTargetAliasCondition
[0..*] I_StRpJournalEntryLog _ReportedItemsLog _ReportedItemsLog.CompanyCode = $projection.CompanyCode and _ReportedItemsLog.AccountingDocument = $projection.AccountingDocument and _ReportedItemsLog.FiscalYear = $projection.FiscalYear
[1..1] I_UnitOfMeasureText _UnitofMeasure _UnitofMeasure.UnitOfMeasure = I_BillingDocumentItemBasic.BillingQuantityUnit and _UnitofMeasure.Language = $session.system_language

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PSALEINVLITEM view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Private View for Sales Invoice List view
VDM.viewType #CONSUMPTION view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.serviceQuality #P view
ObjectModel.usageType.dataClass #MIXED view
AccessControl.personalData.blocking #NOT_REQUIRED view
VDM.private true view
AccessControl.blocking #BLOCKED_DATA_INCLUDED view

Fields (20)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_BillingDocumentBasic CompanyCode
KEY BillingDocument I_BillingDocumentBasic BillingDocument
KEY BillingDocumentItem I_BillingDocumentItemBasic BillingDocumentItem
KEY FiscalYear I_BillingDocumentBasic FiscalYear
KEY StatryRptCategory _ReportedItemsLog StatryRptCategory
KEY StatryRptgEntity _ReportedItemsLog StatryRptgEntity
KEY StatryRptRunID _ReportedItemsLog StatryRptRunID
AccountingDocument I_JournalEntry AccountingDocument
PayerParty I_BillingDocumentBasic PayerParty
DocumentReferenceID I_BillingDocumentBasic DocumentReferenceID
Material I_BillingDocumentItemBasic Material
Plant I_DeliveryDocumentItem Plant
Country P_PlantsAndBranchesItem Country
BillingDocumentDate I_BillingDocumentBasic BillingDocumentDate
MeterReadingSystemDate
BillingQuantityUnit I_BillingDocumentItemBasic BillingQuantityUnit
Quantity I_BillingDocumentItemBasic BillingQuantity
CustomerName I_Customer CustomerName
CustomerCountry I_Customer Country
_UnitofMeasure _UnitofMeasure
@AbapCatalog.sqlViewName: 'PSALEINVLITEM'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Private View for Sales Invoice List'
@VDM.viewType: #CONSUMPTION
//@Analytics.dataCategory: #CUBE

@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.serviceQuality: #P
@ObjectModel.usageType.dataClass: #MIXED
@AccessControl.personalData.blocking: #NOT_REQUIRED
@VDM.private: true
@AccessControl.blocking:#BLOCKED_DATA_INCLUDED

define view P_StRpSalesInvoiceItem


  as select from    I_BillingDocumentItemBasic

    inner join      I_BillingDocumentBasic  on I_BillingDocumentItemBasic.BillingDocument = I_BillingDocumentBasic.BillingDocument

    inner join      I_JournalEntry //on  I_BillingDocumentBasic.CompanyCode     = I_JournalEntry.CompanyCode

                                            on  I_BillingDocumentBasic.BillingDocument = I_JournalEntry.OriginalReferenceDocument
                                   //and I_BillingDocumentBasic.FiscalYear      = I_JournalEntry.FiscalYear

                                            and I_JournalEntry.ReverseDocument         is initial

    left outer join I_DeliveryDocument      on I_BillingDocumentItemBasic.ReferenceSDDocument = I_DeliveryDocument.DeliveryDocument

    left outer join I_DeliveryDocumentItem  on  I_BillingDocumentItemBasic.BillingDocument     = I_DeliveryDocumentItem.DeliveryDocument
                                            and I_BillingDocumentItemBasic.BillingDocumentItem = I_DeliveryDocumentItem.DeliveryDocumentItem

    left outer join P_PlantsAndBranchesItem on I_DeliveryDocumentItem.Plant = P_PlantsAndBranchesItem.Plant

    inner join       I_Customer              on I_BillingDocumentBasic.PayerParty = I_Customer.Customer
    
  association [0..*] to I_StRpJournalEntryLog as _ReportedItemsLog on  _ReportedItemsLog.CompanyCode        = $projection.CompanyCode
                                                                   and _ReportedItemsLog.AccountingDocument = $projection.AccountingDocument
                                                                   and _ReportedItemsLog.FiscalYear         = $projection.FiscalYear
 
  association [1..1] to I_UnitOfMeasureText as _UnitofMeasure on _UnitofMeasure.UnitOfMeasure =   I_BillingDocumentItemBasic.BillingQuantityUnit
                                                              and _UnitofMeasure.Language     = $session.system_language
                                                             



{
        @Consumption.filter : { selectionType : #SINGLE, multipleSelections : true}
  key   I_BillingDocumentBasic.CompanyCode              as CompanyCode,
  key   I_BillingDocumentBasic.BillingDocument          as BillingDocument,
  key   I_BillingDocumentItemBasic.BillingDocumentItem  as BillingDocumentItem,
  key   I_BillingDocumentBasic.FiscalYear               as FiscalYear,
  key   _ReportedItemsLog.StatryRptCategory             as StatryRptCategory,
  key   _ReportedItemsLog.StatryRptgEntity              as StatryRptgEntity,
  key   _ReportedItemsLog.StatryRptRunID                as StatryRptRunID,
        I_JournalEntry.AccountingDocument               as AccountingDocument,
        I_BillingDocumentBasic.PayerParty               as PayerParty,
        I_BillingDocumentBasic.DocumentReferenceID      as DocumentReferenceID,
        I_BillingDocumentItemBasic.Material             as Material,
        I_DeliveryDocumentItem.Plant                    as Plant,
        P_PlantsAndBranchesItem.Country                 as Country,
        I_BillingDocumentBasic.BillingDocumentDate,

        case
        when I_DeliveryDocument.ActualGoodsMovementDate is not initial 
        and   I_DeliveryDocument.ActualGoodsMovementDate <> '00000000'
        and   I_DeliveryDocument.ActualGoodsMovementDate <> ''
        then I_DeliveryDocument.ActualGoodsMovementDate
        else
        case
        when I_DeliveryDocument.PlannedGoodsIssueDate is not initial 
        and   I_DeliveryDocument.PlannedGoodsIssueDate <> '00000000'
        and   I_DeliveryDocument.PlannedGoodsIssueDate <> ''
        then I_DeliveryDocument.PlannedGoodsIssueDate
        else
        case
        when I_DeliveryDocument.DeliveryDate is not initial 
        and   I_DeliveryDocument.DeliveryDate <> '00000000'
        and   I_DeliveryDocument.DeliveryDate <> ''
        then I_DeliveryDocument.DeliveryDate
        else
        '00000000'
        end
        end
        end                                             as ValidityStartDate,
        
        $session.system_date as MeterReadingSystemDate,

        @Semantics.unitOfMeasure: true
        I_BillingDocumentItemBasic.BillingQuantityUnit,

        @DefaultAggregation:#SUM
        @Semantics.quantity.unitOfMeasure: 'BillingQuantityUnit'
        I_BillingDocumentItemBasic.BillingQuantity      as Quantity,
        I_Customer.CustomerName,
        I_Customer.Country                              as CustomerCountry,
        
        _UnitofMeasure


}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCUMENTBASIC",
"I_BILLINGDOCUMENTITEMBASIC",
"I_CUSTOMER",
"I_DELIVERYDOCUMENT",
"I_DELIVERYDOCUMENTITEM",
"I_JOURNALENTRY",
"I_STRPJOURNALENTRYLOG",
"P_PLANTSANDBRANCHESITEM"
],
"ASSOCIATED":
[
"I_STRPJOURNALENTRYLOG",
"I_UNITOFMEASURETEXT"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/