P_SalesContractProcessFlow41

DDL: P_SALESCONTRACTPROCESSFLOW41 SQL: PSLSCONPROCFL41 Type: view COMPOSITE

Contract process flow level 4-1

P_SalesContractProcessFlow41 is a Composite CDS View that provides data about "Contract process flow level 4-1" in SAP S/4HANA. It reads from 2 data sources (I_AccountingDocument, P_SalesContractProcessFlow30) 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_SalesContractProcessFlow30 P_SalesContractProcessFlow30 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 PSLSCONPROCFL41 view
AbapCatalog.preserveKey true view
AbapCatalog.compiler.compareFilter true view
EndUserText.label Contract process flow level 4-1 view

Fields (21)

KeyFieldSource TableSource FieldDescription
KEY SalesContract Level30 SalesContract
KEY PrecedingDocument Level30 SubsequentDocument
KEY PrecedingDocumentItem Level30 SubsequentDocumentItem
KEY PrecedingDocumentCategory Level30 SubsequentDocumentCategory
KEY SubsequentDocument I_AccountingDocument AccountingDocument
KEY SubsequentDocumentItem Level30 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: 'PSLSCONPROCFL41'
@AbapCatalog.preserveKey:true 
@AbapCatalog.compiler.compareFilter:true
@EndUserText.label: 'Contract process flow level 4-1'
define view P_SalesContractProcessFlow41
  with parameters P_SalesContract: vbeln_von
  as select from P_SalesContractProcessFlow30(P_SalesContract: $parameters.P_SalesContract) as Level30
    inner join I_AccountingDocument as AccountingDocument
    on Level30.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  Level30.SalesContract,
  key  Level30.SubsequentDocument                             as PrecedingDocument,
  key  Level30.SubsequentDocumentItem                         as PrecedingDocumentItem,
  key  Level30.SubsequentDocumentCategory                     as PrecedingDocumentCategory,
  key  AccountingDocument.AccountingDocument                  as SubsequentDocument,
  key  Level30.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 Level30.SubsequentDocumentCategory = 'M'  --> Invoice      
or    Level30.SubsequentDocumentCategory = 'O'  --> Credit Memo
or    Level30.SubsequentDocumentCategory = 'P'  --> Debit Memo     
or    Level30.SubsequentDocumentCategory = '5'  --> Intercompany Invoice
or    Level30.SubsequentDocumentCategory = '6'  --> Intercompany Credit Memo