@AbapCatalog.sqlViewName: 'FAC_DZLIMFAST'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Fixed Assets - Line Item'
@ObjectModel: { usageType.serviceQuality: #D,
usageType.sizeCategory: #XXL,
usageType.dataClass: #MIXED }
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.buffering.status: #NOT_ALLOWED
@AbapCatalog.preserveKey: true
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@Metadata.ignorePropagatedAnnotations: true
define view FAC_DART_Z3_LINEITEM_FIXEDAST
with parameters
@Consumption.hidden: true
@Environment.systemField: #SYSTEM_LANGUAGE
P_Language : sylangu,
// @Consumption.hidden: true
// @Environment.systemField: #USER
// P_BusinessUser : syuname,
// @Consumption.valueHelp: '_AssetKeyFigureSet'
// @Consumption.defaultValue: 'AHS'
// P_AssetAccountingKeyFigureSet : faa_key_figure_set,
//@Consumption.valueHelp: '_CompanyCodeAssetVH'
// @Consumption.derivation: { lookupEntity: 'I_UserSettingsForCompanyCode',
// resultElement: 'CompanyCode',
// binding: [ { targetElement : 'BusinessUser' , type : #PARAMETER, value : 'P_BusinessUser' } ] }
//P_CompanyCode : fis_bukrs,
// @Consumption.derivation: { lookupEntity: 'I_Ledger',
// resultElement: 'Ledger', binding: [
// { targetElement : 'IsLeadingLedger' , type : #CONSTANT, value : 'X' } ]
// }
P_Ledger : fis_rldnr,
// @Consumption.derivation: { lookupEntity: 'P_UserSettingsForDeprArea',
// resultElement: 'AssetDepreciationArea', binding: [
// { targetElement : 'BusinessUser' , type : #PARAMETER, value : 'P_BusinessUser' } ]
// }
// P_AssetDepreciationArea : fis_afabe,
P_FiscalYear : fins_gjahr,
P_StartFiscalPeriod : fis_period_from,
P_EndFiscalPeriod : fis_period_to
// @Consumption.derivation: { lookupEntity: 'I_FiscalCalendarDateForLedger',
// resultElement: 'FiscalYearStartDate',
// binding: [
// { targetElement : 'CompanyCode' , type : #PARAMETER, value : 'P_CompanyCode' },
// { targetElement : 'Ledger' , type : #PARAMETER, value : 'P_Ledger' },
// { targetElement : 'CalendarDate' , type : #PARAMETER, value : 'P_ToPostingDate' }
// ]}
// @Consumption.hidden: true
// P_FromPostingDate : fis_budat_from
as select from I_FixedAssetLineItem as Lineitem
// association [0..1] to I_AssetKeyFigureSet as _AssetKeyFigureSet on _AssetKeyFigureSet.AssetAccountingKeyFigureSet = $projection.AssetAccountingKeyFigureSet
// association [1] to I_AssetSortedKeyFigureSetSpec as _AssetSortedKeyFigureSetSpec on _AssetSortedKeyFigureSetSpec.AssetAccountingKeyFigureSet = $projection.AssetAccountingKeyFigureSet
// and _AssetSortedKeyFigureSetSpec.AssetAccountingSortedKeyFigure = $projection.AssetAccountingSortedKeyFigure
association [0..1] to I_ReferenceDocumentType as _ReferenceDocumentType on _ReferenceDocumentType.ReferenceDocumentType = $projection.ReferenceDocumentType
// association [0..1] to I_FiscalCalendarDateForLedger as _FiscalCalendarDateForLedger on _FiscalCalendarDateForLedger.CompanyCode = $projection.CompanyCode
// and _FiscalCalendarDateForLedger.Ledger = $projection.Ledger
// and _FiscalCalendarDateForLedger.CalendarDate = $parameters.P_ToPostingDate
association [0..1] to I_OperationalAcctgDocItem as _OperationalAcctgDocItem on $projection.CompanyCode = _OperationalAcctgDocItem.CompanyCode
and $projection.AccountingDocument = _OperationalAcctgDocItem.AccountingDocument
and $projection.FiscalYear = _OperationalAcctgDocItem.FiscalYear
and $projection.AccountingDocumentItem = _OperationalAcctgDocItem.AccountingDocumentItem
{
@EndUserText.label: 'System Client'
$session.client as system_client,
_FixedAsset.AssetClass,
//_FixedAsset._AssetClass._Text[1:Language = $parameters.P_Language].AssetClassDescription,
@ObjectModel.foreignKey.association: '_FixedAsset'
FixedAsset,
_FixedAsset.FixedAssetDescription,
@ObjectModel.foreignKey.association: '_MasterFixedAsset'
MasterFixedAsset,
_MasterFixedAsset.MasterFixedAssetDescription,
PostingDate,
//@EndUserText.label: 'Business Transaction Type'
//_ReferenceDocumentType._Text[1: Language = $parameters.P_Language].ReferenceDocumentTypeName,
@ObjectModel.foreignKey.association: '_AssetAcctTransClassfctn'
AssetAcctTransClassfctn,
//@EndUserText.label: 'Transaction Type Category'
//_AssetAcctTransClassfctn._Text[1: Language = $parameters.P_Language].AssetAcctTransClassfctnName,
@ObjectModel.foreignKey.association: '_SubledgerAccLineItemType'
SubLedgerAcctLineItemType,
//@EndUserText.label: 'Subledger-Specific Line Item Type'
//_SubLedgerAccLineItemType._Text[1: Language = $parameters.P_Language].SubLedgerAcctLineItemTypeName,
//_AssetTransactionType._Text[1:Language = $parameters.P_Language].AssetTransactionTypeName,
@ObjectModel.foreignKey.association: '_JournalEntry'
@EndUserText.label: 'Journal Entry'
AccountingDocument,
AccountingDocumentItem,
@ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
GLAccount,
_DebitCreditCode._Text[1:Language = $parameters.P_Language].DebitCreditCodeName,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
@EndUserText.label: 'Amt in CoCode Currency'
AmountInCompanyCodeCurrency as AmountInCompanyCodeCurrency,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
CompanyCodeCurrency,
@ObjectModel.foreignKey.association: '_DepreciationArea'
@EndUserText.label: 'Asset Depreciation Area'
AssetDepreciationArea,
_DepreciationArea._Text[1:Language = $parameters.P_Language].AssetDepreciationAreaName,
//////////////////////////////////////////////////////////////
@ObjectModel.foreignKey.association: '_CompanyCode'
CompanyCode,
@ObjectModel.foreignKey.association: '_FiscalYear'
FiscalYear,
// @ObjectModel.foreignKey.association: '_MasterFixedAsset'
// MasterFixedAsset,
// @ObjectModel.foreignKey.association: '_FixedAsset'
// FixedAsset,
// @ObjectModel.foreignKey.association: '_SubledgerAccLineItemType'
// SubLedgerAcctLineItemType,
//@ObjectModel.foreignKey.association: '_FiscalPeriod'
@ObjectModel.foreignKey.association: '_FiscalPeriodForVariant'
FiscalPeriod,
@ObjectModel.foreignKey.association: '_LedgerGroup'
LedgerGroup,
// @ObjectModel.foreignKey.association: '_JournalEntry'
// AccountingDocument,
@ObjectModel.foreignKey.association: '_Ledger'
Ledger,
TransactionSubitem,
@ObjectModel.foreignKey.association: '_DebitCreditCode'
DebitCreditCode,
//////////////////////////////////////////////////////////////
@ObjectModel.foreignKey.association: '_AccountingPrinciple'
AccountingPrinciple,
@ObjectModel.foreignKey.association: '_LedgerFiscalYearForVariant'
@Semantics.fiscal.year: true
LedgerFiscalYear,
@ObjectModel.foreignKey.association: '_FiscalYearVariant'
@Semantics.fiscal.yearVariant: true
FiscalYearVariant,
@ObjectModel.foreignKey.association: '_FiscalYearPeriodForVariant'
@Semantics.fiscal.yearPeriod: true
FiscalYearPeriod,
@ObjectModel.foreignKey.association: '_ChartOfAccounts'
ChartOfAccounts,
// @ObjectModel.foreignKey.association: '_GLAccountInChartOfAccounts'
// GLAccount,
@ObjectModel.foreignKey.association: '_CountryChartOfAccounts'
CountryChartOfAccounts,
@ObjectModel.foreignKey.association: '_AlternativeGLAccount'
cast(AlternativeGLAccount as fis_altkt_skb1 preserving type) as AlternativeGLAccount,
cast('' as boolean preserving type) as IsStatisticalDocument,
// @ObjectModel.foreignKey.association: '_AssetAcctTransClassfctn'
// AssetAcctTransClassfctn,
GroupMasterFixedAsset,
GroupFixedAsset,
@ObjectModel.foreignKey.association: '_FinancialAccountType'
FinancialAccountType,
@ObjectModel.foreignKey.association: '_ChartOfDepreciation'
ChartOfDepreciation,
ReferenceDocumentItem,
ReferenceDocumentType,
LogicalSystem,
ReferenceDocument,
ReferenceDocumentContext,
ReversalReferenceDocument,
ReversalReferenceDocumentCntxt,
IsReversal,
IsReversed,
DocumentDate,
// PostingDate,
@ObjectModel.foreignKey.association: '_AssetTransactionType'
AssetTransactionType,
AssetValueDate,
@Semantics.businessDate.at: true
AccountingDocumentCreationDate,
CreationTime,
DocumentItemText,
AccountingDocCreatedByUser,
GLBusinessTransactionType,
AssignmentReference,
JointVentureCostRecoveryCode,
DepreciationFiscalPeriod,
// AccountingDocumentItem,
ReversalTransactionSubitem,
@ObjectModel.foreignKey.association: '_CostCenter'
CostCenter,
@ObjectModel.foreignKey.association: '_Plant'
Plant,
@ObjectModel.foreignKey.association: '_BusinessArea'
BusinessArea,
PersonnelNumber,
Fund,
@ObjectModel.foreignKey.association: '_ProfitCenter'
ProfitCenter,
@ObjectModel.foreignKey.association: '_Segment'
Segment,
@ObjectModel.foreignKey.association: '_FunctionalArea'
FunctionalArea,
@ObjectModel.foreignKey.association: '_ControllingArea'
ControllingArea,
FundsCenter,
@ObjectModel.foreignKey.association: '_AccountingDocumentType'
AccountingDocumentType,
//Measures
// @Semantics.currencyCode:true
// @ObjectModel.foreignKey.association: '_CompanyCodeCurrency'
// CompanyCodeCurrency,
// @DefaultAggregation: #SUM
// @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
// AmountInCompanyCodeCurrency,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_GlobalCurrency'
GlobalCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
AmountInGlobalCurrency,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_FreeDefinedCurrency1'
FreeDefinedCurrency1,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
AmountInFreeDefinedCurrency1,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_FreeDefinedCurrency2'
FreeDefinedCurrency2,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
AmountInFreeDefinedCurrency2,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_FreeDefinedCurrency3'
FreeDefinedCurrency3,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
AmountInFreeDefinedCurrency3,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_FreeDefinedCurrency4'
FreeDefinedCurrency4,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
AmountInFreeDefinedCurrency4,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_FreeDefinedCurrency5'
FreeDefinedCurrency5,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
AmountInFreeDefinedCurrency5,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_FreeDefinedCurrency6'
FreeDefinedCurrency6,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
AmountInFreeDefinedCurrency6,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_FreeDefinedCurrency7'
FreeDefinedCurrency7,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
AmountInFreeDefinedCurrency7,
@Semantics.currencyCode:true
@ObjectModel.foreignKey.association: '_FreeDefinedCurrency8'
FreeDefinedCurrency8,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
AmountInFreeDefinedCurrency8,
@ObjectModel.foreignKey.association: '_BaseUnit'
@Semantics.unitOfMeasure:true
BaseUnit,
@DefaultAggregation: #SUM
@Semantics: { quantity : {unitOfMeasure: 'BaseUnit'} }
Quantity,
//@ObjectModel.foreignKey.association: '_PurchasingDocument'
PurchasingDocument,
//@ObjectModel.foreignKey.association: '_PurchasingDocumentItem'
PurchasingDocumentItem,
//////////////////////////////BSEG
_OperationalAcctgDocItem.OriginalReferenceDocument,
_OperationalAcctgDocItem.TaxCode,
_OperationalAcctgDocItem.TaxCountry,
@ObjectModel.foreignKey.association: '_PartnerCompany'
_OperationalAcctgDocItem.PartnerCompany,
@ObjectModel.foreignKey.association: '_Product'
_OperationalAcctgDocItem.Product,
@ObjectModel.foreignKey.association: '_PartnerBusinessArea'
_OperationalAcctgDocItem.PartnerBusinessArea,
_OperationalAcctgDocItem.Material as MaterialNumber,
_OperationalAcctgDocItem.BaseUnit as BaseUnitofMeasure,
_OperationalAcctgDocItem.Quantity as Totalquantity,
//////////////////////////////BKPF
_JournalEntry.IntercompanyTransaction,
//Publish Associations
_DepreciationArea,
_CompanyCode,
_ControllingArea,
_FiscalYear,
_FiscalPeriod,
_MasterFixedAsset,
_FixedAsset,
_SubLedgerAccLineItemType,
_ChartOfAccounts,
_CountryChartOfAccounts,
_GLAccountInChartOfAccounts,
_AlternativeGLAccount,
_LedgerGroup,
_JournalEntry,
_Ledger,
_AssetAcctTransClassfctn,
_FinancialAccountType,
_ChartOfDepreciation,
_AssetTransactionType,
_DebitCreditCode,
_CostCenter,
_Plant,
_BusinessArea,
_ProfitCenter,
_Segment,
_FunctionalArea,
_CompanyCodeCurrency,
_GlobalCurrency,
_BaseUnit,
_FreeDefinedCurrency1,
_FreeDefinedCurrency2,
_FreeDefinedCurrency3,
_FreeDefinedCurrency4,
_FreeDefinedCurrency5,
_FreeDefinedCurrency6,
_FreeDefinedCurrency7,
_FreeDefinedCurrency8,
_FiscalYearVariant,
_LedgerFiscalYearForVariant,
_FiscalYearPeriodForVariant,
_FiscalPeriodForVariant,
_AccountingDocumentType,
_AccountingPrinciple,
_OperationalAcctgDocItem._PartnerCompany,
_OperationalAcctgDocItem._Product,
_OperationalAcctgDocItem._PartnerBusinessArea
}
where
// Lineitems.PostingDate between $parameters.P_FromPostingDate and $parameters.P_ToPostingDate
Lineitem.FiscalPeriod between $parameters.P_StartFiscalPeriod and $parameters.P_EndFiscalPeriod
and Lineitem.FiscalYear = $parameters.P_FiscalYear
//and Lineitem.CompanyCode = $parameters.P_CompanyCode
and Lineitem.Ledger = $parameters.P_Ledger
// and Lineitem.AssetDepreciationArea = $parameters.P_AssetDepreciationArea
and Lineitem.AccountingDocument != ''
// and LineItems.FiscalYear = $parameters.P_FiscalYear
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DEBITCREDITCODE",
"I_DEBITCREDITCODETEXT",
"I_DEPRAREAFORLEDGERTEXT",
"I_DEPRECIATIONAREAFORLEDGER",
"I_FIXEDASSET",
"I_FIXEDASSETLINEITEM",
"I_JOURNALENTRY",
"I_MASTERFIXEDASSET",
"I_OPERATIONALACCTGDOCITEM"
],
"ASSOCIATED":
[
"I_ACCOUNTINGDOCUMENTTYPE",
"I_ACCOUNTINGPRINCIPLE",
"I_ASSETTRANSACTIONTYPE",
"I_BUSINESSAREA",
"I_CHARTOFACCOUNTS",
"I_CHARTOFDEPRECIATION",
"I_COMPANYCODE",
"I_CONTROLLINGAREA",
"I_COSTCENTER",
"I_CURRENCY",
"I_DEBITCREDITCODE",
"I_DEPRECIATIONAREAFORLEDGER",
"I_FINANCIALACCOUNTTYPE",
"I_FISCALPERIODFORVARIANT",
"I_FISCALYEARFORCOMPANYCODE",
"I_FISCALYEARFORVARIANT",
"I_FISCALYEARPERIODFORCMPNYCODE",
"I_FISCALYEARPERIODFORVARIANT",
"I_FISCALYEARVARIANT",
"I_FIXEDASSET",
"I_FUNCTIONALAREA",
"I_GLACCOUNTINCHARTOFACCOUNTS",
"I_JOURNALENTRY",
"I_LEDGER",
"I_LEDGERGROUP",
"I_MASTERFIXEDASSET",
"I_MOVEMENTCATEGORY",
"I_OPERATIONALACCTGDOCITEM",
"I_PLANT",
"I_PRODUCT",
"I_PROFITCENTER",
"I_REFERENCEDOCUMENTTYPE",
"I_SEGMENT",
"I_SUBLEDGERACCLINEITEMTYPE",
"I_UNITOFMEASURE"
],
"BASE":
[
"I_FIXEDASSETLINEITEM",
"I_OPERATIONALACCTGDOCITEM"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/