@AbapCatalog.sqlViewName : 'PCOSTACCTDOC'
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #NOT_REQUIRED
//@EndUserText.label : 'Cost Accounting Document'
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType:{
serviceQuality: #C,
sizeCategory: #XXL,
dataClass: #MIXED
}
@VDM: {
viewType: #COMPOSITE,
private: true
}
/*+[hideWarning] { "IDS" : [ "KEY_CHECK" ] } */
define view P_CostAccountingDocument
as select from I_GLAccountLineItemRawData as _Header
{
key _Header.FiscalYear,
key _Header.ReferenceDocument,
key _Header.ControllingArea,
key _Header.LedgerGLLineItem,
key _Header.ReferenceDocumentType,
key _Header.ReferenceDocumentContext,
_Header._JournalEntry.AccountingDocumentHeaderText,
_Header.DocumentDate,
_Header.PostingDate,
_Header.FiscalPeriod,
_Header.FiscalYearPeriod,
cast (
case _Header.ReferenceDocumentType
when 'AFRU' then '00000000'
when 'CATS' then '00000000'
else _Header._JournalEntry.AccountingDocumentCreationDate
end as farp_cpudt) as AccountingDocumentCreationDate,
cast (_Header.AccountingDocCreatedByUser as fco_cc_createdby preserving type) as AccountingDocCreatedByUser,
_Header.IsReversal,
_Header.IsReversed,
cast (_Header._JournalEntry.ExchangeRateDate as fin_currconvdat preserving type) as ExchangeRateDate,
_Header.PredecessorReferenceDocument,
_Header.ReversalReferenceDocument,
_Header.GlobalCurrency,
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
cast (
case _Header.OriginCtrlgDebitCreditCode
when 'S' then _Header.AmountInGlobalCurrency
else 0
end as fis_ksl) as AmountInGlobalCurrency,
cast (_Header.ControllingBusTransacType as fins_co_bus_trans preserving type ) as ControllingBusTransacType,
_Header.BusinessTransactionCategory,
cast (
case _Header.IsReversal
when '' then ( case _Header.PredecessorReferenceDocument
when '' then '1'
else '3' end )
else '2'
end as fco_posting_type) as AllocationPostingType,
cast (
case _Header.IsReversal
when '' then ''
else _Header.ReversalReferenceDocument
end as reversedreferencedocument preserving type ) as ReversedReferenceDocument,
_Header.IsSettled
}
where
(
(
(
( _Header.ControllingBusTransacType = 'RKU1' and _Header.BusinessTransactionCategory = 'RKU1' )
or ( _Header.ControllingBusTransacType = 'RKU2' and _Header.BusinessTransactionCategory = 'RKU2' )
or ( _Header.ControllingBusTransacType = 'KAMV' and _Header.BusinessTransactionCategory = 'KAMV' )
)
and _Header.ReferenceDocumentType = 'COBK'
and _Header.ControllingObject <> ''
)
or
(
(
( _Header.ControllingBusTransacType = 'RKU1' and _Header.BusinessTransactionCategory = 'RKU3' )
or ( _Header.ControllingBusTransacType = 'RKU2' and _Header.BusinessTransactionCategory = 'RKU3' )
or ( _Header.ControllingBusTransacType = 'RKU3' and _Header.BusinessTransactionCategory = 'RKU3' )
)
and _Header.ReferenceDocumentType = 'COBK'
and _Header.ControllingObject <> ''
)
or
(
(
( _Header.ControllingBusTransacType = 'RKL' )
and ( _Header.BusinessTransactionCategory = 'RKL' or _Header.BusinessTransactionCategory = 'RKLU' or _Header.BusinessTransactionCategory = 'RMRU' )
)
and ( _Header.ReferenceDocumentType = 'COBK' or ( _Header.ReferenceDocumentType = 'CATS' and _Header.IsReversal = '' ) or _Header.ReferenceDocumentType = 'AFRU' )
and _Header.OriginCtrlgDebitCreditCode = 'S'
)
or
(
_Header.ControllingBusTransacType = 'COIN'
and
_Header.IsReversal = '' and _Header.IsReversed = ''
and _Header.ControllingObject <> ''
and
(
_Header.BusinessTransactionCategory <> 'ACAA' and
_Header.BusinessTransactionCategory <> 'ACAC' and
_Header.BusinessTransactionCategory <> 'ACAD' and
_Header.BusinessTransactionCategory <> 'ACEA' and
_Header.BusinessTransactionCategory <> 'ACPA' and
_Header.BusinessTransactionCategory <> 'ACPC' and
_Header.BusinessTransactionCategory <> 'ACPD' and
_Header.BusinessTransactionCategory <> 'EBDP' and
_Header.BusinessTransactionCategory <> 'EBVP' and
_Header.BusinessTransactionCategory <> 'EBWP' and
_Header.BusinessTransactionCategory <> 'TBCS' and
_Header.BusinessTransactionCategory <> 'TBRR' and
_Header.BusinessTransactionCategory <> 'KOAE' and
_Header.BusinessTransactionCategory <> 'RMWF' and
_Header.BusinessTransactionCategory <> 'GLA0'
)
)
)
and _Header._Ledger.IsLeadingLedger = 'X'
and _Header.IsSettlement = ''
and _Header.JournalEntryIsSecondaryEntry = ''
and _Header.LogicalSystem = ''
and _Header.AccountAssignmentType <> ''
and _Header.ReferenceDocument <> ''
/*+[internal] {
"BASEINFO":
{
"FROM ":
[
"I_GLACCOUNTLINEITEMRAWDATA",
"I_JOURNALENTRY",
"I_LEDGER"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
P_CostAccountingDocument view