P_VarConfignSalesDocumentItem

DDL: P_VARCONFIGNSALESDOCUMENTITEM SQL: PAVCSALESDOCITEM Type: view BASIC Package: ODATA_LO_VCHCLF_SIMULATION

Simulation - Sales Document Item private view

P_VarConfignSalesDocumentItem is a Basic CDS View that provides data about "Simulation - Sales Document Item private view" in SAP S/4HANA. It reads from 1 data source (vbap) and exposes 13 fields with key fields SalesDocument, SalesDocumentItem. It has 1 association to related views. Part of development package ODATA_LO_VCHCLF_SIMULATION.

Data Sources (1)

SourceAliasJoin Type
vbap SalesDocumentItem from

Associations (1)

CardinalityTargetAliasCondition
[1..1] P_VarConfignSalesDocument _SalesDocument SalesDocumentItem.vbeln = _SalesDocument.SalesDocument

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PAVCSALESDOCITEM view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #BASIC view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (13)

KeyFieldSource TableSource FieldDescription
KEY SalesDocument vbap vbeln
KEY SalesDocumentItem vbap posnr
SDDocumentCategory _SalesDocument SDDocumentCategory
Product vbap matnr
Plant vbap werks
CreatedByUser vbap ernam
CreationDate vbap erdat
aedatendasLastChangeDate
LastChangedByUserendasLastChangedByUser
ProductConfiguration vbap cuobj
OrderQuantity vbap kwmeng
quan153asOrderQuantityInBaseUnit
BaseUnit vbap meins
@AbapCatalog.sqlViewName: 'PAVCSALESDOCITEM'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED

@VDM.viewType: #BASIC
@VDM.private: true

@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_VarConfignSalesDocumentItem
  as select from vbap as SalesDocumentItem
  association [1..1] to P_VarConfignSalesDocument as _SalesDocument on SalesDocumentItem.vbeln = _SalesDocument.SalesDocument
{
  key SalesDocumentItem.vbeln           as SalesDocument,
  key SalesDocumentItem.posnr           as SalesDocumentItem,

      _SalesDocument.SDDocumentCategory as SDDocumentCategory,

      SalesDocumentItem.matnr           as Product,
      SalesDocumentItem.werks           as Plant,
      SalesDocumentItem.ernam           as CreatedByUser,
      SalesDocumentItem.erdat           as CreationDate,
      case
        when SalesDocumentItem.aedat = '00000000'
             or SalesDocumentItem.aedat is null
             then SalesDocumentItem.erdat
        else SalesDocumentItem.aedat
      end                               as LastChangeDate,

      case
        when SalesDocumentItem.aedat = '00000000'
             or SalesDocumentItem.aedat is null
             then SalesDocumentItem.ernam
        else _SalesDocument.LastChangedByUser
      end                               as LastChangedByUser,

      SalesDocumentItem.cuobj           as ProductConfiguration,
      SalesDocumentItem.kwmeng          as OrderQuantity,
      
      @Semantics.quantity.unitOfMeasure: 'BaseUnit'
      cast(
        case
          when SalesDocumentItem.umvkn != 0
               then SalesDocumentItem.kwmeng * division(SalesDocumentItem.umvkz, SalesDocumentItem.umvkn, 3) 
          else SalesDocumentItem.kwmeng
        end as abap.quan(15,3))         as OrderQuantityInBaseUnit,
      @Semantics.unitOfMeasure: true
      SalesDocumentItem.meins           as BaseUnit
}
where
  //Only configured Sales Document Items are relevant

  cuobj != '000000000000000000'
  and
  //inidicator whether the item is directly configurable

  //if it belongs to another item then it is configured through it

  uepos is initial