I_APProcessFlowDocumentVH

DDL: I_APPROCESSFLOWDOCUMENTVH SQL: IAPPROCFLOWDOC Type: view COMPOSITE Package: ODATA_PROCESS_FLOW_AP

Document Number

I_APProcessFlowDocumentVH is a Composite CDS View that provides data about "Document Number" in SAP S/4HANA. It reads from 8 data sources and exposes 195 fields with key fields SourceLedger, Documentid, DocumentType, FiscalYear, CompanyCode. It has 2 associations to related views. Part of development package ODATA_PROCESS_FLOW_AP.

Data Sources (8)

SourceAliasJoin Type
I_PurchaseOrder _PurchaseOrder inner
I_OperationalAcctgDocItem bseg union
I_OperationalAcctgDocItem clrg inner
I_EarmarkedFundsDocument I_EarmarkedFundsDocument union
I_JournalEntrySemanticKeyVH I_JournalEntrySemanticKeyVH union
I_PurchaseOrder I_PurchaseOrder from
I_SupplierInvoice I_SupplierInvoice union
I_PurchasingDocumentHistoryBsc PurchasingDocumentHistory union

Associations (2)

CardinalityTargetAliasCondition
[0..1] I_APProcessFlowDocTypeText _APProcessFlowDocTypeText _APProcessFlowDocTypeText.Language = $session.system_language and _APProcessFlowDocTypeText.ProcessType = 'AP' and _APProcessFlowDocTypeText.DocumentType = 'F'
[1..1] I_PurchasingDocumentItem _PurchaseOrderItem _PurchaseOrderItem.PurchasingDocument = PurchasingDocumentHistory.PurchasingDocument and _PurchaseOrderItem.PurchasingDocumentItem = PurchasingDocumentHistory.PurchasingDocumentItem

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName IAPPROCFLOWDOC view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.dataClass #MIXED view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.dataCategory #VALUE_HELP view
VDM.viewType #COMPOSITE view
EndUserText.label Document Number view
AccessControl.personalData.blocking #REQUIRED view
Search.searchable true view

Fields (195)

