C_SalesDocumentByObjectStatus

DDL: C_SALESDOCUMENTBYOBJECTSTATUS SQL: CSLSDOCBYOBJSTS Type: view CONSUMPTION

Sales Documents by Object Status

C_SalesDocumentByObjectStatus is a Consumption CDS View that provides data about "Sales Documents by Object Status" in SAP S/4HANA. It reads from 2 data sources (P_SalesDocumentByMultObjSts, I_SalesDocument) and exposes 34 fields with key fields SalesDocument, SalesDocumentItem. It has 15 associations to related views.

Data Sources (2)

SourceAliasJoin Type
P_SalesDocumentByMultObjSts P_SalesDocumentByMultObjSts inner
I_SalesDocument SalesDocument from

Associations (15)

CardinalityTargetAliasCondition
[0..1] I_SalesDocumentItem _SalesDocumentItem $projection.SalesDocument = _SalesDocumentItem.SalesDocument and $projection.SalesDocumentItem = _SalesDocumentItem.SalesDocumentItem
[0..1] C_Incompl_SalesDocCatVH _SalesDocumentCategory $projection.SDDocumentCategory = _SalesDocumentCategory.SDDocumentCategory
[0..1] C_Incompl_SalesDocTypeVH _SalesDocumentType $projection.SDDocumentCategory = _SalesDocumentType.SDDocumentCategory and $projection.SalesDocumentType = _SalesDocumentType.SalesDocumentType
[0..1] C_SoldToValueHelp _SoldToParty $projection.SoldToParty = _SoldToParty.Customer
[0..1] I_MaterialStdVH _MaterialVH $projection.Material = _MaterialVH.Material
[0..1] C_SalesDocumentUserVH _CreatedByUser $projection.CreatedByUser = _CreatedByUser.UserID
[0..1] I_Currency _TransactionCurrency $projection.TransactionCurrency = _TransactionCurrency.Currency
[0..1] I_SalesOrganization _SalesOrganization $projection.SalesOrganization = _SalesOrganization.SalesOrganization
[0..1] C_Dischannelvaluehelp _DistributionChannel $projection.SalesOrganization = _DistributionChannel.SalesOrganization and $projection.DistributionChannel = _DistributionChannel.DistributionChannel
[0..1] C_OrgDivisionValueHelp _OrganizationDivision $projection.SalesOrganization = _OrganizationDivision.SalesOrganization and $projection.DistributionChannel = _OrganizationDivision.DistributionChannel and $projection.OrganizationDivision = _OrganizationDivision.Division
[0..1] C_SalesOfficeValueHelp _SalesOffice $projection.SalesOrganization = _SalesOffice.SalesOrganization and $projection.DistributionChannel = _SalesOffice.DistributionChannel and $projection.OrganizationDivision = _SalesOffice.OrganizationDivision and $projection.SalesOffice = _SalesOffice.SalesOffice
[0..1] C_SalesGroupValueHelp _SalesGroup $projection.SalesOffice = _SalesGroup.SalesOffice and $projection.SalesGroup = _SalesGroup.SalesGroup
[0..1] I_OverallSDProcessStatus _OverallSDProcessStatus $projection.OverallSDProcessStatus = _OverallSDProcessStatus.OverallSDProcessStatus
[1] E_SalesDocumentBasic _Extension $projection.SalesDocument = _Extension.SalesDocument
[1] E_SalesDocumentItemBasic _ItemExtension $projection.SalesDocument = _ItemExtension.SalesDocument and $projection.SalesDocumentItem = _ItemExtension.SalesDocumentItem

Annotations (14)

NameValueLevelField
AbapCatalog.sqlViewName CSLSDOCBYOBJSTS view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #CHECK view
EndUserText.label Sales Documents by Object Status view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
Search.searchable true view
UI.headerInfo.typeName Sales Document view
UI.headerInfo.typeNamePlural Sales Documents view
UI.headerInfo.title.type #STANDARD view
UI.headerInfo.title.value SalesDocumentItem view

Fields (34)

