@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label : 'Prima nota entries without header to item EBDP posting'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
@VDM.private:true
@VDM.viewType: #COMPOSITE
define view entity P_PrimaNotaWithoutOitEBDP
with parameters
P_FiscalPeriodStartDate : budat,
P_FiscalPeriodEndDate : budat
as select from I_GLAccountLineItemRawData as prima_nota
// inner join I_Ledger as ledger on ledger.Ledger = prima_nota.SourceLedger
// and ledger.LedgerType = '' //standard ledger only
left outer to one join I_GLAccountLineItemRawData as posted_ebdp on prima_nota.ControllingObject = posted_ebdp.ControllingObject
and prima_nota.SourceLedger = posted_ebdp.SourceLedger
and prima_nota.CompanyCode = posted_ebdp.CompanyCode
and prima_nota.ReferenceDocumentType = posted_ebdp.ReferenceDocumentType
and prima_nota.ReferenceDocumentContext = posted_ebdp.ReferenceDocumentContext
and prima_nota.ReferenceDocument = posted_ebdp.ReferenceDocument
and prima_nota.OrderID = posted_ebdp.OrderID
and posted_ebdp.BusinessTransactionCategory = 'EBDP'
and posted_ebdp.AccountAssignmentType = 'OR '
and posted_ebdp.PartnerAccountAssignmentType = 'OP'
and posted_ebdp.OriginCtrlgDebitCreditCode = 'A'
and posted_ebdp.PostingDate <= $parameters .P_FiscalPeriodEndDate
left outer to one join R_EvtBsdProdCostgSettlmtRef as refrence_table on prima_nota.ControllingObject = refrence_table.ControllingObject
and prima_nota.OrderID = refrence_table.OrderID
and prima_nota.SourceLedger = refrence_table.Ledger
and prima_nota.ReferenceDocumentType = refrence_table.ReferenceDocumentType
and prima_nota.ReferenceDocumentContext = refrence_table.ReferenceDocumentContext
and prima_nota.ReferenceDocument = refrence_table.ReferenceDocument
and refrence_table.BusinessTransactionCategory = 'EBDP'
and refrence_table.PostingDate <= $parameters .P_FiscalPeriodEndDate
{
key prima_nota.CompanyCode,
key prima_nota.SourceLedger as Ledger,
key prima_nota.AccountingDocument,
key prima_nota.LedgerGLLineItem,
key prima_nota.FiscalYear,
prima_nota.ControllingObject,
prima_nota.ReferenceDocumentType,
prima_nota.ReferenceDocumentContext,
prima_nota.ReferenceDocument,
prima_nota.OrderID,
prima_nota.OrderItem,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
prima_nota.AmountInCompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
prima_nota.AmountInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
prima_nota.AmountInFreeDefinedCurrency1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
prima_nota.AmountInFreeDefinedCurrency2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
prima_nota.AmountInFreeDefinedCurrency3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
prima_nota.AmountInFreeDefinedCurrency4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
prima_nota.AmountInFreeDefinedCurrency5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
prima_nota.AmountInFreeDefinedCurrency6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
prima_nota.AmountInFreeDefinedCurrency7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
prima_nota.AmountInFreeDefinedCurrency8,
prima_nota.CompanyCodeCurrency,
prima_nota.GlobalCurrency,
prima_nota.FreeDefinedCurrency1,
prima_nota.FreeDefinedCurrency2,
prima_nota.FreeDefinedCurrency3,
prima_nota.FreeDefinedCurrency4,
prima_nota.FreeDefinedCurrency5,
prima_nota.FreeDefinedCurrency6,
prima_nota.FreeDefinedCurrency7,
prima_nota.FreeDefinedCurrency8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInCompanyCodeCurrency
end as PeriodAmountInCompanyCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInGlobalCurrency
end as PeriodAmountInGlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInFreeDefinedCurrency1
end as PeriodAmountInFreeDfndCrcy1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInFreeDefinedCurrency2
end as PeriodAmountInFreeDfndCrcy2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInFreeDefinedCurrency3
end as PeriodAmountInFreeDfndCrcy3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInFreeDefinedCurrency4
end as PeriodAmountInFreeDfndCrcy4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInFreeDefinedCurrency5
end as PeriodAmountInFreeDfndCrcy5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInFreeDefinedCurrency6
end as PeriodAmountInFreeDfndCrcy6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInFreeDefinedCurrency7
end as PeriodAmountInFreeDfndCrcy7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
case
when (prima_nota.PostingDate >= $parameters .P_FiscalPeriodStartDate and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate) then
prima_nota.AmountInFreeDefinedCurrency8
end as PeriodAmountInFreeDfndCrcy8
}
where
prima_nota.AccountAssignmentType = 'OR '
and (
prima_nota.OrderCategory = '10'
or prima_nota.OrderCategory = '40'
)
and prima_nota.BusinessTransactionCategory <> 'TBCS' //ignore TBCS posting
and prima_nota.BusinessTransactionCategory <> 'EBWP' //ignore Event-Based WIP posting
and prima_nota.BusinessTransactionCategory <> 'EBDP'
and prima_nota.OriginCtrlgDebitCreditCode <> 'A' //To be posted amount in Inspector should not consider the settlement data of open order
and prima_nota.PostingDate <= $parameters .P_FiscalPeriodEndDate
and posted_ebdp.ReferenceDocument is null
and refrence_table.ReferenceDocument is null
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_GLACCOUNTLINEITEMRAWDATA",
"R_EVTBSDPRODCOSTGSETTLMTREF"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_PrimaNotaWithoutOitEBDP view_entity