KeyFieldSource TableSource FieldDescription
KEY SourceLedger
KEY Documentid
KEY DocumentType
KEY FiscalYear
KEY CompanyCode
KEY Ledger
Supplier
ParentProcessFlowNodeDocItem
DocumentTypeDescription _APProcessFlowDocTypeText DocumentTypeDescription
DocumentReferenceID
PurchasingGroup PurchasingGroup
PurchasingOrganization PurchasingOrganization
PurchaseOrderType PurchaseOrderType
Plant
StorageLocation
GoodsMovementType
CustomerBasicAuthorizationGrp
SupplierBasicAuthorizationGrp
BPPersonAuthorizationGroup
IsEndOfPurposeBlocked
FinancialAccountType
BusinessArea
FunctionalArea
Segment
IssuingOrReceivingPlant
IsIssgOrRcvgStorLocAuthChkActv
IssuingOrReceivingStorageLoc
Customer
StockOwner
IsStorLocAuthznCheckActive
AuthorizationGroup _Supplier AuthorizationGroup
EarmarkedFundsDocumentCategory
EarmarkedFundsDocumentType
KEY Documentid
KEY DocumentType
KEY FiscalYear
KEY CompanyCode CompanyCode
KEY Ledger
Supplier Supplier
ParentProcessFlowNodeDocItem
DocumentTypeDescription _APProcessFlowDocTypeText DocumentTypeDescription
DocumentReferenceID I_PurchasingDocumentHistoryBsc PurchasingDocument
PurchasingGroup
PurchasingOrganization
PurchaseOrderType
Plant _PurchaseOrderItem Plant
StorageLocation
GoodsMovementType GoodsMovementType
CustomerBasicAuthorizationGrp
SupplierBasicAuthorizationGrp _Supplier AuthorizationGroup
BPPersonAuthorizationGroup
IsEndOfPurposeBlocked
FinancialAccountType
BusinessArea
FunctionalArea
Segment
IssuingOrReceivingPlant
IsIssgOrRcvgStorLocAuthChkActv
IssuingOrReceivingStorageLoc
Customer Customer
StockOwner
IsStorLocAuthznCheckActive
AuthorizationGroup
EarmarkedFundsDocumentCategory
EarmarkedFundsDocumentType
KEY Documentid
KEY DocumentType
KEY FiscalYear
KEY CompanyCode CompanyCode
KEY Ledger
Supplier
ParentProcessFlowNodeDocItem
DocumentTypeDescription _APProcessFlowDocTypeText DocumentTypeDescription
DocumentReferenceID
PurchasingGroup
PurchasingOrganization
PurchaseOrderType
Plant
StorageLocation
GoodsMovementType
CustomerBasicAuthorizationGrp
SupplierBasicAuthorizationGrp
BPPersonAuthorizationGroup
IsEndOfPurposeBlocked IsEndOfPurposeBlocked
FinancialAccountType
BusinessArea
FunctionalArea
Segment
IssuingOrReceivingPlant
IsIssgOrRcvgStorLocAuthChkActv
IssuingOrReceivingStorageLoc
Customer
StockOwner
IsStorLocAuthznCheckActive
AuthorizationGroup _Supplier AuthorizationGroup
EarmarkedFundsDocumentCategory
EarmarkedFundsDocumentType
DocumentType3keySourceLedger
KEY Documentid
KEY DocumentType
KEY FiscalYear
KEY CompanyCode CompanyCode
KEY Ledger Ledger
KEY Supplier
ParentProcessFlowNodeDocItem
DocumentTypeDescription _APProcessFlowDocTypeText DocumentTypeDescription
DocumentReferenceID
PurchasingGroup
PurchasingOrganization
PurchaseOrderType
Plant
StorageLocation
GoodsMovementType
CustomerBasicAuthorizationGrp
SupplierBasicAuthorizationGrp
BPPersonAuthorizationGroup
IsEndOfPurposeBlocked
FinancialAccountType
BusinessArea
FunctionalArea
Segment
IssuingOrReceivingPlant
IsIssgOrRcvgStorLocAuthChkActv
IssuingOrReceivingStorageLoc
Customer
StockOwner
IsStorLocAuthznCheckActive
AuthorizationGroup
EarmarkedFundsDocumentCategory
EarmarkedFundsDocumentType
KEY Documentid I_OperationalAcctgDocItem AccountingDocument
KEY DocumentType
KEY FiscalYear
KEY CompanyCode I_OperationalAcctgDocItem CompanyCode
KEY Ledger
KEY Supplier
KEY ParentProcessFlowNodeDocItem I_OperationalAcctgDocItem AccountingDocumentItem
DocumentTypeDescription _APProcessFlowDocTypeText DocumentTypeDescription
DocumentReferenceID
PurchasingGroup
PurchasingOrganization
PurchaseOrderType
Plant
StorageLocation
GoodsMovementType
CustomerBasicAuthorizationGrp
SupplierBasicAuthorizationGrp
BPPersonAuthorizationGroup
IsEndOfPurposeBlocked
FinancialAccountType I_OperationalAcctgDocItem FinancialAccountType
BusinessArea I_OperationalAcctgDocItem BusinessArea
FunctionalArea I_OperationalAcctgDocItem FunctionalArea
Segment I_OperationalAcctgDocItem Segment
IssuingOrReceivingPlant
IsIssgOrRcvgStorLocAuthChkActv
IssuingOrReceivingStorageLoc
Customer
StockOwner
IsStorLocAuthznCheckActive
AuthorizationGroup
EarmarkedFundsDocumentCategory
EarmarkedFundsDocumentType
KEY Documentid EarmarkedFundsDocument
KEY DocumentType
KEY FiscalYear
KEY CompanyCode CompanyCode
KEY Ledger
KEY Supplier
KEY ParentProcessFlowNodeDocItem
DocumentTypeDescription _APProcessFlowDocTypeText DocumentTypeDescription
DocumentReferenceID EarmarkedFundsDocReference
PurchasingGroup
PurchasingOrganization
PurchaseOrderType
Plant
StorageLocation
GoodsMovementType
CustomerBasicAuthorizationGrp
SupplierBasicAuthorizationGrp
BPPersonAuthorizationGroup
IsEndOfPurposeBlocked
FinancialAccountType
BusinessArea
FunctionalArea
Segment
IssuingOrReceivingPlant
IsIssgOrRcvgStorLocAuthChkActv
IssuingOrReceivingStorageLoc
Customer
StockOwner
IsStorLocAuthznCheckActive
AuthorizationGroup
EarmarkedFundsDocumentCategory EarmarkedFundsDocumentCategory
EarmarkedFundsDocumentType EarmarkedFundsDocumentType
CompanyCodeName _CompanyCode CompanyCodeName
@AbapCatalog.sqlViewName: 'IAPPROCFLOWDOC'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.dataClass:  #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.dataCategory: #VALUE_HELP
@VDM.viewType: #COMPOSITE
@EndUserText.label: 'Document Number'
@AccessControl.personalData.blocking: #REQUIRED
@Search.searchable: true
@Consumption.dbHints:['NO_CYCLIC_JOIN']
define view I_APProcessFlowDocumentVH

  as select from I_PurchaseOrder

  association [0..1] to I_APProcessFlowDocTypeText as _APProcessFlowDocTypeText on  _APProcessFlowDocTypeText.Language     = $session.system_language
                                                                                and _APProcessFlowDocTypeText.ProcessType  = 'AP'
                                                                                and _APProcessFlowDocTypeText.DocumentType = 'F'