KeyFieldSource TableSource FieldDescription
KEY SalesDocument I_SalesDocument SalesDocument
KEY SalesDocumentItem SalesDocumentByMultObjSts SalesDocumentItem
SystemStatusName SalesDocumentByMultObjSts SystemStatusName
UserStatusName SalesDocumentByMultObjSts UserStatusName
SystemStatusShortName SalesDocumentByMultObjSts SystemStatusShortName
UserStatusShortName SalesDocumentByMultObjSts UserStatusShortName
SDDocumentCategory I_SalesDocument SDDocumentCategory
SalesDocumentType I_SalesDocument SalesDocumentType
SoldToParty I_SalesDocument SoldToParty
Material
CreatedByUser I_SalesDocument CreatedByUser
PurchaseOrderByCustomer I_SalesDocument PurchaseOrderByCustomer
CreationDate I_SalesDocument CreationDate
NetAmount
TransactionCurrency
SalesOrganization I_SalesDocument SalesOrganization
DistributionChannel I_SalesDocument DistributionChannel
OrganizationDivision I_SalesDocument OrganizationDivision
SalesOffice I_SalesDocument SalesOffice
SalesGroup I_SalesDocument SalesGroup
RequestedDeliveryDate I_SalesDocument RequestedDeliveryDate
OverallSDProcessStatus I_SalesDocument OverallSDProcessStatus
_SalesDocumentCategory _SalesDocumentCategory
_SalesDocumentType _SalesDocumentType
_SoldToParty _SoldToParty
_CreatedByUser _CreatedByUser
_TransactionCurrency _TransactionCurrency
_OverallSDProcessStatus _OverallSDProcessStatus
_SalesOrganization _SalesOrganization
_DistributionChannel _DistributionChannel
_OrganizationDivision _OrganizationDivision
_SalesOffice _SalesOffice
_SalesGroup _SalesGroup
_MaterialVH _MaterialVH
@AbapCatalog.sqlViewName: 'CSLSDOCBYOBJSTS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales Documents by Object Status'

@ClientHandling.algorithm: #SESSION_VARIABLE

@VDM.viewType: #CONSUMPTION
@ObjectModel.usageType.dataClass: #TRANSACTIONAL
@ObjectModel.usageType.serviceQuality: #C
@ObjectModel.usageType.sizeCategory: #L

@Search.searchable: true

@ObjectModel.semanticKey:  [ 'SalesDocument', 'SalesDocumentItem' ]

@UI.headerInfo: {
  typeName:         'Sales Document',
  typeNamePlural:   'Sales Documents',
  title: {
    type:   #STANDARD,
    value:  'SalesDocumentItem'
  }
}

