P_CollsStratPeriod

DDL: P_COLLSSTRATPERIOD Type: view COMPOSITE

P_CollsStratPeriod is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_CollectionGroup, I_CollectionsStrategy, P_CollsGroupForDDG) and exposes 10 fields with key fields BusinessPartner, CollectionSegment.

Data Sources (3)

SourceAliasJoin Type
I_CollectionGroup I_CollectionGroup inner
I_CollectionsStrategy I_CollectionsStrategy inner
P_CollsGroupForDDG P_CollsGroupForDDG from

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PCOLLSSTRATPER view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
AccessControl.personalData.blocking #BLOCKED_DATA_EXCLUDED view
VDM.viewType #COMPOSITE view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.representativeKey BusinessPartner view

Fields (10)

KeyFieldSource TableSource FieldDescription
KEY BusinessPartner BusinessPartner
KEY CollectionSegment CollectionSegment
CollectionGroup P_CollsGroupForDDG CollectionGroup
CollectionStrategy I_CollectionGroup CollectionStrategy
CollStrgyCurrency I_CollectionsStrategy CollStrgyCurrency
OverduePeriodReference1 1
DuePeriodReference1 0
clientNULLasCurrentDate
UseOverduePeriod1
UseDuePeriod1
@AbapCatalog: { sqlViewName: 'PCOLLSSTRATPER',
                compiler: { compareFilter: true },
                preserveKey: true }
@AccessControl: { authorizationCheck: #NOT_REQUIRED,
                  personalData:       { blocking: #BLOCKED_DATA_EXCLUDED } }
@VDM: { viewType: #COMPOSITE,
        private: true }
@ClientHandling: { algorithm: #SESSION_VARIABLE }
@ObjectModel: { usageType: { serviceQuality: #X,
                             sizeCategory: #L,
                             dataClass: #TRANSACTIONAL },
                representativeKey: 'BusinessPartner' }

define view P_CollsStratPeriod
  as select from P_CollsGroupForDDG
    inner join   I_CollectionGroup     on P_CollsGroupForDDG.CollectionGroup = I_CollectionGroup.CollectionGroup
    inner join   I_CollectionsStrategy on I_CollectionGroup.CollectionStrategy = I_CollectionsStrategy.CollectionStrategy

{

      // VDM Fields

  key BusinessPartner,
  key CollectionSegment,
      P_CollsGroupForDDG.CollectionGroup,
      I_CollectionGroup.CollectionStrategy,
      I_CollectionsStrategy.CollStrgyCurrency,

      // Build periods for comparison

      1                  as OverduePeriodReference1,

      case
      when I_CollectionsStrategy.CollStrgyOverduePeriod1 is not initial
      then I_CollectionsStrategy.CollStrgyOverduePeriod1 
      else 99999 end         as OverduePeriodReference2,

      case
      when I_CollectionsStrategy.CollStrgyOverduePeriod2 is not initial
      then I_CollectionsStrategy.CollStrgyOverduePeriod2 
      else 99999 end         as OverduePeriodReference3,

      case
      when I_CollectionsStrategy.CollStrgyOverduePeriod3 is not initial
      then I_CollectionsStrategy.CollStrgyOverduePeriod3 
      else 99999 end         as OverduePeriodReference4,

      case
      when I_CollectionsStrategy.CollStrgyOverduePeriod4 is not initial
      then I_CollectionsStrategy.CollStrgyOverduePeriod4 
      else 99999
      end                     as OverduePeriodReference5,
      
      0                       as DuePeriodReference1,

      case
      when I_CollectionsStrategy.CollStrgyDueDatePeriod1 is not initial
      then I_CollectionsStrategy.CollStrgyDueDatePeriod1 * -1
      else -99999 end          as DuePeriodReference2,

      case
      when I_CollectionsStrategy.CollStrgyDueDatePeriod2 is not initial
      then I_CollectionsStrategy.CollStrgyDueDatePeriod2 * -1
      else -99999 end          as DuePeriodReference3,

      case
      when I_CollectionsStrategy.CollStrgyDueDatePeriod3 is not initial
      then I_CollectionsStrategy.CollStrgyDueDatePeriod3 * -1
      else -99999 end          as DuePeriodReference4,

      case
      when I_CollectionsStrategy.CollStrgyDueDatePeriod4 is not initial
      then I_CollectionsStrategy.CollStrgyDueDatePeriod4 * -1
      else -99999 
      end                     as DuePeriodReference5,

      // Current Date

      tstmp_to_dats( tstmp_current_utctimestamp(),
                     abap_system_timezone( $session.client,'NULL' ),
                     $session.client,
                     'NULL' ) as CurrentDate,

      // Check if overdue periods should be used

      case
        when I_CollectionsStrategy.CollStrgyOverduePeriod4 = 0
      then ''
        else 'X'
      end                     as UseOverduePeriod5,
      
      case
        when I_CollectionsStrategy.CollStrgyOverduePeriod4 = 0 and I_CollectionsStrategy.CollStrgyOverduePeriod3 = 0
      then ''
        else 'X'
      end                     as UseOverduePeriod4,

      case
        when I_CollectionsStrategy.CollStrgyOverduePeriod3 = 0 and I_CollectionsStrategy.CollStrgyOverduePeriod2 = 0
      then ''
        else 'X'
      end                     as UseOverduePeriod3,

      case
        when I_CollectionsStrategy.CollStrgyOverduePeriod2 = 0 and I_CollectionsStrategy.CollStrgyOverduePeriod1 = 0
      then ''
        else 'X'
      end                     as UseOverduePeriod2,

      'X'                     as UseOverduePeriod1,
      
      'X' as UseDuePeriod1,
      
      case
        when I_CollectionsStrategy.CollStrgyDueDatePeriod2 = 0 and I_CollectionsStrategy.CollStrgyDueDatePeriod1 = 0
      then ''
        else 'X'
      end                     as UseDuePeriod2,

      case
        when I_CollectionsStrategy.CollStrgyDueDatePeriod3 = 0 and I_CollectionsStrategy.CollStrgyDueDatePeriod2 = 0
      then ''
        else 'X'
      end                     as UseDuePeriod3,

      case
        when I_CollectionsStrategy.CollStrgyDueDatePeriod4 = 0 and I_CollectionsStrategy.CollStrgyDueDatePeriod3 = 0
      then ''
        else 'X'
      end                     as UseDuePeriod4,

      case
        when I_CollectionsStrategy.CollStrgyDueDatePeriod4 = 0 
      then ''
        else 'X'
      end                     as UseDuePeriod5

}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_COLLECTIONGROUP",
"I_COLLECTIONSSTRATEGY",
"P_COLLSGROUPFORDDG"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/