P_SalesContractProcessFlow31

DDL: P_SALESCONTRACTPROCESSFLOW31 SQL: PSLSCONPROCFL31 Type: view COMPOSITE

Contract process flow level 3-1

P_SalesContractProcessFlow31 is a Composite CDS View that provides data about "Contract process flow level 3-1" in SAP S/4HANA. It reads from 2 data sources (I_AccountingDocument, P_SalesContractProcessFlow20) and exposes 21 fields with key fields SalesContract, PrecedingDocument, PrecedingDocumentItem, PrecedingDocumentCategory, SubsequentDocument. It has 2 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_AccountingDocument AccountingDocument inner
P_SalesContractProcessFlow20 P_SalesContractProcessFlow20 from

Parameters (1)

NameTypeDefault
P_SalesContract vbeln_von

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_UnitOfMeasure _BaseUnit $projection.BaseUnit = _BaseUnit.UnitOfMeasure
[0..1] I_Currency _StatisticsCurrency $projection.StatisticsCurrency = _StatisticsCurrency.Currency

Annotations (11)

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
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
AbapCatalog.sqlViewName PSLSCONPROCFL31 view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Contract process flow level 3-1 view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY SalesContract Level20 SalesContract
KEY PrecedingDocument Level20 SubsequentDocument
KEY PrecedingDocumentItem Level20 SubsequentDocumentItem
KEY PrecedingDocumentCategory Level20 SubsequentDocumentCategory
KEY SubsequentDocument I_AccountingDocument AccountingDocument
KEY SubsequentDocumentItem Level20 SubsequentDocumentItem
KEY SubsequentDocumentCategory
QuantityInBaseUnit
BaseUnit
NetAmount
StatisticsCurrency I_AccountingDocument Currency
SDProcessStatusDesc
FiscalYear I_AccountingDocument FiscalYear
CompanyCode I_AccountingDocument CompanyCode
MaterialDocumentYear
SemanticObject
SDDocumentCategoryName
CreationDate I_AccountingDocument AccountingDocumentCreationDate
CreationTime I_AccountingDocument CreationTime
_BaseUnit _BaseUnit
_StatisticsCurrency _StatisticsCurrency
@ClientHandling.algorithm: #SESSION_VARIABLE 
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #XL
@VDM.private: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@AbapCatalog.sqlViewName: 'PSLSCONPROCFL31'
@AbapCatalog.preserveKey:true 
@AbapCatalog.compiler.compareFilter:true
@EndUserText.label: 'Contract process flow level 3-1'
define view P_SalesContractProcessFlow31
  with parameters P_SalesContract: vbeln_von
  as select from P_SalesContractProcessFlow20(P_SalesContract: $parameters.P_SalesContract) as Level20
    inner join I_AccountingDocument as AccountingDocument
    on Level20.SubsequentDocument = AccountingDocument.OriginalReferenceDocument
    and AccountingDocument.ReferenceDocumentType = 'VBRK'    
    and LedgerGroup = ''
    left outer to one join I_SDDocumentCategory  as _SDDocumentCategory on _SDDocumentCategory.SDDocumentCategory = '+'
    association [0..1] to I_UnitOfMeasure as _BaseUnit           on $projection.BaseUnit = _BaseUnit.UnitOfMeasure
    association [0..1] to I_Currency      as _StatisticsCurrency on $projection.StatisticsCurrency = _StatisticsCurrency.Currency
{ 
  key  Level20.SalesContract,
  key  Level20.SubsequentDocument                             as PrecedingDocument,
  key  Level20.SubsequentDocumentItem                         as PrecedingDocumentItem,
  key  Level20.SubsequentDocumentCategory                     as PrecedingDocumentCategory,
  key  AccountingDocument.AccountingDocument                  as SubsequentDocument,
  key  Level20.SubsequentDocumentItem                         as SubsequentDocumentItem,
  key  cast( '+'  as vbtypl_v )                               as SubsequentDocumentCategory,
       @Semantics.quantity.unitOfMeasure: 'BaseUnit'
       cast( 0 as rfmng )                                     as QuantityInBaseUnit,
       cast( '' as meins )                                    as BaseUnit,
       @Semantics.amount.currencyCode: 'StatisticsCurrency'
       cast( 0 as rfwrt )                                     as NetAmount,
       @Semantics.currencyCode: true
       AccountingDocument.Currency                            as StatisticsCurrency,
       cast( '' as status_bez )                               as SDProcessStatusDesc,
       AccountingDocument.FiscalYear                          as FiscalYear,
       AccountingDocument.CompanyCode                         as CompanyCode,
       cast( '0000' as mjahr )                                as MaterialDocumentYear,
       cast( 'AccountingDocument' as bpf_sem_obj )            as SemanticObject,
       _SDDocumentCategory._Text[1:Language=$session.system_language].SDDocumentCategoryName  as SDDocumentCategoryName,
       AccountingDocument.AccountingDocumentCreationDate      as CreationDate,
       AccountingDocument.CreationTime,
       _BaseUnit, 
       _StatisticsCurrency
}
where Level20.SubsequentDocumentCategory = 'M'  --> Invoice      
or    Level20.SubsequentDocumentCategory = 'O'  --> Credit Memo
or    Level20.SubsequentDocumentCategory = 'P'  --> Debit Memo     
or    Level20.SubsequentDocumentCategory = '5'  --> Intercompany Invoice
or    Level20.SubsequentDocumentCategory = '6'  --> Intercompany Credit Memo