P_APCshDiscDocument2

DDL: P_APCSHDISCDOCUMENT2 SQL: PFIAPCSHDISDOC2 Type: view COMPOSITE Package: FINS_FIS_AP_APPS

Account Payable Cash Discount Document

P_APCshDiscDocument2 is a Composite CDS View that provides data about "Account Payable Cash Discount Document" in SAP S/4HANA. It reads from 1 data source (P_APCshDiscDocument1) and exposes 39 fields with key fields CompanyCode, AccountingDocument, FiscalYear, AccountingDocumentItem. It has 1 association to related views. Part of development package FINS_FIS_AP_APPS.

Data Sources (1)

SourceAliasJoin Type
P_APCshDiscDocument1 P_APCshDiscDocument1 from

Parameters (1)

NameTypeDefault
P_KeyDate abap.dats

Associations (1)

CardinalityTargetAliasCondition
[0..1] I_ToleranceGroup _ToleranceGroup $projection.CompanyCode = _ToleranceGroup.CompanyCode and $projection.APARToleranceGroup = _ToleranceGroup.APARToleranceGroup

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PFIAPCSHDISDOC2 view
VDM.private true view
VDM.viewType #COMPOSITE view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.ignorePropagatedAnnotations true view

Fields (39)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode P_APCshDiscDocument1 CompanyCode Receiver Company Code
KEY AccountingDocument AccountingDocument Journal Entry
KEY FiscalYear FiscalYear G/L Fiscal Year
KEY AccountingDocumentItem AccountingDocumentItem Posting View Item
DueCalculationBaseDate DueCalculationBaseDate Due Calculation Base Date
CashDiscountBaseAmount CashDiscountBaseAmount Cash Dscnt Base Amt
CashDiscount1Percent CashDiscount1Percent Disc. Percent 1
CashDiscount2Percent CashDiscount2Percent Disc. Percent 2
IsSalesRelated IsSalesRelated Is Sales Related
DebitCreditCode DebitCreditCode Single-Character Flag
CashDiscountAmount CashDiscountAmount CD Amount
Supplier Supplier Supplier
ClearingDate ClearingDate Clearing Date
FinancialAccountType FinancialAccountType Fin. Account Type
ClearingAccountingDocument ClearingAccountingDocument Clearing Journal Entry
PaymentTerms PaymentTerms Pyt Terms
PaymentBlockingReason PaymentBlockingReason Pmnt block
ClearingDocFiscalYear ClearingDocFiscalYear Fiscal Year of Clearing Journal Entry
CashDiscount1Days CashDiscount1Days Days from Baseline Date for Payment
CashDiscount2Days CashDiscount2Days Days from Baseline Date for Payment
PostingDate PostingDate Posting Date for GR
NetPaymentDays NetPaymentDays Net Pmt Terms Period
AmountInTransactionCurrency AmountInTransactionCurrency Pt Crcy Amt
TransactionCurrency TransactionCurrency Transaction Currency
DocumentDate DocumentDate Journal Entry Date
ValueDate ValueDate Value Date
KeyDate KeyDate Maturity Key Date
DaysDifference DaysDifference
AccountingDocumentCategory AccountingDocumentCategory Journal Entry Category
SpecialGLCode SpecialGLCode Special G/L Ind
APARToleranceGroup APARToleranceGroup Tolerance Group
GraceDays _ToleranceGroup GraceDays
ArrearsBaseDate _ToleranceGroup ArrearsDaysBaseDateDetn
FixedCashDiscountendasFixedCashDiscount
_Supplier _Supplier
_CompanyCode _CompanyCode
_AccountingDocument _AccountingDocument
_CustomerPaymentTerms _CustomerPaymentTerms
_SupplierCompany _SupplierCompany

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_APCshDiscDocument2.
-- 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: PFIAPCSHDISDOC2
-- Parameters: P_KeyDate : abap.dats

CREATE VIEW P_APCshDiscDocument2 AS
SELECT
  P_APCshDiscDocument1.CompanyCode AS CompanyCode,
  AccountingDocument,
  FiscalYear,
  AccountingDocumentItem,
  DueCalculationBaseDate,
  CashDiscountBaseAmount,
  CashDiscount1Percent,
  CashDiscount2Percent,
  IsSalesRelated,
  DebitCreditCode,
  CashDiscountAmount,
  Supplier,
  ClearingDate,
  FinancialAccountType,
  ClearingAccountingDocument,
  PaymentTerms,
  PaymentBlockingReason,
  ClearingDocFiscalYear,
  CashDiscount1Days,
  CashDiscount2Days,
  PostingDate,
  NetPaymentDays,
  AmountInTransactionCurrency,
  TransactionCurrency,
  DocumentDate,
  ValueDate,
  KeyDate,
  DaysDifference,
  AccountingDocumentCategory,
  SpecialGLCode,
  APARToleranceGroup,
  _ToleranceGroup.GraceDays AS GraceDays,
  _ToleranceGroup.ArrearsDaysBaseDateDetn AS ArrearsBaseDate,
  (case P_APCshDiscDocument1.FixedCashDiscount when '' then case when _ToleranceGroup.FixedCashDiscount is null then '' when _ToleranceGroup.FixedCashDiscount = '0' then '' when _ToleranceGroup.FixedCashDiscount = '*' then '' else _ToleranceGroup.FixedCashDiscount end else P_APCshDiscDocument1.FixedCashDiscount end) as FixedCashDiscount AS FixedCashDiscountendasFixedCashDiscount
FROM P_APCshDiscDocument1
LEFT OUTER JOIN I_ToleranceGroup AS _ToleranceGroup ON CompanyCode = _ToleranceGroup.CompanyCode AND APARToleranceGroup = _ToleranceGroup.APARToleranceGroup  -- association [0..1]
;