{
  key cast( '' as fins_ledger_pers )                        as SourceLedger,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
  key cast (PurchaseOrder as farp_dispprocflow_belnr_d)     as Documentid,
  key cast(_APProcessFlowDocTypeText.DocumentType as dokar) as DocumentType,
  key cast('0000' as fis_gjahr preserving type )            as FiscalYear,
  key cast(CompanyCode as fis_bukrs)                        as CompanyCode,
      @Consumption.hidden: true 
  key cast ('' as fins_ledger)                              as Ledger,
  
      @Consumption.hidden: true
      cast ('' as elifn)                                    as Supplier,
      cast ('' as buzei)                                    as ParentProcessFlowNodeDocItem,
      _APProcessFlowDocTypeText.DocumentTypeDescription     as DocumentTypeDescription,
      cast('' as xblnr1)                                    as DocumentReferenceID,

      @Consumption.hidden: true
      PurchasingGroup,
      @Consumption.hidden: true
      PurchasingOrganization,
      @Consumption.hidden: true
      PurchaseOrderType,
      @Consumption.hidden: true
      cast ('' as werks_d)                                  as Plant,
      @Consumption.hidden: true
      cast ('' as lgort_d)                                  as StorageLocation,
      @Consumption.hidden: true
      cast ('' as bwart)                                    as GoodsMovementType,
      @Consumption.hidden: true
      cast ('' as brgru)                                    as CustomerBasicAuthorizationGrp,
      @Consumption.hidden: true
      cast ('' as brgru)                                    as SupplierBasicAuthorizationGrp,
      @Consumption.hidden: true
      cast ('' as brgru)                                    as BPPersonAuthorizationGroup,
      @Consumption.hidden: true
      cast ('' as eopblocked)                               as IsEndOfPurposeBlocked,
      @Consumption.hidden: true
      cast ('' as koart)                                    as FinancialAccountType,
      @Consumption.hidden: true
      cast ('' as gsber)                                    as BusinessArea,
      @Consumption.hidden: true
      cast ('' as fkber_long)                               as FunctionalArea,
      @Consumption.hidden: true
      cast ('' as  fb_segment)                              as Segment,
      @Consumption.hidden: true
      cast ('' as werks_d)                                  as IssuingOrReceivingPlant,
      @Consumption.hidden: true
      cast ('' as xblgo)                                    as IsIssgOrRcvgStorLocAuthChkActv,
      @Consumption.hidden: true
      cast ('' as umlgo)                                    as IssuingOrReceivingStorageLoc,
      @Consumption.hidden: true
      cast ('' as ekunn)                                    as Customer,
      @Consumption.hidden: true
      cast ('' as nsdm_add_spcl_stock_supplier)             as StockOwner,
      @Consumption.hidden: true
      cast ('' as xblgo)                                    as IsStorLocAuthznCheckActive,
      @Consumption.hidden: true
      _Supplier.AuthorizationGroup,
      @Consumption.hidden: true
      cast(''  as kbltyp)                                   as EarmarkedFundsDocumentCategory,
      @Consumption.hidden: true
      cast(''  as fmre_blart)                               as EarmarkedFundsDocumentType,      
      _CompanyCode.CompanyCodeName
      
//      ,

//      

//      @Consumption.hidden: true

//      cast(''  as bwkey)                                    as ValuationArea,

//      @Consumption.hidden: true

//      cast(''  as auart)                                    as SalesDocumentType,

//      @Consumption.hidden: true

//      cast(''  as vkorg )                                   as SalesOrderSalesOrganization,

//      @Consumption.hidden: true

//      cast(''  as vtweg)                                    as SalesOrderDistributionChannel,

//      @Consumption.hidden: true

//      cast(''  as spart)                                    as OrganizationDivision,

//      

//      @Consumption.hidden: true

//      cast(''  as vkorg )                                   as SalesOrganization,

//      @Consumption.hidden: true

//      cast(''  as crmt_distribution_channel   )             as DistributionChannel,

//      @Consumption.hidden: true

//      cast(''  as crmt_division   )                         as Division,

//      @Consumption.hidden: true

//      cast(''  as vkbur   )                                 as SalesOffice,

//      @Consumption.hidden: true

//      cast(''  as vkgrp   )                                 as SalesGroup

}

