P_Fa_Flowitem

DDL: P_FA_FLOWITEM SQL: PFALITEM Type: view BASIC

P_Fa_Flowitem is a Basic CDS View in SAP S/4HANA. It reads from 3 data sources (I_OperationalAcctgDocItem, fqm_flow, P_FqmFlwCatKFigCsh) and exposes 22 fields.

Data Sources (3)

SourceAliasJoin Type
I_OperationalAcctgDocItem fi_doc left_outer
fqm_flow flow from
P_FqmFlwCatKFigCsh flowcat inner

Parameters (1)

NameTypeDefault
P_htstp timestampl

Annotations (10)

NameValueLevelField
AbapCatalog.sqlViewName PFALITEM view
AbapCatalog.compiler.compareFilter true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_ALLOWED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
Metadata.ignorePropagatedAnnotations true view
VDM.private true view
VDM.viewType #BASIC view

Fields (22)

KeyFieldSource TableSource FieldDescription
CompanyCode fqm_flow company_code
FiDocumentType
TransactionDate fqm_flow transaction_date
HouseBank fqm_flow house_bank
HouseBankAccount fqm_flow house_bank_account
bank_account_idendasBankAccountID
CertaintyLevel fqm_flow certainty_level
Currency fqm_flow currency
PlanningLevel fqm_flow planning_level
CashPlanningGroup fqm_flow planning_group
LiquidityItem fqm_flow liquidity_item
GLAccount fqm_flow fi_account
ProfitCenter fqm_flow profit_center
Segment fqm_flow segment
BusinessArea fqm_flow business_area
TradingPartner fqm_flow trading_partner
AMOUNT
BaseAmount
BaseCurrency fqm_flow base_currency
valid_from fqm_flow valid_from
valid_to fqm_flow valid_to
rel_status fqm_flow rel_status
@AbapCatalog.sqlViewName: 'PFALITEM'
@AbapCatalog.compiler.compareFilter: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #NOT_ALLOWED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.usageType.dataClass: #MIXED
@Metadata.ignorePropagatedAnnotations: true
@VDM.private: true
@VDM.viewType: #BASIC
define view P_Fa_Flowitem

with parameters
@Consumption.defaultValue: '20170101000000'
P_htstp:timestampl

 as
select from fqm_flow as flow
 inner join P_FqmFlwCatKFigCsh as flowcat
        on  flow.flow_category = flowcat.FlowCategory
/* left outer join P_RECONCILIATION_STATISTICS_TB (iv_mandt:$session.client) as reconcil
        on  flow.flow_id = reconcil.flow_id
        and flow.valid_from = reconcil.valid_from*/
 left outer join I_OperationalAcctgDocItem as fi_doc
        on  flow.company_code = fi_doc.CompanyCode
        and flow.fi_fiscal_year = fi_doc.FiscalYear
        and flow.fi_document_number = fi_doc.AccountingDocument
        and flow.fi_document_line_item = fi_doc.AccountingDocumentItem
 {
      flow.company_code as CompanyCode,
      coalesce(fi_doc.AccountingDocumentType, cast('' as blart)) as FiDocumentType,
      flow.transaction_date as TransactionDate,
      flow.house_bank as HouseBank,
      flow.house_bank_account as HouseBankAccount,
      case when flow.bank_account_id = '' then '0000000000'
           else flow.bank_account_id
      end   as BankAccountID,
      flow.certainty_level as CertaintyLevel,
      flow.currency as Currency,
      flow.planning_level as PlanningLevel,
      flow.planning_group as CashPlanningGroup,
      flow.liquidity_item as LiquidityItem,
      flow.fi_account as GLAccount,
      flow.profit_center as  ProfitCenter,
      flow.segment as Segment,
      flow.business_area as BusinessArea,
      flow.trading_partner as TradingPartner,
      case when ( flow.certainty_level = 'MEMO' or flow.certainty_level = 'INTRAM' ) and flow.fi_due_date <>'00000000'   then flow.fi_due_date
           else '99991231' end as ExpirationDate,
      case when flow.amount < 0 then '-'
      else '+'
      end as direction,
      sum(flow.amount) as AMOUNT,
      sum(flow.base_amount) as BaseAmount,
      flow.base_currency as    BaseCurrency,
      flow.valid_from,
      flow.valid_to,

      // release statues

      flow.rel_status,

      // reconciliation status

      --case when reconcil.reconciliation_id is null
      --then 'U'
      --else '' end as reconcil_status
      -- 0 Actual/1 Intraday Recncln/2 Intraday Unrecncln/3 Forecast Recncln/4 Forecast Unrecncln
/*
      case when flow.certainty_level = 'INTRAM' and reconcil.reconciliation_id is not null
           then '1'
      when flow.certainty_level = 'INTRAM' and reconcil.reconciliation_id is null
           then '2'
      when flow.certainty_level <> 'INTRAM' and flow.certainty_level <> 'ACTUAL' and reconcil.reconciliation_id is not null
           then '3'
      when flow.certainty_level <> 'INTRAM' and flow.certainty_level <> 'ACTUAL' and reconcil.reconciliation_id is null
           then '4'
           else '0'
      end as reconcil_status*/
      '' as reconcil_status
}

  where  ( flow.deleted          = '' or flow.deleted is null )
//  and  fqm_flow.flg_actual       =  'X'      - Removed for snapshot enablement

    and  ( flow.cmm_state        = '0' or flow.cmm_state        = '' )
    and  flow.transaction_date <> '99991231'

group by
      flow.company_code ,
      flow.transaction_date ,
      flow.house_bank ,
      flow.house_bank_account ,
      flow.bank_account_id ,
      flow.certainty_level ,
      flow.currency ,
      flow.profit_center,
      flow.segment,
      flow.business_area,
      flow.trading_partner,
      flow.fi_due_date,
      flow.planning_level ,
      flow.planning_group ,
      flow.liquidity_item ,
      fi_doc.AccountingDocumentType,
      flow.fi_account,
      flow.amount,
      flow.base_currency,
      flow.valid_from,
      flow.valid_to,
      flow.rel_status
      --,
      --reconcil.reconciliation_id
;

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_OPERATIONALACCTGDOCITEM",
"P_FQMFLWCATKFIGCSH",
"FQM_FLOW"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/