define view C_SalesDocumentByObjectStatus

  as select from I_SalesDocument as SalesDocument

    inner join P_SalesDocumentByMultObjSts( im_clnt : $session.client ) as SalesDocumentByMultObjSts 
                                                                           on  SalesDocumentByMultObjSts.SalesDocument = SalesDocument.SalesDocument


  association [0..1] to I_SalesDocumentItem      as _SalesDocumentItem     on  $projection.SalesDocument     = _SalesDocumentItem.SalesDocument
                                                                           and $projection.SalesDocumentItem = _SalesDocumentItem.SalesDocumentItem

  association [0..1] to C_Incompl_SalesDocCatVH  as _SalesDocumentCategory on  $projection.SDDocumentCategory = _SalesDocumentCategory.SDDocumentCategory

  association [0..1] to C_Incompl_SalesDocTypeVH as _SalesDocumentType     on  $projection.SDDocumentCategory = _SalesDocumentType.SDDocumentCategory
                                                                           and $projection.SalesDocumentType  = _SalesDocumentType.SalesDocumentType

  association [0..1] to C_SoldToValueHelp        as _SoldToParty           on  $projection.SoldToParty = _SoldToParty.Customer

  association [0..1] to I_MaterialStdVH          as _MaterialVH            on  $projection.Material = _MaterialVH.Material

  association [0..1] to C_SalesDocumentUserVH    as _CreatedByUser         on  $projection.CreatedByUser = _CreatedByUser.UserID
  
  association [0..1] to I_Currency               as _TransactionCurrency   on  $projection.TransactionCurrency = _TransactionCurrency.Currency

  association [0..1] to I_SalesOrganization      as _SalesOrganization     on  $projection.SalesOrganization = _SalesOrganization.SalesOrganization

  association [0..1] to C_Dischannelvaluehelp    as _DistributionChannel   on  $projection.SalesOrganization   = _DistributionChannel.SalesOrganization
                                                                           and $projection.DistributionChannel = _DistributionChannel.DistributionChannel

  association [0..1] to C_OrgDivisionValueHelp   as _OrganizationDivision  on  $projection.SalesOrganization    = _OrganizationDivision.SalesOrganization
                                                                           and $projection.DistributionChannel  = _OrganizationDivision.DistributionChannel
                                                                           and $projection.OrganizationDivision = _OrganizationDivision.Division

  association [0..1] to C_SalesOfficeValueHelp   as _SalesOffice           on  $projection.SalesOrganization    = _SalesOffice.SalesOrganization
                                                                           and $projection.DistributionChannel  = _SalesOffice.DistributionChannel
                                                                           and $projection.OrganizationDivision = _SalesOffice.OrganizationDivision
                                                                           and $projection.SalesOffice          = _SalesOffice.SalesOffice

  association [0..1] to C_SalesGroupValueHelp    as _SalesGroup            on  $projection.SalesOffice = _SalesGroup.SalesOffice
                                                                           and $projection.SalesGroup  = _SalesGroup.SalesGroup

  association [0..1] to I_OverallSDProcessStatus as _OverallSDProcessStatus on  $projection.OverallSDProcessStatus = _OverallSDProcessStatus.OverallSDProcessStatus


  //Extension Association

  association [1]    to E_SalesDocumentBasic     as _Extension             on  $projection.SalesDocument = _Extension.SalesDocument
  
  association [1]    to E_SalesDocumentItemBasic as _ItemExtension         on  $projection.SalesDocument     = _ItemExtension.SalesDocument
                                                                           and $projection.SalesDocumentItem = _ItemExtension.SalesDocumentItem

