@AbapCatalog.viewEnhancementCategory: [#NONE]
@AccessControl.authorizationCheck: #MANDATORY
@EndUserText.label: 'SAFT PL KR PD GLAccounts Tag - Cube'
@Analytics.dataCategory:#CUBE
@Metadata.allowExtensions:true
@Analytics.internalName:#LOCAL
@AccessControl.personalData.blocking:#NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
@VDM.viewType: #COMPOSITE
@ObjectModel.usageType:{
serviceQuality: #X,
sizeCategory: #XL,
dataClass: #MIXED
}
define view entity I_PL_SAFTGenLdgrAcctTagCube
with parameters
P_FromPostingDate : fis_budat_from,
P_ToPostingDate : fis_budat_to,
@Consumption.hidden: true
@Consumption.defaultValue: '000'
P_FromFiscalPeriod : fis_period_from,
@Consumption.hidden: true
@Consumption.defaultValue: '000'
P_ToFiscalPeriod : fis_period_to,
@Semantics.booleanIndicator:true
P_PL_IndicatorIsTrueOrFalse : fipl_consider_vendor_customer
as select from I_PL_SAFTGenLdgrAcctBalCube
( P_FromPostingDate: $parameters.P_FromPostingDate,
P_ToPostingDate: $parameters.P_ToPostingDate,
P_FromFiscalPeriod: $parameters.P_FromFiscalPeriod,
P_ToFiscalPeriod: $parameters.P_ToFiscalPeriod,
P_PL_IndicatorIsTrueOrFalse: $parameters.P_PL_IndicatorIsTrueOrFalse )
inner join I_PL_SAFTGeneralSettings on I_PL_SAFTGeneralSettings.CompanyCode = I_PL_SAFTGenLdgrAcctBalCube.CompanyCode
and I_PL_SAFTGeneralSettings.ValidityStartDate <= $parameters.P_ToPostingDate
and I_PL_SAFTGeneralSettings.ValidityEndDate >= $parameters.P_ToPostingDate
left outer to one join I_AcctTypeText on I_AcctTypeText.FinancialAccountType = I_PL_SAFTGenLdgrAcctBalCube.ReconciliationAccountType
and I_AcctTypeText.Language = $session.system_language
left outer to one join I_GLAccountText on I_GLAccountText.ChartOfAccounts = I_PL_SAFTGenLdgrAcctBalCube.ChartOfAccounts
and I_GLAccountText.GLAccount = I_PL_SAFTGenLdgrAcctBalCube.AlternativeGLAccount
and I_GLAccountText.Language = $session.system_language
left outer to one join I_FxdAstActualLineItem on I_FxdAstActualLineItem.Ledger = I_PL_SAFTGenLdgrAcctBalCube.Ledger
and I_FxdAstActualLineItem.CompanyCode = I_PL_SAFTGenLdgrAcctBalCube.CompanyCode
and I_FxdAstActualLineItem.FiscalYear = I_PL_SAFTGenLdgrAcctBalCube.FiscalYear
and I_FxdAstActualLineItem.AccountingDocument = I_PL_SAFTGenLdgrAcctBalCube.AccountingDocument
and I_FxdAstActualLineItem.LedgerGLLineItem = I_PL_SAFTGenLdgrAcctBalCube.LedgerGLLineItem
{
key I_PL_SAFTGenLdgrAcctBalCube.Ledger,
key I_PL_SAFTGenLdgrAcctBalCube.CompanyCode,
key I_PL_SAFTGenLdgrAcctBalCube.FiscalYear,
key I_PL_SAFTGenLdgrAcctBalCube.SourceLedger,
key I_PL_SAFTGenLdgrAcctBalCube.AccountingDocument,
key I_PL_SAFTGenLdgrAcctBalCube.LedgerGLLineItem,
key I_PL_SAFTGenLdgrAcctBalCube.StatryRptCategory,
key I_PL_SAFTGenLdgrAcctBalCube.StatryRptgEntity,
key I_PL_SAFTGenLdgrAcctBalCube.StatryRptRunID,
I_FxdAstActualLineItem.FixedAsset,
I_FxdAstActualLineItem.MasterFixedAsset,
I_PL_SAFTGenLdgrAcctBalCube.PostingDate,
I_PL_SAFTGenLdgrAcctBalCube.DocumentDate,
cast( case
when I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'K'
then ltrim(I_PL_SAFTGenLdgrAcctBalCube.Supplier, '0')
when I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'D'
then ltrim(I_PL_SAFTGenLdgrAcctBalCube.Customer, '0')
when I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'A'
then concat(concat(I_FxdAstActualLineItem.MasterFixedAsset, '_' ), I_FxdAstActualLineItem.FixedAsset)
when I_PL_SAFTGeneralSettings.PL_SAFTAccountSelectCriterion = 'M'
then ltrim(I_PL_SAFTGenLdgrAcctBalCube.GLAccount, '0')
when I_PL_SAFTGeneralSettings.PL_SAFTAccountSelectCriterion = 'A'
then ltrim(I_PL_SAFTGenLdgrAcctBalCube.AlternativeGLAccount, '0')
end as fipl_kr_subledger) as PL_SubledgerAccountNumber,
I_PL_SAFTGenLdgrAcctBalCube.GLAccount,
case
when I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'K'
then I_PL_SAFTGenLdgrAcctBalCube.SupplierName
when I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'D'
then I_PL_SAFTGenLdgrAcctBalCube.CustomerName
when I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'A'
then I_FxdAstActualLineItem._FixedAsset.FixedAssetDescription
when I_PL_SAFTGeneralSettings.PL_SAFTAccountSelectCriterion = 'M'
then I_PL_SAFTGenLdgrAcctBalCube.GLAccountLongName
when I_PL_SAFTGeneralSettings.PL_SAFTAccountSelectCriterion = 'A'
then I_GLAccountText.GLAccountLongName
else
I_PL_SAFTGenLdgrAcctBalCube.GLAccountLongName
end as PL_AccountNumberDescription,
I_PL_SAFTGenLdgrAcctBalCube.GLAccountType,
case
when ( I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'K' ) or
( I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'D' ) or
( I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'A' )
then I_PL_SAFTGenLdgrAcctBalCube.GLAccount
else
I_PL_SAFTGenLdgrAcctBalCube.GLAccountGroup
end as PL_GLAccountOrGroupText,
case
when ( I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'K' ) or
( I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'D' ) or
( I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'A' )
then I_PL_SAFTGenLdgrAcctBalCube.GLAccountLongName
else
I_PL_SAFTGenLdgrAcctBalCube.AccountGroupName
end as PL_GLAccountOrGroupDescription,
case
when I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'K'
then I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType
when I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'D'
then I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType
when I_PL_SAFTGenLdgrAcctBalCube.PL_IndicatorIsCustomerSupplier = 'X'and I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'A'
then I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType
else
I_PL_SAFTGenLdgrAcctBalCube.GLAccountGroup
end as PL_RecnclnAcctTypeOrGroupText,
case
when I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'K' or I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'D' or I_PL_SAFTGenLdgrAcctBalCube.FinancialAccountType = 'A'
then I_AcctTypeText.FinancialAccountTypeName
else
I_PL_SAFTGenLdgrAcctBalCube.AccountGroupName
end as PL_RecnclnAcctNameOrGrpDesc,
I_PL_SAFTGenLdgrAcctBalCube.CompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.StartingBalanceAmtInCoCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.DebitStartingBalAmtInCCCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.CreditStartingBalAmtInCCCrcy,
//current balance
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.AmountInCompanyCodeCurrency,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.DebitAmountInCoCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.CreditAmountInCoCodeCrcy,
//Ending Balance
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.EndingBalanceAmtInCoCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.DebitEndingBalAmtInCCCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.CreditEndingBalAmtInCCCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.YTDDebitAmtInCoCodeCrcy,
@DefaultAggregation: #SUM
@Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
I_PL_SAFTGenLdgrAcctBalCube.YTDCrdtAmtInCoCodeCrcy,
I_PL_SAFTGeneralSettings.BusinessType as BusinessType
}