P_AssetBalanceWithTmpPlanVal

DDL: P_ASSETBALANCEWITHTMPPLANVAL SQL: PASSTBALTMPVAL Type: view COMPOSITE

P_AssetBalanceWithTmpPlanVal is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (I_FixedAssetTmpPlanVal) and exposes 22 fields with key fields CompanyCode, AssetDepreciationArea, MasterFixedAsset, FixedAsset, Ledger.

Data Sources (1)

SourceAliasJoin Type
I_FixedAssetTmpPlanVal I_FixedAssetTmpPlanVal from

Parameters (2)

NameTypeDefault
P_CreationDateTime timestampl
P_UserID username

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PASSTBALTMPVAL view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
VDM.viewType #COMPOSITE view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (22)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_FixedAssetTmpPlanVal CompanyCode
KEY AssetDepreciationArea _DepreciationArea AssetDepreciationArea
KEY MasterFixedAsset MasterFixedAsset
KEY FixedAsset FixedAsset
KEY Ledger I_FixedAssetTmpPlanVal Ledger
KEY FiscalYear FiscalYear
KEY FiscalPeriod FiscalPeriod
KEY SubLedgerAcctLineItemType SubLedgerAcctLineItemType
KEY AssetAcctTransClassfctn AssetAcctTransClassfctn
LedgerGroup LedgerGroup
PlannedValueIsInclusive I_FixedAssetTmpPlanVal PlannedValueIsInclusive
ChartOfDepreciation ChartOfDepreciation
CompanyCodeCurrency CompanyCodeCurrency
GlobalCurrency GlobalCurrency
FreeDefinedCurrency1 FreeDefinedCurrency1
FreeDefinedCurrency2 FreeDefinedCurrency2
FreeDefinedCurrency3 FreeDefinedCurrency3
FreeDefinedCurrency4 FreeDefinedCurrency4
FreeDefinedCurrency5 FreeDefinedCurrency5
FreeDefinedCurrency6 FreeDefinedCurrency6
FreeDefinedCurrency7 FreeDefinedCurrency7
FreeDefinedCurrency8 FreeDefinedCurrency8
@AbapCatalog.sqlViewName: 'PASSTBALTMPVAL'
@AbapCatalog.preserveKey: true
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ObjectModel: { usageType.serviceQuality: #D,
                usageType.sizeCategory: #XXL,
                usageType.dataClass: #MIXED }
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_AssetBalanceWithTmpPlanVal
  with parameters
    P_CreationDateTime : timestampl,
    P_UserID           : username

  as select from I_FixedAssetTmpPlanVal
{

  key  I_FixedAssetTmpPlanVal.CompanyCode,
       // I_FixedAssetTmpPlanVal returns only representative ledger, which is no longer valid for new asset master data model

  key  _DepreciationArea.AssetDepreciationArea,
  key  MasterFixedAsset,
  key  FixedAsset,
  key  I_FixedAssetTmpPlanVal.Ledger,
  key  FiscalYear,
  key  FiscalPeriod,
  key  SubLedgerAcctLineItemType,
  key  AssetAcctTransClassfctn,

       LedgerGroup,

       I_FixedAssetTmpPlanVal.PlannedValueIsInclusive,
       ChartOfDepreciation,


       @Semantics.currencyCode: true
       CompanyCodeCurrency,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then AmountInCompanyCodeCurrency
           else 0
       end as fins_vhcur12)  as PlanAmountInCompanyCodeCrcy,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'CompanyCodeCurrency'} }
       cast(
         case
           when PlannedValueIsInclusive = '1' then AmountInCompanyCodeCurrency
           else 0
       end as fins_vhcur12 ) as ActualAmountInCompanyCodeCrcy,

       @Semantics.currencyCode: true
       GlobalCurrency,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then AmountInGlobalCurrency
           else 0
       end as fins_vhcur12 ) as PlanAmountInGlobalCurrency,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'GlobalCurrency'} }
       cast(
         case
           when PlannedValueIsInclusive = '1' then AmountInGlobalCurrency
           else 0
       end as fins_vhcur12 ) as ActualAmountInGlobalCurrency,

       @Semantics.currencyCode: true
       FreeDefinedCurrency1,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency1
           else 0
       end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy1,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency1'} }
       cast(
         case
           when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency1
           else 0
       end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy1,

       @Semantics.currencyCode: true
       FreeDefinedCurrency2,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then  AmountInFreeDefinedCurrency2
           else 0
       end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy2,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency2'} }
       cast(
         case
           when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency2
           else 0
       end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy2,

       @Semantics.currencyCode: true
       FreeDefinedCurrency3,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency3
           else 0
       end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy3,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency3'} }
       cast(
         case
           when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency3
           else 0
       end as fins_vhcur12)  as ActualAmountInFreeDfndCrcy3,

       @Semantics.currencyCode: true
       FreeDefinedCurrency4,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency4
           else 0
       end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy4,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency4'} }
       cast(
         case
           when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency4
           else 0
       end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy4,

       @Semantics.currencyCode: true
       FreeDefinedCurrency5,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency5
           else 0
       end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy5,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency5'} }
       cast(
         case
           when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency5
           else 0
       end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy5,

       @Semantics.currencyCode: true
       FreeDefinedCurrency6,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency6
           else 0
       end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy6,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency6'} }
       cast(
       case
         when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency6
         else 0
       end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy6,

       @Semantics.currencyCode: true
       FreeDefinedCurrency7,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency7
           else 0
       end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy7,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency7'} }
       cast(
         case
           when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency7
           else 0
       end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy7,

       @Semantics.currencyCode: true
       FreeDefinedCurrency8,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
       cast(
         case
           when PlannedValueIsInclusive = '2' then AmountInFreeDefinedCurrency8
           else 0
       end as fins_vhcur12 ) as PlanAmountInFreeDefinedCrcy8,

       @DefaultAggregation: #SUM
       @Semantics: { amount : {currencyCode: 'FreeDefinedCurrency8'} }
       cast(
         case
           when PlannedValueIsInclusive = '1' then AmountInFreeDefinedCurrency8
           else 0
       end as fins_vhcur12 ) as ActualAmountInFreeDfndCrcy8

}
where
  //Due values

  (
        I_FixedAssetTmpPlanVal.PlannedValueIsInclusive = '2'
    and I_FixedAssetTmpPlanVal.CreatedByUser           = :P_UserID
    and I_FixedAssetTmpPlanVal.CreationDateTime        = :P_CreationDateTime
  )
  //Carry forward values

  or(
        I_FixedAssetTmpPlanVal.PlannedValueIsInclusive = '1'
    and I_FixedAssetTmpPlanVal.AssetAcctTransClassfctn = '00'
    and I_FixedAssetTmpPlanVal.CreatedByUser           = :P_UserID
    and I_FixedAssetTmpPlanVal.CreationDateTime        = :P_CreationDateTime
  )
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DEPRECIATIONAREAFORLEDGER",
"I_FIXEDASSETTMPPLANVAL"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/