{

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Search.ranking: #HIGH
      @UI: {
        selectionField: [ { position: 10 } ],
        lineItem: [ { position: 10, importance: #HIGH } ]
      }
  key SalesDocument.SalesDocument,

      @UI: {
        lineItem: [ { position: 11, importance: #HIGH } ]
      }
  key SalesDocumentByMultObjSts.SalesDocumentItem,
  
      @Consumption.filter.hidden: true
      @UI: {
        lineItem: [ { position: 40, importance: #HIGH } ]
      } 
      SalesDocumentByMultObjSts.SystemStatusName,

      @Consumption.filter.hidden: true
      @UI: {
        lineItem: [ { position: 50 } ]
      }
      SalesDocumentByMultObjSts.UserStatusName,

      @Consumption.filter.hidden: true
      SalesDocumentByMultObjSts.SystemStatusShortName,

      @Consumption.filter.hidden: true
      SalesDocumentByMultObjSts.UserStatusShortName,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Consumption.valueHelp: '_SalesDocumentCategory'
      @ObjectModel.foreignKey.association: '_SalesDocumentCategory'
      SalesDocument.SDDocumentCategory,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Consumption.valueHelp: '_SalesDocumentType'
      @ObjectModel.foreignKey.association: '_SalesDocumentType'
      @UI: {
        lineItem: [ { position: 20 } ]
      }
      SalesDocument.SalesDocumentType,

      @Consumption.semanticObject: 'Customer'
      @Consumption.valueHelpDefinition: [{association: '_SoldToParty'}]
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @ObjectModel.foreignKey.association: '_SoldToParty'
      @UI: {
        selectionField: [ { position: 60 } ],
        lineItem: [ { position: 30 } ]
      }
      SalesDocument.SoldToParty,
      
      @Consumption.semanticObject: 'Material'
      @Consumption.valueHelpDefinition: [{ entity: { name: 'I_ProductStdVH', element: 'Product' }}]
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @ObjectModel.foreignKey.association: '_MaterialVH'
      @UI: {
        lineItem: [ { position: 60 } ]
      }
      cast(_SalesDocumentItem.Material as productnumber preserving type ) as Material,

      @Consumption.semanticObject: 'UserID'
      @Consumption.valueHelp: '_CreatedByUser'
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.9
      @ObjectModel.foreignKey.association: '_CreatedByUser'
      @UI: {
        selectionField: [ { position: 80 } ]
      }
      SalesDocument.CreatedByUser,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Consumption.filter.hidden: true
      SalesDocument.PurchaseOrderByCustomer,

      @Semantics.systemDate.createdAt: true
      SalesDocument.CreationDate,

      // Pricing

      @DefaultAggregation: #NONE
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      @Consumption.filter.hidden: true
      @UI: {
        lineItem: [ { position: 70 } ]
      }
      cast((case when SalesDocumentByMultObjSts.SalesDocumentItem = '000000' then SalesDocument.TotalNetAmount else _SalesDocumentItem.NetAmount end) as netwr_ap preserving type)              as NetAmount,
      
      @UI.hidden: true
      @Semantics.currencyCode: true
      @ObjectModel.foreignKey.association: '_TransactionCurrency'
      cast((case when SalesDocumentByMultObjSts.SalesDocumentItem = '000000' then SalesDocument.TransactionCurrency else _SalesDocumentItem.TransactionCurrency end) as waerk preserving type)  as TransactionCurrency,

      // Sales Area

      @Consumption.valueHelpDefinition: [{entity:{name:'C_SalesDocSalesOrganizationVH', element:'SalesOrganization'} }]
      @UI: {
        selectionField: [ { position: 40 } ]
      }
      SalesDocument.SalesOrganization,
      
      @Consumption.valueHelp: '_DistributionChannel'
      @UI: {
        selectionField: [ { position: 50 } ]
      }
      SalesDocument.DistributionChannel,
      
      @Consumption.valueHelp: '_OrganizationDivision'
      SalesDocument.OrganizationDivision,
      
      @Consumption.valueHelp: '_SalesOffice'
      SalesDocument.SalesOffice,
      
      @Consumption.valueHelp: '_SalesGroup'
      SalesDocument.SalesGroup,

      // Shipping

      SalesDocument.RequestedDeliveryDate,

      // Status

      @UI.textArrangement: #TEXT_ONLY
      @UI: {selectionField: [ { position: 95 } ]}
      @ObjectModel.foreignKey.association: '_OverallSDProcessStatus'
      SalesDocument.OverallSDProcessStatus,
      

      @Consumption.filter.hidden: true
      _SalesDocumentCategory,
      @Consumption.filter.hidden: true
      _SalesDocumentType,
      @Consumption.filter.hidden: true
      _SoldToParty,
      @Consumption.filter.hidden: true
      _CreatedByUser,
      @Consumption.filter.hidden: true      
      _TransactionCurrency,
      @Consumption.filter.hidden: true
      _OverallSDProcessStatus,
      @Consumption.filter.hidden: true
      _SalesOrganization,
      @Consumption.filter.hidden: true
      _DistributionChannel,
      @Consumption.filter.hidden: true
      _OrganizationDivision,
      @Consumption.filter.hidden: true
      _SalesOffice,
      @Consumption.filter.hidden: true
      _SalesGroup,
      @Consumption.filter.hidden: true
      _MaterialVH

} where
     SalesDocument.SDDocumentCategory = 'A' // Inquiry

  or SalesDocument.SDDocumentCategory = 'B' // Quotation

  or SalesDocument.SDDocumentCategory = 'C' // Order

  or SalesDocument.SDDocumentCategory = 'D' // Item Proposal

  or SalesDocument.SDDocumentCategory = 'G' // Contract

  or SalesDocument.SDDocumentCategory = 'H' // Returns

  or SalesDocument.SDDocumentCategory = 'I' // Order w/o charge

  or SalesDocument.SDDocumentCategory = 'K' // Credit memo request

  or SalesDocument.SDDocumentCategory = 'L' // Debit memo request