VAL_Partial_clear_base

DDL: VAL_PARTIAL_CLEAR_BASE Type: view_entity

VAL_Partial_clear_base is a CDS View in SAP S/4HANA. It reads from 1 data source (I_GLAccountLineItem) and exposes 140 fields with key fields CompanyCode, FiscalYear, AccountingDocument, LedgerGLLineItem, Ledger.

Data Sources (1)

SourceAliasJoin Type
I_GLAccountLineItem acdoca from

Parameters (3)

NameTypeDefault
p_run_id cls_run_id
p_fiscal_year_period fiscalyearperiod
p_key_date fis_budat

Annotations (5)

NameValueLevelField
AccessControl.authorizationCheck #NOT_ALLOWED view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view

Fields (140)

KeyFieldSource TableSource FieldDescription
KEY CompanyCode I_GLAccountLineItem CompanyCode
KEY FiscalYear I_GLAccountLineItem FiscalYear
KEY AccountingDocument I_GLAccountLineItem AccountingDocument
KEY LedgerGLLineItem I_GLAccountLineItem LedgerGLLineItem
KEY Ledger I_GLAccountLineItem Ledger
KEY SourceLedger I_GLAccountLineItem SourceLedger
AccountingDocumentItem I_GLAccountLineItem AccountingDocumentItem
group_id wl group_id
InvoiceAccountingDocument wl accountingdocument
InvoiceAccountingDocumentItem wl accountingdocumentitem
InvoiceLedgergllineitem wl ledgergllineitem
InvoiceFiscalYear wl fiscalyear
InvoiceClearingDocument wl clearingaccountingdocument
InvoiceClearingDocFiscalYear wl clearingdocfiscalyear
InvoiceClearingDate wl clearingdate
OrganizationalChange I_GLAccountLineItem OrganizationalChange
TaxCode I_GLAccountLineItem TaxCode
TaxCountry I_GLAccountLineItem TaxCountry
ClearingAccountingDocument I_GLAccountLineItem ClearingAccountingDocument
ClearingDocFiscalYear I_GLAccountLineItem ClearingDocFiscalYear
ClearingDate I_GLAccountLineItem ClearingDate
NetDueDate I_GLAccountLineItem NetDueDate
ChartOfAccounts I_GLAccountLineItem ChartOfAccounts
BusinessTransactionCategory I_GLAccountLineItem BusinessTransactionCategory
Jrnlperiodendclosingrunloguuid remainval Jrnlperiodendclosingrunloguuid
IsReversal I_GLAccountLineItem IsReversal
GLAccount I_GLAccountLineItem GLAccount
CreationDateTime I_GLAccountLineItem CreationDateTime
SubLedgerAcctLineItemType I_GLAccountLineItem SubLedgerAcctLineItemType
OriginalPostingDate I_GLAccountLineItem PostingDate
PostingDate I_GLAccountLineItem PostingDate
DocumentDate I_GLAccountLineItem DocumentDate
AccountingDocumentCategory I_GLAccountLineItem AccountingDocumentCategory
LedgerFiscalYear I_GLAccountLineItem LedgerFiscalYear
FiscalYearPeriod I_GLAccountLineItem FiscalYearPeriod
ReferenceDocumentType I_GLAccountLineItem ReferenceDocumentType
DebitCreditCode
PostingKey I_GLAccountLineItem PostingKey
InvoiceReferenceFiscalYear I_GLAccountLineItem InvoiceReferenceFiscalYear
InvoiceReference I_GLAccountLineItem InvoiceReference
InvoiceItemReference I_GLAccountLineItem InvoiceItemReference
Supplier I_GLAccountLineItem Supplier
Customer I_GLAccountLineItem Customer
GLAccountType I_GLAccountLineItem GLAccountType
FinancialAccountType I_GLAccountLineItem FinancialAccountType
AssignmentReference I_GLAccountLineItem AssignmentReference
FiscalPeriod I_GLAccountLineItem FiscalPeriod
OffsettingAccount I_GLAccountLineItem OffsettingAccount
WBSElement I_GLAccountLineItem WBSElement
BalanceTransactionCurrency I_GLAccountLineItem BalanceTransactionCurrency
CompanyCodeCurrency I_GLAccountLineItem CompanyCodeCurrency
GlobalCurrency I_GLAccountLineItem GlobalCurrency
FreeDefinedCurrency1 I_GLAccountLineItem FreeDefinedCurrency1
FreeDefinedCurrency2 I_GLAccountLineItem FreeDefinedCurrency2
FreeDefinedCurrency3 I_GLAccountLineItem FreeDefinedCurrency3
FreeDefinedCurrency4 I_GLAccountLineItem FreeDefinedCurrency4
FreeDefinedCurrency5 I_GLAccountLineItem FreeDefinedCurrency5
FreeDefinedCurrency6 I_GLAccountLineItem FreeDefinedCurrency6
FreeDefinedCurrency7 I_GLAccountLineItem FreeDefinedCurrency7
FreeDefinedCurrency8 I_GLAccountLineItem FreeDefinedCurrency8
AmountInBalanceTransacCrcy I_GLAccountLineItem AmountInBalanceTransacCrcy
AmountInCompanyCodeCurrency I_GLAccountLineItem AmountInCompanyCodeCurrency
AmountInGlobalCurrency I_GLAccountLineItem AmountInGlobalCurrency
AmountInFreeDefinedCurrency1 I_GLAccountLineItem AmountInFreeDefinedCurrency1
AmountInFreeDefinedCurrency2 I_GLAccountLineItem AmountInFreeDefinedCurrency2
AmountInFreeDefinedCurrency3 I_GLAccountLineItem AmountInFreeDefinedCurrency3
AmountInFreeDefinedCurrency4 I_GLAccountLineItem AmountInFreeDefinedCurrency4
AmountInFreeDefinedCurrency5 I_GLAccountLineItem AmountInFreeDefinedCurrency5
AmountInFreeDefinedCurrency6 I_GLAccountLineItem AmountInFreeDefinedCurrency6
AmountInFreeDefinedCurrency7 I_GLAccountLineItem AmountInFreeDefinedCurrency7
AmountInFreeDefinedCurrency8 I_GLAccountLineItem AmountInFreeDefinedCurrency8
HouseBank
HouseBankAccount
CostCtrActivityType I_GLAccountLineItem CostCtrActivityType
WBSElementInternalID I_GLAccountLineItem WBSElementInternalID
FinancialTransactionType I_GLAccountLineItem FinancialTransactionType
JointVenture I_GLAccountLineItem JointVenture
JointVentureEquityType I_GLAccountLineItem JointVentureEquityType
JointVentureEquityGroup I_GLAccountLineItem JointVentureEquityGroup
PartnerVenture I_GLAccountLineItem PartnerVenture
JointVenturePartner I_GLAccountLineItem JointVenturePartner
JointVentureCostRecoveryCode I_GLAccountLineItem JointVentureCostRecoveryCode
ProjectNetwork I_GLAccountLineItem ProjectNetwork
RelatedNetworkActivity I_GLAccountLineItem RelatedNetworkActivity
OrderID I_GLAccountLineItem OrderID
BusinessProcess I_GLAccountLineItem BusinessProcess
SalesOrder I_GLAccountLineItem SalesDocument
SalesOrderItem I_GLAccountLineItem SalesDocumentItem
CostObject I_GLAccountLineItem CostObject
CostCenter I_GLAccountLineItem CostCenter
ProfitCenter I_GLAccountLineItem ProfitCenter
FunctionalArea I_GLAccountLineItem FunctionalArea
BusinessArea I_GLAccountLineItem BusinessArea
ControllingArea I_GLAccountLineItem ControllingArea
Segment I_GLAccountLineItem Segment
PartnerCostCenter I_GLAccountLineItem PartnerCostCenter
PartnerProfitCenter I_GLAccountLineItem PartnerProfitCenter
PartnerFunctionalArea I_GLAccountLineItem PartnerFunctionalArea
PartnerBusinessArea I_GLAccountLineItem PartnerBusinessArea
PartnerCompany I_GLAccountLineItem PartnerCompany
PartnerSegment I_GLAccountLineItem PartnerSegment
FinancialValuationObjectType I_GLAccountLineItem FinancialValuationObjectType
FinancialValuationObject I_GLAccountLineItem FinancialValuationObject
FinancialValuationSubobject I_GLAccountLineItem FinancialValuationSubobject
REBusinessEntity I_GLAccountLineItem REBusinessEntity
RealEstateBuilding I_GLAccountLineItem RealEstateBuilding
RealEstateProperty I_GLAccountLineItem RealEstateProperty
Fund I_GLAccountLineItem Fund
BudgetPeriod I_GLAccountLineItem BudgetPeriod
GrantID I_GLAccountLineItem GrantID
PubSecBudgetAccount I_GLAccountLineItem PubSecBudgetAccount
CashLedgerAccount I_GLAccountLineItem CashLedgerAccount
SponsoredProgram I_GLAccountLineItem SponsoredProgram
SponsoredClass I_GLAccountLineItem SponsoredClass
Plant I_GLAccountLineItem Plant
Product I_GLAccountLineItem Product
ShipToParty I_GLAccountLineItem ShipToParty
PartnerFund I_GLAccountLineItem PartnerFund
PartnerGrant I_GLAccountLineItem PartnerGrant
CashLedgerCompanyCode I_GLAccountLineItem CashLedgerCompanyCode
FundsCenter I_GLAccountLineItem FundsCenter
PartnerEquityGroup I_GLAccountLineItem PartnerEquityGroup
FundedProgram I_GLAccountLineItem FundedProgram
PartnerBudgetPeriod I_GLAccountLineItem PartnerBudgetPeriod
PubSecBudgetAccountCoCode I_GLAccountLineItem PubSecBudgetAccountCoCode
ServiceDocument I_GLAccountLineItem ServiceDocument
ServiceDocumentItem I_GLAccountLineItem ServiceDocumentItem
ServiceDocumentType I_GLAccountLineItem ServiceDocumentType
AccrualObjectType I_GLAccountLineItem AccrualObjectType
AccrualObject I_GLAccountLineItem AccrualObject
AccrualSubobject I_GLAccountLineItem AccrualSubobject
AccrualItemType I_GLAccountLineItem AccrualItemType
AccrualReferenceObject I_GLAccountLineItem AccrualReferenceObject
AccrualObjectLogicalSystem I_GLAccountLineItem AccrualObjectLogicalSystem
Material I_GLAccountLineItem Material
PrdcssrJournalEntryCompanyCode I_GLAccountLineItem CompanyCode
PrdcssrJournalEntryFiscalYear I_GLAccountLineItem FiscalYear
PredecessorJournalEntry I_GLAccountLineItem AccountingDocument
PredecessorJournalEntryItem I_GLAccountLineItem LedgerGLLineItem
CreditRiskClass
@AccessControl.authorizationCheck: #NOT_ALLOWED
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@ObjectModel: {
                usageType.serviceQuality: #D,
                usageType.sizeCategory: #XXL,
                usageType.dataClass: #MIXED }
define view entity VAL_Partial_clear_base
  with parameters
    p_run_id             : cls_run_id,
    p_fiscal_year_period : fiscalyearperiod,
    p_key_date           : fis_budat
  as select from           I_GLAccountLineItem       as acdoca
    left outer to one join VALLEADINGITEMWITHGROUPID as wl                on  acdoca.CompanyCode                = wl.companycode
                                                                          and acdoca.InvoiceItemReference       = wl.accountingdocumentitem
                                                                          and acdoca.InvoiceReferenceFiscalYear = wl.fiscalyear
                                                                          and acdoca.InvoiceReference           = wl.accountingdocument
                                                                          and acdoca.Ledger                     = wl.ledger
                                                                          and wl.jrnlperiodendclosingrunloguuid = $parameters.p_run_id
     left outer to one join VALUATIONREMAINVALWL         as remainval         on  acdoca.CompanyCode        = remainval.companycode
                                                                          and acdoca.LedgerGLLineItem   = remainval.ledgergllineitem
                                                                          and acdoca.FiscalYear         = remainval.Fiscalyear
                                                                          and acdoca.AccountingDocument = remainval.accountingdocument
                                                                          and acdoca.Ledger             = remainval.ledger
    left outer to one join P_BPCreditRiskClass       as CustomerRiskClass on acdoca.Customer = CustomerRiskClass.Customer
{

      //items which can potentially linked to an invoice

      //items whose linkage can be found in worklist have same group id as their linkage

      //items whose linkage can not be found in worklist have '' as group id and rebz* will be reset to initial

      //Debit items are invoices, credit items are payments

  key acdoca.CompanyCode,
  key acdoca.FiscalYear,
  key acdoca.AccountingDocument,
  key acdoca.LedgerGLLineItem,
  key acdoca.Ledger,
  key acdoca.SourceLedger,
      acdoca.AccountingDocumentItem,
      wl.group_id,
      wl.grouping_rule,
      wl.grouping_rule_step,
      wl.valuation_rule_step,
      wl.marked_for_deletion,
      wl.accountingdocument                                                                                                                as InvoiceAccountingDocument,
      wl.accountingdocumentitem                                                                                                            as InvoiceAccountingDocumentItem,
      wl.ledgergllineitem                                                                                                                  as InvoiceLedgergllineitem,
      wl.fiscalyear                                                                                                                        as InvoiceFiscalYear,
      wl.clearingaccountingdocument                                                                                                        as InvoiceClearingDocument,
      wl.clearingdocfiscalyear                                                                                                             as InvoiceClearingDocFiscalYear,
      wl.clearingdate                                                                                                                      as InvoiceClearingDate,
      acdoca.OrganizationalChange,
      acdoca.TaxCode,
      acdoca.TaxCountry,
      acdoca.ClearingAccountingDocument,
      acdoca.ClearingDocFiscalYear,
      acdoca.ClearingDate,
      acdoca.NetDueDate,
      acdoca.ChartOfAccounts,
      acdoca.BusinessTransactionCategory,
      remainval.finclosinglineitemprocessstep,
      remainval.Jrnlperiodendclosingrunloguuid,
      //Debitor: Debit items are invoices, credit items are payments

      //Creditor: Credit items are invoices, debit items are payments

      //others: Debit items are invoices, credit items are payments

      case acdoca.FinancialAccountType
      when 'K'
      then

       case  acdoca._PostingKey.DebitCreditCode
         when 'S'
         then
           case  when acdoca.FiscalYearPeriod = $parameters.p_fiscal_year_period
           then 'PAYMENT_CURRENT'
           when acdoca.FiscalYearPeriod < $parameters.p_fiscal_year_period
           then 'PAYMENT_PREVIOUS'
         end
         else 'INVOICE' end

      else

      case  acdoca._PostingKey.DebitCreditCode
      when 'H'
      then
       case  when acdoca.FiscalYearPeriod = $parameters.p_fiscal_year_period
       then 'PAYMENT_CURRENT'
       when acdoca.FiscalYearPeriod < $parameters.p_fiscal_year_period
       then 'PAYMENT_PREVIOUS'
      end
      else 'INVOICE' end

      end                                                                                                                                  as line_type,
      cast( case
      when acdoca.IsReversed = 'X'  and  acdoca.ClearingDate is not initial and acdoca.ClearingDate <= $parameters.p_key_date then 'R'
      else '' end as  cls_line_item_type )                                                                                                 as financialclosinglineitemtype,

      case
        when acdoca.ClearingDate is not initial and acdoca.ClearingDate <= $parameters.p_key_date
        then 'X'
        else ' '
      end                                                                                                                                  as IsClearedAtKeydate,
      //filtering

      acdoca.IsReversal,
      acdoca.GLAccount,
      acdoca.CreationDateTime,
      acdoca.SubLedgerAcctLineItemType,
      acdoca.PostingDate                                                                                                                   as OriginalPostingDate,
      acdoca.PostingDate,
      acdoca.DocumentDate,
      acdoca.AccountingDocumentCategory,
      acdoca.LedgerFiscalYear,
      acdoca.FiscalYearPeriod,
      acdoca.ReferenceDocumentType,
      acdoca._PostingKey.DebitCreditCode,
      acdoca.PostingKey,
      acdoca.InvoiceReferenceFiscalYear,
      acdoca.InvoiceReference,
      acdoca.InvoiceItemReference,

      acdoca.Supplier,
      acdoca.Customer,

      //grouping

      acdoca.GLAccountType,
      acdoca.FinancialAccountType, //corresponding wl field name ACCOUNT_TYPE

      acdoca.AssignmentReference,
      case when acdoca.Customer is not initial
      then coalesce( acdoca._Customer.CustomerCorporateGroup, ' ' )
      else
      coalesce( acdoca._Supplier.SupplierCorporateGroup, ' ' ) end                                                                         as CUSTOMER_SUPPLIER_GROUP_KEY,
      acdoca.FiscalPeriod,
      acdoca.OffsettingAccount,
      acdoca.WBSElement,

      acdoca.BalanceTransactionCurrency,
      acdoca.CompanyCodeCurrency,
      acdoca.GlobalCurrency,
      acdoca.FreeDefinedCurrency1,
      acdoca.FreeDefinedCurrency2,
      acdoca.FreeDefinedCurrency3,
      acdoca.FreeDefinedCurrency4,
      acdoca.FreeDefinedCurrency5,
      acdoca.FreeDefinedCurrency6,
      acdoca.FreeDefinedCurrency7,
      acdoca.FreeDefinedCurrency8,
      @Semantics.amount.currencyCode: 'BalanceTransactionCurrency'
      acdoca.AmountInBalanceTransacCrcy,
      @Semantics.amount.currencyCode: 'CompanyCodeCurrency'
      acdoca.AmountInCompanyCodeCurrency,
      @Semantics.amount.currencyCode: 'GlobalCurrency'
      acdoca.AmountInGlobalCurrency,
      @Semantics.amount.currencyCode: 'FreeDefinedCurrency1'
      acdoca.AmountInFreeDefinedCurrency1,
      @Semantics.amount.currencyCode: 'FreeDefinedCurrency2'
      acdoca.AmountInFreeDefinedCurrency2,
      @Semantics.amount.currencyCode: 'FreeDefinedCurrency3'
      acdoca.AmountInFreeDefinedCurrency3,
      @Semantics.amount.currencyCode: 'FreeDefinedCurrency4'
      acdoca.AmountInFreeDefinedCurrency4,
      @Semantics.amount.currencyCode: 'FreeDefinedCurrency5'
      acdoca.AmountInFreeDefinedCurrency5,
      @Semantics.amount.currencyCode: 'FreeDefinedCurrency6'
      acdoca.AmountInFreeDefinedCurrency6,
      @Semantics.amount.currencyCode: 'FreeDefinedCurrency7'
      acdoca.AmountInFreeDefinedCurrency7,
      @Semantics.amount.currencyCode: 'FreeDefinedCurrency8'
      acdoca.AmountInFreeDefinedCurrency8,

      case acdoca.GLAccountType when 'C' then acdoca.HouseBank else ' ' end                                                                as HouseBank,
      case acdoca.GLAccountType when 'C' then acdoca.HouseBankAccount else ' ' end                                                         as HouseBankAccount,
      acdoca.CostCtrActivityType,
      acdoca.WBSElementInternalID,
      acdoca.FinancialTransactionType,
      acdoca.JointVenture,
      acdoca.JointVentureEquityType,
      acdoca.JointVentureEquityGroup,
      acdoca.PartnerVenture,
      acdoca.JointVenturePartner,
      acdoca.JointVentureCostRecoveryCode,
      acdoca.ProjectNetwork,
      acdoca.RelatedNetworkActivity,
      acdoca.OrderID,
      acdoca.BusinessProcess,
      acdoca.SalesDocument                                                                                                                 as SalesOrder,
      acdoca.SalesDocumentItem                                                                                                             as SalesOrderItem,
      acdoca.CostObject,
      acdoca.CostCenter,
      acdoca.ProfitCenter,
      acdoca.FunctionalArea,
      acdoca.BusinessArea,
      acdoca.ControllingArea,
      acdoca.Segment,
      acdoca.PartnerCostCenter,
      acdoca.PartnerProfitCenter,
      acdoca.PartnerFunctionalArea,
      acdoca.PartnerBusinessArea,
      acdoca.PartnerCompany,
      acdoca.PartnerSegment,
      acdoca.FinancialValuationObjectType,
      acdoca.FinancialValuationObject,
      acdoca.FinancialValuationSubobject,
      acdoca.REBusinessEntity,
      acdoca.RealEstateBuilding,
      acdoca.RealEstateProperty,
      acdoca.Fund,
      acdoca.BudgetPeriod,
      acdoca.GrantID,
      acdoca.PubSecBudgetAccount,
      acdoca.CashLedgerAccount,
      acdoca.SponsoredProgram,
      acdoca.SponsoredClass,
      acdoca.Plant,
      acdoca.Product,
      acdoca.ShipToParty,
      acdoca.PartnerFund,
      acdoca.PartnerGrant,
      acdoca.CashLedgerCompanyCode,
      acdoca.FundsCenter,
      acdoca.PartnerEquityGroup,
      acdoca.FundedProgram,
      acdoca.PartnerBudgetPeriod,
      acdoca.PubSecBudgetAccountCoCode,
      acdoca.ServiceDocument,
      acdoca.ServiceDocumentItem,
      acdoca.ServiceDocumentType,
      acdoca.AccrualObjectType,
      acdoca.AccrualObject,
      acdoca.AccrualSubobject,
      acdoca.AccrualItemType,
      acdoca.AccrualReferenceObject,
      acdoca.AccrualObjectLogicalSystem,
      acdoca.Material,
      cast(
      case when acdoca.RelatedNetworkActivity is not initial
      then concat(concat(acdoca.OrderCategory, '/' ), acdoca.AccountAssignment )
      else '' end        as cls_run_nplnr_vorgn_helper )                                                                                   as relatednetworkactivityinternal,

      acdoca.CompanyCode                                                                                                                   as PrdcssrJournalEntryCompanyCode,
      acdoca.FiscalYear                                                                                                                    as PrdcssrJournalEntryFiscalYear,
      acdoca.AccountingDocument                                                                                                            as PredecessorJournalEntry,
      acdoca.LedgerGLLineItem                                                                                                              as PredecessorJournalEntryItem,


      cast ( coalesce( coalesce(acdoca._Customer._CustomerToBusinessPartner._BusinessPartner.BusinessPartner,
                      acdoca._Supplier._SupplierToBusinessPartner._BusinessPartner.BusinessPartner), '')   as bu_partner preserving type ) as BusinessPartner,
      cast( coalesce( CustomerRiskClass._CreditManagement.CreditRiskClass, '') as ukm_risk_class )                                         as CreditRiskClass
}
where
  (
       acdoca.InvoiceReference                            is not initial
    or acdoca.InvoiceItemReference                        is not initial
    or acdoca.InvoiceReferenceFiscalYear                  is not initial
  )
  and
  //residual items

       acdoca.FollowOnDocumentType                        <> 'V'
  and(
       acdoca.Supplier                                    is initial
    or acdoca._SupplierCompany.IsBusinessPurposeCompleted =  ''
  )
  and(
       acdoca.Customer                                    is initial
    or acdoca._CustomerCompany.IsBusinessPurposeCompleted =  ''
  )