@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'PCADEASTCHGLOG'
@VDM.viewType: #CONSUMPTION
@VDM.private: true
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.sizeCategory: #L
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ClientHandling.algorithm: #SESSION_VARIABLE
define view P_CN_CADEAssetChangeLog with parameters
@EndUserText.label: 'Language'
@Environment.systemField: #SYSTEM_LANGUAGE
P_Language : sylangu
as select from I_FixedAssetForLedger as FixedAsset
inner join I_CN_CADEGeneralInformation as Configuration on Configuration.CompanyCode = FixedAsset.CompanyCode
and Configuration.CN_CADENatlStdRelVersion = 'CN24589'
and Configuration.ABAPObjectActivationState = ''
inner join I_ChangeDocumentItem as ChangeLog on ChangeLog.ChangeDocObject = concat( FixedAsset.CompanyCode, concat( FixedAsset.MasterFixedAsset, FixedAsset.FixedAsset ) )
inner join I_CN_CADEStatutoryReportTypeT as TransactionType on TransactionType.DomainValue = ChangeDocDatabaseTableField
and TransactionType.SAPDataDictionaryDomain = 'CADE_AA_TRANSACTIONTYPE'
and TransactionType.Language = :P_Language
{
key FixedAsset.CompanyCode,
key FixedAsset.Ledger,
key MasterFixedAsset,
key FixedAsset,
key ChangeDocObject,
key ChangeDocObjectClass,
key ChangeDocument,
key DatabaseTable,
key ChangeDocTableKey,
key ChangeDocDatabaseTableField,
key ChangeDocItemChangeType,
FixedAsset._FixedAsset.FixedAssetExternalID,
FixedAsset.AssetDeactivationDate,
case when FixedAsset._FixedAsset.AssetSerialNumber = ''
then FixedAsset._FixedAsset.Inventory
else FixedAsset._FixedAsset.AssetSerialNumber
end as AssetSerialNumber,
FixedAsset._FixedAsset.Inventory,
FixedAsset._FixedAsset.FixedAssetDescription,
FixedAsset._FixedAsset.AssetClass,
TransactionType.DomainValue as AssetTransactionType,
TransactionType.DomainText as AssetTransactionTypeName,
_ChangeDocument.ChangeTransactionCode,
_ChangeDocument.CreationDate,
ChangeDocNewFieldValue,
ChangeDocPreviousFieldValue
}
where
//Old AA Table
DatabaseTable = 'ANLA' or DatabaseTable = 'ANLZ' or DatabaseTable = 'ANLB'
and ChangeLog._ChangeDocument.CreationDate >= FixedAsset.AssetCapitalizationDate
union all
select from I_FixedAssetForLedger as FixedAsset
inner join I_CN_CADEGeneralInformation as Configuration on Configuration.CompanyCode = Configuration.CompanyCode
and Configuration.CN_CADENatlStdRelVersion = 'CN24589'
and Configuration.ABAPObjectActivationState = 'X'
inner join I_ChangeDocumentItem as ChangeLog on ChangeLog.ChangeDocObject = concat( FixedAsset.CompanyCode, concat( FixedAsset.MasterFixedAsset, FixedAsset.FixedAsset ) )
inner join P_CN_CADEAstTransType_New as TransactionType on TransactionType.CN_CADEAssetTransactionType = ChangeDocDatabaseTableField
and TransactionType.Language = :P_Language
{
key FixedAsset.CompanyCode,
key FixedAsset.Ledger,
key MasterFixedAsset,
key FixedAsset,
key ChangeDocObject,
key ChangeDocObjectClass,
key ChangeDocument,
key DatabaseTable,
key ChangeDocTableKey,
key ChangeDocDatabaseTableField,
key ChangeDocItemChangeType,
FixedAsset._FixedAsset.FixedAssetExternalID,
FixedAsset.AssetDeactivationDate,
case when FixedAsset._FixedAsset.AssetSerialNumber = ''
then FixedAsset._FixedAsset.Inventory
else FixedAsset._FixedAsset.AssetSerialNumber
end as AssetSerialNumber,
FixedAsset._FixedAsset.Inventory,
FixedAsset._FixedAsset.FixedAssetDescription,
FixedAsset._FixedAsset.AssetClass,
TransactionType.DomainValue as AssetTransactionType,
TransactionType.DomainText as AssetTransactionTypeName,
_ChangeDocument.ChangeTransactionCode,
_ChangeDocument.CreationDate,
ChangeDocNewFieldValue,
ChangeDocPreviousFieldValue
}
where
//New AA Table
DatabaseTable = 'FAAT_MD' or DatabaseTable = 'FAAT_MD_TDD' or
DatabaseTable = 'GLO_FAAT_MD' or DatabaseTable = 'GLO_FAAT_MD_TDD'
and ChangeLog._ChangeDocument.CreationDate >= FixedAsset.AssetCapitalizationDate
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CHANGEDOCUMENT",
"I_CHANGEDOCUMENTITEM",
"I_CN_CADEGENERALINFORMATION",
"I_CN_CADESTATUTORYREPORTTYPET",
"I_FIXEDASSET",
"I_FIXEDASSETFORLEDGER",
"P_CN_CADEASTTRANSTYPE_NEW"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/