P_UnrealizedDiffAgg

DDL: P_UNREALIZEDDIFFAGG SQL: PUNREALZDIFFAGG Type: view COMPOSITE

P_UnrealizedDiffAgg is a Composite CDS View in SAP S/4HANA. It reads from 1 data source (P_UnrealizedCrcyDiff) and exposes 53 fields with key fields SourceLedger, CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem.

Data Sources (1)

SourceAliasJoin Type
P_UnrealizedCrcyDiff _flow from

Parameters (2)

NameTypeDefault
P_KeyDate sydate
P_Future sydate

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName PUNREALZDIFFAGG view
VDM.private true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view
AbapCatalog.compiler.compareFilter true view

Fields (53)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger SourceLedger Source Ledger
KEY CompanyCode P_UnrealizedCrcyDiff CompanyCode Receiver Company Code
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY AccountingDocument AccountingDocument Journal Entry
KEY LedgerGLLineItem LedgerGLLineItem Journal Entry Item
KEY Ledger Ledger Ledger
OriginSystem LogicalSystem Logical System
OriginApplication
OriginDocument
OriginTransaction
OriginTransactionQualifier
CashFlow Posting View Item
BaseCurrency CompanyCodeCurrency Local Currency
BaseAmount AmountInCompanyCodeCurrency Local Crcy Amt
Currency TransactionCurrency Transaction Currency
Amount AmountInTransactionCurrency Pt Crcy Amt
BankAccountCurrency
AmountInAccountCurrency
CertaintyLevel
AccountingDocumentItem AccountingDocumentItem Posting View Item
FIDocumentType AccountingDocumentType Journal Entry Type
CreatedByUser AccountingDocCreatedByUser User which created overhead document
FiscalPeriod FiscalPeriod Tax period
GLAccount GLAccount General Ledger
FinancialAccountType FinancialAccountType Fin. Account Type
DocumentItemText DocumentItemText Text
CashPlanningGroup CashPlanningGroup Planning Group
PlanningLevel PlanningLevel Planning Level
PaymentMethod
HouseBank HouseBank House Bank
HouseBankAccount HouseBankAccount House Bank Account
BankAccountId
Customer Customer Sold-to Party
Supplier Supplier Supplier
TradingPartner PartnerCompany Trading Partner
Material Material Vehicle Model
BusinessArea P_UnrealizedCrcyDiff BusinessArea Business Area
ProfitCenter P_UnrealizedCrcyDiff ProfitCenter Profit Center
CostCenter CostCenter Cost Center
Segment P_UnrealizedCrcyDiff Segment Segment number
LiquidityItem LiquidityItem Liquidity Item
WBSElementInternalID P_UnrealizedCrcyDiff WBSElementInternalID WBS Internal ID
WBSElementExternalID P_UnrealizedCrcyDiff WBSElementExternalID WBS Element External ID
Fund Fund Sender Fund
GrantID GrantID Sender Grant
BusinessPartner
SourceCompanyCode
Bank
BankCountry
BankAccount
BankAccountType
IBAN
direction

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_UnrealizedDiffAgg.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.
-- SQL view name: PUNREALZDIFFAGG
-- Parameters: P_KeyDate : sydate, P_Future : sydate

CREATE VIEW P_UnrealizedDiffAgg AS
SELECT
  SourceLedger,
  _flow.CompanyCode AS CompanyCode,
  FiscalYear,
  AccountingDocument,
  LedgerGLLineItem,
  Ledger,
  LogicalSystem AS OriginSystem,
  cast('BSEGV' as fqm_origin_application) AS OriginApplication,
  cast(concat(AccountingDocument, concat(_flow.CompanyCode, FiscalYear)) as fqm_origin_doc_id) AS OriginDocument,
  cast('' as fqm_origin_trans_id) AS OriginTransaction,
  cast('' as fqm_origin_trans_qualifier) AS OriginTransactionQualifier,
  cast(AccountingDocumentItem as fqm_origin_flow_id) AS CashFlow,
  CompanyCodeCurrency AS BaseCurrency,
  AmountInCompanyCodeCurrency AS BaseAmount,
  TransactionCurrency AS Currency,
  AmountInTransactionCurrency AS Amount,
  coalesce(_bam.BankAccountCurrency, TransactionCurrency) AS BankAccountCurrency,
  cast(0 as fqm_amount) AS AmountInAccountCurrency,
  cast('ACTUAL' as fqm_certainty_level) AS CertaintyLevel,
  AccountingDocumentItem,
  AccountingDocumentType AS FIDocumentType,
  AccountingDocCreatedByUser AS CreatedByUser,
  FiscalPeriod,
  GLAccount,
  FinancialAccountType,
  DocumentItemText,
  CashPlanningGroup,
  PlanningLevel,
  cast('' as fqm_payment_method) AS PaymentMethod,
  HouseBank,
  HouseBankAccount,
  coalesce(_flow.BankAccountInternalID, cast('0000000000' as fclm_bam_acc_id)) AS BankAccountId,
  Customer,
  Supplier,
  PartnerCompany AS TradingPartner,
  Material,
  _flow.BusinessArea AS BusinessArea,
  _flow.ProfitCenter AS ProfitCenter,
  CostCenter,
  _flow.Segment AS Segment,
  LiquidityItem,
  _flow.WBSElementInternalID AS WBSElementInternalID,
  _flow.WBSElementExternalID AS WBSElementExternalID,
  Fund,
  GrantID,
  cast('' as bu_partner) AS BusinessPartner,
  cast('' as bukrs) AS SourceCompanyCode,
  coalesce(Bank, cast('' as fclm_bam_bank_key)) AS Bank,
  coalesce(BankCountry, cast('' as fclm_bam_bank_country_key)) AS BankCountry,
  coalesce(BankAccountNumber, cast('' as fclm_bam_acc_num)) AS BankAccount,
  coalesce(BankAccountType, cast('' as fclm_bam_bk_acc_type_id)) AS BankAccountType,
  coalesce(IBAN, cast('' as iban)) AS IBAN,
  case when AmountInCompanyCodeCurrency > 0 then '+' else '-' end AS direction
FROM P_UnrealizedCrcyDiff AS _flow
;