VALLEADINGITEMWITHGROUPID

DDL: VALLEADINGITEMWITHGROUPID SQL: VALLEADGROUPID Type: view

VALLEADINGITEMWITHGROUPID is a CDS View in SAP S/4HANA. It reads from 2 data sources (VALUATIONLEADINGITEM, VALUATIONREMAINVALWL) and exposes 7 fields with key fields ledger, companycode, Fiscalyear.

Data Sources (2)

SourceAliasJoin Type
VALUATIONLEADINGITEM invoiceList inner
VALUATIONREMAINVALWL wl from

Annotations (8)

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

Fields (7)

KeyFieldSource TableSource FieldDescription
KEY ledger VALUATIONREMAINVALWL ledger
KEY companycode VALUATIONREMAINVALWL companycode
KEY Fiscalyear VALUATIONREMAINVALWL Fiscalyear
group_id VALUATIONREMAINVALWL group_id
Jrnlperiodendclosingrunloguuid VALUATIONREMAINVALWL Jrnlperiodendclosingrunloguuid
clearingdate VALUATIONREMAINVALWL clearingdate
IsClearedAtKeyDate VALUATIONREMAINVALWL is_cleared_at_keydate
@AbapCatalog.sqlViewName: 'VALLEADGROUPID'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel: {
                usageType.serviceQuality: #D,
                usageType.sizeCategory: #XXL,
                usageType.dataClass: #MIXED }
@ClientHandling.algorithm: #SESSION_VARIABLE
define view VALLEADINGITEMWITHGROUPID
  as select from VALUATIONREMAINVALWL          as wl
    inner join            VALUATIONLEADINGITEM as invoiceList on  invoiceList.accountingdocument             = wl.accountingdocument
                                                              and invoiceList.ledgergllineitem               = wl.ledgergllineitem
                                                              and invoiceList.ledger                         = wl.ledger
                                                              and invoiceList.companycode                    = wl.companycode
                                                              and invoiceList.Fiscalyear                     = wl.Fiscalyear
                                                              and invoiceList.Jrnlperiodendclosingrunloguuid = wl.Jrnlperiodendclosingrunloguuid
                                                              and invoiceList.finclosinglineitemprocessstep  = wl.finclosinglineitemprocessstep
{
      //select group id from item which has the minimal docln in one splitted document group

      //e.g.

      // groupID/accountingdocument/accountingdocumentitem/docln

      // ABC/1/1/1

      // DEF/1/1/2

      // With this data set the first line(ABC/1/1/1) will be selected

  key wl.accountingdocument,
  key invoiceList.accountingdocumentitem,
  key wl.ledger,
  key wl.companycode,
  key wl.Fiscalyear,
      wl.group_id,
      wl.grouping_rule,
      wl.grouping_rule_step,
      wl.Jrnlperiodendclosingrunloguuid,
      wl.ledgergllineitem,
      wl.marked_for_deletion,
      wl.valuation_rule_step,
      wl.clearingdate,
      wl.clearingaccountingdocument,
      wl.clearingdocfiscalyear,
      wl.is_cleared_at_keydate as IsClearedAtKeyDate
}
where
  wl.finclosinglineitemprocessstep = 'PRE_SELECT'