union 
  select from I_PurchasingDocumentHistoryBsc as PurchasingDocumentHistory
    inner join   I_PurchaseOrder                as _PurchaseOrder on PurchasingDocumentHistory.PurchasingDocument = _PurchaseOrder.PurchaseOrder

  association [1..1] to I_PurchasingDocumentItem as _PurchaseOrderItem on  _PurchaseOrderItem.PurchasingDocument     = PurchasingDocumentHistory.PurchasingDocument
                                                                       and _PurchaseOrderItem.PurchasingDocumentItem = PurchasingDocumentHistory.PurchasingDocumentItem
                                                         
  association [0..1] to I_APProcessFlowDocTypeText as _APProcessFlowDocTypeText on  _APProcessFlowDocTypeText.Language     = $session.system_language
                                                                                and _APProcessFlowDocTypeText.ProcessType  = 'AP'
                                                                                and _APProcessFlowDocTypeText.DocumentType = '1'

{
  key cast( '' as fins_ledger_pers )                           as SourceLedger,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
  key cast (PurchasingDocumentHistory.PurchasingHistoryDocument as farp_dispprocflow_belnr_d)     as Documentid,
  key cast(_APProcessFlowDocTypeText.DocumentType as dokar)    as DocumentType,
  key cast(PurchasingDocumentHistory.PurchasingHistoryDocumentYear as fis_gjahr)                  as FiscalYear,
  key CompanyCode,
      @Consumption.hidden: true
  key cast ('' as fins_ledger)                                 as Ledger,  
  
      @Consumption.hidden: true
      Supplier,
      cast ('' as buzei)                                       as ParentProcessFlowNodeDocItem,
      _APProcessFlowDocTypeText.DocumentTypeDescription        as DocumentTypeDescription,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
      PurchasingDocumentHistory.PurchasingDocument             as DocumentReferenceID,


      @Consumption.hidden: true
      ''                                                       as PurchasingGroup,
      @Consumption.hidden: true
      ''                                                       as PurchasingOrganization,
      @Consumption.hidden: true
      ''                                                       as PurchaseOrderType,
      @Consumption.hidden: true
      _PurchaseOrderItem.Plant                                 as Plant,
      @Consumption.hidden: true
      ''                                                       as StorageLocation,
      @Consumption.hidden: true
      GoodsMovementType,
      @Consumption.hidden: true
      ''                                                       as CustomerBasicAuthorizationGrp,
      @Consumption.hidden: true
      _Supplier.AuthorizationGroup                             as SupplierBasicAuthorizationGrp,
      @Consumption.hidden: true
      ''                                                       as BPPersonAuthorizationGroup,
      @Consumption.hidden: true
      ''                                                       as IsEndOfPurposeBlocked,
      @Consumption.hidden: true
      ''                                                       as FinancialAccountType,
      @Consumption.hidden: true
      ''                                                       as BusinessArea,
      @Consumption.hidden: true
      ''                                                       as FunctionalArea,
      @Consumption.hidden: true
      ''                                                       as Segment,
      @Consumption.hidden: true
      ''                                                       as IssuingOrReceivingPlant,
      @Consumption.hidden: true
      ''                                                       as IsIssgOrRcvgStorLocAuthChkActv,
      @Consumption.hidden: true
      ''                                                       as IssuingOrReceivingStorageLoc,
      @Consumption.hidden: true
      Customer,
      @Consumption.hidden: true
      ''                                                       as StockOwner,
      @Consumption.hidden: true
      ''                                                       as IsStorLocAuthznCheckActive,
      @Consumption.hidden: true
      ''                                                       as AuthorizationGroup,
      @Consumption.hidden: true
      cast(''  as kbltyp)                                      as EarmarkedFundsDocumentCategory,
      @Consumption.hidden: true
      cast(''  as fmre_blart)                                  as EarmarkedFundsDocumentType,      
      _CompanyCode.CompanyCodeName
      
//      ,

//      

//      @Consumption.hidden: true

//      cast(''  as bwkey)                                       as ValuationArea,

//      @Consumption.hidden: true

//      cast(''  as auart)                                       as SalesDocumentType,

//      @Consumption.hidden: true

//      cast(''  as vkorg )                                      as SalesOrderSalesOrganization,

//      @Consumption.hidden: true

//      cast(''  as vtweg)                                       as SalesOrderDistributionChannel,

//      @Consumption.hidden: true

//      cast(''  as spart)                                       as OrganizationDivision,

//      

//      @Consumption.hidden: true

//      cast(''  as vkorg )                                      as SalesOrganization,

//      @Consumption.hidden: true

//      cast(''  as crmt_distribution_channel   )                as DistributionChannel,

//      @Consumption.hidden: true

//      cast(''  as crmt_division   )                            as Division,

//      @Consumption.hidden: true

//      cast(''  as vkbur   )                                    as SalesOffice,

//      @Consumption.hidden: true

//      cast(''  as vkgrp   )                                    as SalesGroup


}
where
      _PurchaseOrderItem.PurchasingDocumentCategory = 'F'

