P_RevRecgnSalesOrderVH

DDL: P_REVRECGNSALESORDERVH Type: view_entity CONSUMPTION Package: FINS_REV_REC_UI_SO

Sales Document Value Help

P_RevRecgnSalesOrderVH is a Consumption CDS View that provides data about "Sales Document Value Help" in SAP S/4HANA. It reads from 5 data sources (P_SDItemCategory, I_SalesOrganization, I_ResultsAnalysisKey, I_SalesDocumentBasic, I_SalesDocumentItem) and exposes 6 fields with key field SalesOrder. Part of development package FINS_REV_REC_UI_SO.

Data Sources (5)

SourceAliasJoin Type
P_SDItemCategory ItemCategories inner
I_SalesOrganization so inner
I_ResultsAnalysisKey tkkaa inner
I_SalesDocumentBasic vbak from
I_SalesDocumentItem vbap inner

Annotations (7)

NameValueLevelField
VDM.viewType #CONSUMPTION view
VDM.private true view
ObjectModel.representativeKey SalesOrder view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #B view
ObjectModel.usageType.sizeCategory #L view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY SalesOrder I_SalesDocumentBasic SalesDocument
CompanyCode I_SalesOrganization CompanyCode
SalesOrganization I_SalesDocumentBasic SalesOrganization
OrganizationDivision I_SalesDocumentBasic OrganizationDivision
SalesOrderType I_SalesDocumentBasic SalesDocumentType
DistributionChannel I_SalesDocumentBasic DistributionChannel
@VDM.viewType: #CONSUMPTION
@VDM.private: true

@ObjectModel.representativeKey: 'SalesOrder'
//@Analytics.technicalName: 'PREVRECSALORDVH'

@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #B
@ObjectModel.usageType.sizeCategory: #L


define view entity P_RevRecgnSalesOrderVH

  as select from I_SalesDocumentBasic as vbak
    inner join   I_SalesDocumentItem  as vbap           on vbap.SalesDocument = vbak.SalesDocument
    inner join   P_SDItemCategory     as ItemCategories on vbap.SalesDocumentItemCategory = ItemCategories.Pstyv
    inner join   I_ResultsAnalysisKey as tkkaa          on tkkaa.ResultAnalysisInternalID = vbap.ResultAnalysisInternalID
    inner join   I_SalesOrganization  as so             on so.SalesOrganization = vbak.SalesOrganization
  //    inner join   acdoca              as acdoca on acdoca.kdauf = vbak.vbeln



{
  key vbak.SalesDocument        as SalesOrder,
      so.CompanyCode            as CompanyCode,
      vbak.SalesOrganization    as SalesOrganization,
      //      acdoca.rldnr       as Ledger,

      vbak.OrganizationDivision as OrganizationDivision,
      vbak.SalesDocumentType    as SalesOrderType,
      vbak.DistributionChannel  as DistributionChannel
}

where
       vbap.ResultAnalysisInternalID        <> ' '
  and  tkkaa.RsltIsForEvtBsdRevnRecognition =  'X'
  and(
       vbak.SDDocumentCategory              =  'C'
    or vbak.SDDocumentCategory              =  'H'
  )
  //  and(

  //       vbap.pstyv  =  'TAN'

  //    or vbap.pstyv  =  'TANN'

  //    or vbap.pstyv  =  'CBEN'

  //    or vbap.pstyv  =  'CB1'

  //    or vbap.pstyv  =  'CB2'

  //    or vbap.pstyv  =  'CBTC'

  //    or vbap.pstyv  =  'TAD'

  //    or vbap.pstyv  =  'CB1C'

  //    or vbap.pstyv  =  'CB2C'

  //    or vbap.pstyv  =  'TAQ'

  //    or vbap.pstyv  =  'CBXN'

  //    or vbap.pstyv  =  'CPHD'

  //    or vbap.pstyv  =  'CBIC'

  //  )

  and(
       vbap.ItemIsBillingRelevant           =  'A'
    or vbap.ItemIsBillingRelevant           =  'B'
    or vbap.ItemIsBillingRelevant           =  'F'
    or vbap.ItemIsBillingRelevant           =  'K'
    or vbap.ItemIsBillingRelevant           =  'Y'
  )
//  and(

//       vbap.kzvbr                    =  ' '

//    or vbap.kzvbr                    =  'V'

//  )


group by
  vbak.SalesDocument,
  so.CompanyCode,
  vbak.SalesOrganization,
  vbak.OrganizationDivision,
  vbak.SalesDocumentType,
  vbak.DistributionChannel