P_CanclnBillingDocProcFlowPM2

DDL: P_CANCLNBILLINGDOCPROCFLOWPM2 SQL: PCBILLDOCPROCPM2 Type: view CONSUMPTION

P_CanclnBillingDocProcFlowPM2 is a Consumption CDS View in SAP S/4HANA. It reads from 1 data source (I_BillingDocumentItem) and exposes 6 fields with key field BillingDocument.

Data Sources (1)

SourceAliasJoin Type
I_BillingDocumentItem LevelM2 inner

Annotations (10)

NameValueLevelField
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
VDM.private true view
VDM.viewType #CONSUMPTION view
AccessControl.authorizationCheck #NOT_REQUIRED view
AbapCatalog.sqlViewName PCBILLDOCPROCPM2 view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY BillingDocument LevelM1 BillingDocument
BillingDocumentType LevelM1 BillingDocumentType
SDDocumentCategory LevelM1 SDDocumentCategory
LevelM1Document LevelM1 LevelM1Document
LevelM1DocumentCategory LevelM1 LevelM1DocumentCategory
SalesOrganization LevelM1 SalesOrganization
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL

@VDM.private: true
@VDM.viewType: #CONSUMPTION
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AbapCatalog.sqlViewName: 'PCBILLDOCPROCPM2'
@AbapCatalog.preserveKey:true
@AbapCatalog.compiler.compareFilter:true

define view P_CanclnBillingDocProcFlowPM2
  as select distinct from P_CanclnBillingDocProcFlowM1 as LevelM1 --> Level -1 (billingdoccument)
    inner join            I_BillingDocumentItem        as LevelM2 --> Level -2
    on  LevelM2.BillingDocument = LevelM1.BillingDocument
    and LevelM2.ReferenceSDDocument != ''
{
      //Key

  key case
    when LevelM2.PrelimBillingDocument is initial
      then LevelM2.ReferenceSDDocument
    else
      LevelM2.PrelimBillingDocument
    end as LevelM2Document,

  key case
    when LevelM2.PrelimBillingDocument is initial
      then LevelM2.ReferenceSDDocumentItem
    else
      LevelM2.PrelimBillingDocumentItem
    end as LevelM2DocumentItem,

  key case
    when LevelM2.PrelimBillingDocument is initial
      then LevelM2.ReferenceSDDocumentCategory
    else
      'PBD'
    end as LevelM2DocumentCategory,

      //Billing Document

  key LevelM1.BillingDocument,
      LevelM1.BillingDocumentType,
      LevelM1.SDDocumentCategory,

      LevelM1.LevelM1Document,
      LevelM1.LevelM1DocumentCategory,

      //Organization

      LevelM1.SalesOrganization
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_BILLINGDOCUMENTITEM",
"P_CANCLNBILLINGDOCPROCFLOWM1"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/