union 

select from I_SupplierInvoice
association [0..1] to I_APProcessFlowDocTypeText as _APProcessFlowDocTypeText on  _APProcessFlowDocTypeText.Language     = $session.system_language
                                                                              and _APProcessFlowDocTypeText.ProcessType  = 'AP'
                                                                              and _APProcessFlowDocTypeText.DocumentType = '2'

{
  key cast( '' as fins_ledger_pers )                         as SourceLedger,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
  key cast (SupplierInvoice as farp_dispprocflow_belnr_d)    as Documentid,
  key cast (_APProcessFlowDocTypeText.DocumentType as dokar) as DocumentType,
  key cast(FiscalYear as fis_gjahr)                          as FiscalYear,
  key CompanyCode,
      @Consumption.hidden: true
  key cast ('' as fins_ledger)                              as Ledger,
  
      @Consumption.hidden: true
      ''                                                     as Supplier,
      cast ('' as buzei)                                     as ParentProcessFlowNodeDocItem,
      _APProcessFlowDocTypeText.DocumentTypeDescription      as DocumentTypeDescription,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
      cast(SupplierInvoiceIDByInvcgParty as xblnr1)          as DocumentReferenceID,

      @Consumption.hidden: true
      ''                                                     as PurchasingGroup,
      @Consumption.hidden: true
      ''                                                     as PurchasingOrganization,
      @Consumption.hidden: true
      ''                                                     as PurchaseOrderType,
      @Consumption.hidden: true
      ''                                                     as Plant,
      @Consumption.hidden: true
      ''                                                     as StorageLocation,
      @Consumption.hidden: true
      ''                                                     as GoodsMovementType,
      @Consumption.hidden: true
      ''                                                     as CustomerBasicAuthorizationGrp,
      @Consumption.hidden: true
      ''                                                     as SupplierBasicAuthorizationGrp,
      @Consumption.hidden: true
      ''                                                     as BPPersonAuthorizationGroup,
      @Consumption.hidden: true
      IsEndOfPurposeBlocked,
      @Consumption.hidden: true
      ''                                                     as FinancialAccountType,
      @Consumption.hidden: true
      ''                                                     as BusinessArea,
      @Consumption.hidden: true
      ''                                                     as FunctionalArea,
      @Consumption.hidden: true
      ''                                                     as Segment,
      @Consumption.hidden: true
      ''                                                     as IssuingOrReceivingPlant,
      @Consumption.hidden: true
      ''                                                     as IsIssgOrRcvgStorLocAuthChkActv,
      @Consumption.hidden: true
      ''                                                     as IssuingOrReceivingStorageLoc,
      @Consumption.hidden: true
      ''                                                     as Customer,
      @Consumption.hidden: true
      ''                                                     as StockOwner,
      @Consumption.hidden: true
      ''                                                     as IsStorLocAuthznCheckActive,
      @Consumption.hidden: true
      _Supplier.AuthorizationGroup,
      @Consumption.hidden: true
      cast(''  as kbltyp)                                   as EarmarkedFundsDocumentCategory,
      @Consumption.hidden: true
      cast(''  as fmre_blart)                               as EarmarkedFundsDocumentType,      
      _CompanyCode.CompanyCodeName
      
//      ,

//      

//      @Consumption.hidden: true

//      cast(''  as bwkey)                                    as ValuationArea,

//      @Consumption.hidden: true

//      cast(''  as auart)                                    as SalesDocumentType,

//      @Consumption.hidden: true

//      cast(''  as vkorg )                                   as SalesOrderSalesOrganization,

//      @Consumption.hidden: true

//      cast(''  as vtweg)                                    as SalesOrderDistributionChannel,

//      @Consumption.hidden: true

//      cast(''  as spart)                                    as OrganizationDivision,

//      

//      @Consumption.hidden: true

//      cast(''  as vkorg )                                   as SalesOrganization,

//      @Consumption.hidden: true

//      cast(''  as crmt_distribution_channel   )             as DistributionChannel,

//      @Consumption.hidden: true

//      cast(''  as crmt_division   )                         as Division,

//      @Consumption.hidden: true

//      cast(''  as vkbur   )                                 as SalesOffice,

//      @Consumption.hidden: true

//      cast(''  as vkgrp   )                                 as SalesGroup  


}

union 

select from I_JournalEntrySemanticKeyVH
association [0..1] to I_APProcessFlowDocTypeText as _APProcessFlowDocTypeText on  _APProcessFlowDocTypeText.Language     = $session.system_language
                                                                              and _APProcessFlowDocTypeText.ProcessType  = 'AP'
                                                                              and _APProcessFlowDocTypeText.DocumentType = '3'

{
  key SourceLedger,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
  key cast (AccountingDocument   as farp_dispprocflow_belnr_d) as Documentid,
  key cast(_APProcessFlowDocTypeText.DocumentType as dokar)    as DocumentType,
  key cast(FiscalYear as fis_gjahr)                            as FiscalYear,
  key CompanyCode,
      @Consumption.hidden: true
  key Ledger,
      @Consumption.hidden: true
  key ''                                                       as Supplier,
      cast ('' as buzei)                                       as ParentProcessFlowNodeDocItem,
      _APProcessFlowDocTypeText.DocumentTypeDescription        as DocumentTypeDescription,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
      cast(_JournalEntry.DocumentReferenceID as xblnr1)        as DocumentReferenceID,

      @Consumption.hidden: true
      ''                                                       as PurchasingGroup,
      @Consumption.hidden: true
      ''                                                       as PurchasingOrganization,
      @Consumption.hidden: true
      ''                                                       as PurchaseOrderType,
      @Consumption.hidden: true
      ''                                                       as Plant,
      @Consumption.hidden: true
      ''                                                       as StorageLocation,
      @Consumption.hidden: true
      ''                                                       as GoodsMovementType,
      @Consumption.hidden: true
      ''                                                       as CustomerBasicAuthorizationGrp,
      @Consumption.hidden: true
      ''                                                       as SupplierBasicAuthorizationGrp,
      @Consumption.hidden: true
      ''                                                       as BPPersonAuthorizationGroup,
      @Consumption.hidden: true
      ''                                                       as IsEndOfPurposeBlocked,
      @Consumption.hidden: true
      ''                                                       as FinancialAccountType,
      @Consumption.hidden: true
      ''                                                       as BusinessArea,
      @Consumption.hidden: true
      ''                                                       as FunctionalArea,
      @Consumption.hidden: true
      ''                                                       as Segment,
      @Consumption.hidden: true
      ''                                                       as IssuingOrReceivingPlant,
      @Consumption.hidden: true
      ''                                                       as IsIssgOrRcvgStorLocAuthChkActv,
      @Consumption.hidden: true
      ''                                                       as IssuingOrReceivingStorageLoc,
      @Consumption.hidden: true
      ''                                                       as Customer,
      @Consumption.hidden: true
      ''                                                       as StockOwner,
      @Consumption.hidden: true
      ''                                                       as IsStorLocAuthznCheckActive,
      @Consumption.hidden: true
      _JournalEntry._OperationalAcctgDocItem._Supplier.AuthorizationGroup    as AuthorizationGroup,
      @Consumption.hidden: true
      cast(''  as kbltyp)                                   as EarmarkedFundsDocumentCategory,
      @Consumption.hidden: true
      cast(''  as fmre_blart)                               as EarmarkedFundsDocumentType,
      CompanyCodeName
      
//      ,     

//      

//      @Consumption.hidden: true

//      _JournalEntry._OperationalAcctgDocItem.ValuationArea                                    as ValuationArea,

//      @Consumption.hidden: true

//      _JournalEntry._OperationalAcctgDocItem._SalesDoc.SalesDocumentType                      as SalesDocumentType,

//      @Consumption.hidden: true

//      _JournalEntry._OperationalAcctgDocItem._SalesDoc.SalesOrganization                      as SalesOrderSalesOrganization,

//      @Consumption.hidden: true 

//      _JournalEntry._OperationalAcctgDocItem._SalesDoc.DistributionChannel                    as SalesOrderDistributionChannel,

//      @Consumption.hidden: true 

//      _JournalEntry._OperationalAcctgDocItem._SalesDoc.OrganizationDivision                   as OrganizationDivision,

//      

//      @Consumption.hidden: true

//      _JournalEntry._OperationalAcctgDocItem._ServiceDocument.SalesOrganization               as SalesOrganization,

//      @Consumption.hidden: true

//      _JournalEntry._OperationalAcctgDocItem._ServiceDocument.DistributionChannel             as DistributionChannel,

//      @Consumption.hidden: true 

//      _JournalEntry._OperationalAcctgDocItem._ServiceDocument.Division                        as Division,

//      @Consumption.hidden: true 

//      _JournalEntry._OperationalAcctgDocItem._ServiceDocument.SalesOffice                     as SalesOffice,

//      @Consumption.hidden: true 

//      _JournalEntry._OperationalAcctgDocItem._ServiceDocument.SalesGroup                      as SalesGroup


}

union select from I_OperationalAcctgDocItem as bseg
  inner join                   I_OperationalAcctgDocItem as clrg on  clrg.CompanyCode                = bseg.CompanyCode
                                                                 and clrg.FiscalYear                 = bseg.ClearingDocFiscalYear
                                                                 and clrg.AccountingDocument         = bseg.ClearingAccountingDocument
                                                                 and clrg.ClearingAccountingDocument = bseg.ClearingAccountingDocument

association [0..1] to I_APProcessFlowDocTypeText as _APProcessFlowDocTypeText on  _APProcessFlowDocTypeText.Language     = $session.system_language
                                                                              and _APProcessFlowDocTypeText.ProcessType  = 'AP'
                                                                              and _APProcessFlowDocTypeText.DocumentType = '4'

{
  key cast( '' as fins_ledger_pers )                        as SourceLedger,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
  key clrg.AccountingDocument                               as Documentid,
  key cast(_APProcessFlowDocTypeText.DocumentType as dokar) as DocumentType,
  key cast( clrg.FiscalYear as fis_gjahr)                   as FiscalYear,
  key clrg.CompanyCode,
      @Consumption.hidden: true
  key cast ('' as fins_ledger)                              as Ledger,
  
      @Consumption.hidden: true
  key ''                                                    as Supplier,
  key bseg.AccountingDocumentItem                           as ParentProcessFlowNodeDocItem,
      _APProcessFlowDocTypeText.DocumentTypeDescription     as DocumentTypeDescription,
      cast('' as xblnr1)                                    as DocumentReferenceID,

      @Consumption.hidden: true
      ''                                                    as PurchasingGroup,
      @Consumption.hidden: true
      ''                                                    as PurchasingOrganization,
      @Consumption.hidden: true
      ''                                                    as PurchaseOrderType,
      @Consumption.hidden: true
      ''                                                    as Plant,
      @Consumption.hidden: true
      ''                                                    as StorageLocation,
      @Consumption.hidden: true
      ''                                                    as GoodsMovementType,
      @Consumption.hidden: true
      ''                                                    as CustomerBasicAuthorizationGrp,
      @Consumption.hidden: true
      ''                                                    as SupplierBasicAuthorizationGrp,
      @Consumption.hidden: true
      ''                                                    as BPPersonAuthorizationGroup,
      @Consumption.hidden: true
      ''                                                    as IsEndOfPurposeBlocked,
      @Consumption.hidden: true
      clrg.FinancialAccountType                             as FinancialAccountType,
      @Consumption.hidden: true
      clrg.BusinessArea                                     as BusinessArea,
      @Consumption.hidden: true
      clrg.FunctionalArea                                   as FunctionalArea,
      @Consumption.hidden: true
      clrg.Segment                                          as Segment,
      @Consumption.hidden: true
      ''                                                    as IssuingOrReceivingPlant,
      @Consumption.hidden: true
      ''                                                    as IsIssgOrRcvgStorLocAuthChkActv,
      @Consumption.hidden: true
      ''                                                    as IssuingOrReceivingStorageLoc,
      @Consumption.hidden: true
      ''                                                    as Customer,
      @Consumption.hidden: true
      ''                                                    as StockOwner,
      @Consumption.hidden: true
      ''                                                    as IsStorLocAuthznCheckActive,
      @Consumption.hidden: true
      bseg._Supplier.AuthorizationGroup                     as AuthorizationGroup,
      @Consumption.hidden: true
      cast(''  as kbltyp)                                   as EarmarkedFundsDocumentCategory,
      @Consumption.hidden: true
      cast(''  as fmre_blart)                               as EarmarkedFundsDocumentType,
      clrg._CompanyCode.CompanyCodeName
      
//      ,

//      

//      @Consumption.hidden: true

//      clrg.ValuationArea                                    as ValuationArea,

//      @Consumption.hidden: true

//      clrg._SalesDoc.SalesDocumentType                      as SalesDocumentType,

//      @Consumption.hidden: true

//      clrg._SalesDoc.SalesOrganization                      as SalesOrderSalesOrganization,

//      @Consumption.hidden: true 

//      clrg._SalesDoc.DistributionChannel                    as SalesOrderDistributionChannel,

//      @Consumption.hidden: true 

//      clrg._SalesDoc.OrganizationDivision                   as OrganizationDivision,

//      

//      @Consumption.hidden: true

//      clrg._ServiceDocument.SalesOrganization               as SalesOrganization,

//      @Consumption.hidden: true

//      clrg._ServiceDocument.DistributionChannel             as DistributionChannel,

//      @Consumption.hidden: true 

//      clrg._ServiceDocument.Division                        as Division,

//      @Consumption.hidden: true 

//      clrg._ServiceDocument.SalesOffice                     as SalesOffice,

//      @Consumption.hidden: true 

//      clrg._ServiceDocument.SalesGroup                      as SalesGroup


}
union select from I_EarmarkedFundsDocument
association [0..1] to I_APProcessFlowDocTypeText as _APProcessFlowDocTypeText on  _APProcessFlowDocTypeText.Language     = $session.system_language
                                                                              and _APProcessFlowDocTypeText.ProcessType  = 'AP'
                                                                              and _APProcessFlowDocTypeText.DocumentType = 'E'

{
  key cast( '' as fins_ledger_pers )                        as SourceLedger,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
  key EarmarkedFundsDocument                                as Documentid,
  key cast(_APProcessFlowDocTypeText.DocumentType as dokar) as DocumentType,
  key cast( '' as fis_gjahr)                                as FiscalYear,
  key CompanyCode,
      @Consumption.hidden: true
  key cast ('' as fins_ledger)                              as Ledger,  
      @Consumption.hidden: true
  key ''                                                    as Supplier,
  key cast ('' as buzei)                                    as ParentProcessFlowNodeDocItem,
      _APProcessFlowDocTypeText.DocumentTypeDescription     as DocumentTypeDescription,
      @Search: { defaultSearchElement: true, ranking: #HIGH, fuzzinessThreshold: 0.7 }
      EarmarkedFundsDocReference                            as DocumentReferenceID,

      @Consumption.hidden: true
      ''                                                    as PurchasingGroup,
      @Consumption.hidden: true
      ''                                                    as PurchasingOrganization,
      @Consumption.hidden: true
      ''                                                    as PurchaseOrderType,
      @Consumption.hidden: true
      ''                                                    as Plant,
      @Consumption.hidden: true
      ''                                                    as StorageLocation,
      @Consumption.hidden: true
      ''                                                    as GoodsMovementType,
      @Consumption.hidden: true
      ''                                                    as CustomerBasicAuthorizationGrp,
      @Consumption.hidden: true
      ''                                                    as SupplierBasicAuthorizationGrp,
      @Consumption.hidden: true
      ''                                                    as BPPersonAuthorizationGroup,
      @Consumption.hidden: true
      ''                                                    as IsEndOfPurposeBlocked,
      @Consumption.hidden: true
      ''                                                    as FinancialAccountType,
      @Consumption.hidden: true
      ''                                                    as BusinessArea,
      @Consumption.hidden: true
      ''                                                    as FunctionalArea,
      @Consumption.hidden: true
      ''                                                    as Segment,
      @Consumption.hidden: true
      ''                                                    as IssuingOrReceivingPlant,
      @Consumption.hidden: true
      ''                                                    as IsIssgOrRcvgStorLocAuthChkActv,
      @Consumption.hidden: true
      ''                                                    as IssuingOrReceivingStorageLoc,
      @Consumption.hidden: true
      ''                                                    as Customer,
      @Consumption.hidden: true
      ''                                                    as StockOwner,
      @Consumption.hidden: true
      ''                                                    as IsStorLocAuthznCheckActive,
      @Consumption.hidden: true
      ''                                                    as AuthorizationGroup,
      @Consumption.hidden: true
      EarmarkedFundsDocumentCategory,
      @Consumption.hidden: true
      EarmarkedFundsDocumentType,
      _CompanyCode.CompanyCodeName
      
//      ,

//      

//      @Consumption.hidden: true

//      cast(''  as bwkey)                                    as ValuationArea,

//      @Consumption.hidden: true

//      cast(''  as auart)                                    as SalesDocumentType,

//      @Consumption.hidden: true

//      cast(''  as vkorg )                                   as SalesOrderSalesOrganization,

//      @Consumption.hidden: true

//      cast(''  as vtweg)                                    as SalesOrderDistributionChannel,

//      @Consumption.hidden: true

//      cast(''  as spart)                                    as OrganizationDivision,

//      

//      @Consumption.hidden: true

//      cast(''  as vkorg )                                   as SalesOrganization,

//      @Consumption.hidden: true

//      cast(''  as crmt_distribution_channel   )             as DistributionChannel,

//      @Consumption.hidden: true

//      cast(''  as crmt_division   )                         as Division,

//      @Consumption.hidden: true

//      cast(''  as vkbur   )                                 as SalesOffice,

//      @Consumption.hidden: true

//      cast(''  as vkgrp   )                                 as SalesGroup

}