C_Cust360RecentDeliveryDoc

DDL: C_CUST360RECENTDELIVERYDOC SQL: CUST360BDRDEL Type: view_entity CONSUMPTION

Customer 360 Recent Delivery

C_Cust360RecentDeliveryDoc is a Consumption CDS View that provides data about "Customer 360 Recent Delivery" in SAP S/4HANA. It reads from 2 data sources (I_Customer360BusDocSetting, I_DeliveryDocument) and exposes 18 fields with key fields SoldToParty, OutboundDelivery, SDDocumentCategory.

Data Sources (2)

SourceAliasJoin Type
I_Customer360BusDocSetting Customer360BusDocSetting inner
I_DeliveryDocument DeliveryDocument from

Annotations (6)

NameValueLevelField
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
AccessControl.authorizationCheck #NOT_REQUIRED view
EndUserText.label Customer 360 Recent Delivery view
VDM.viewType #CONSUMPTION view

Fields (18)

KeyFieldSource TableSource FieldDescription
KEY SoldToParty I_DeliveryDocument SoldToParty
KEY OutboundDelivery I_DeliveryDocument DeliveryDocument
KEY SDDocumentCategory I_DeliveryDocument SDDocumentCategory
CustomerName
DeliveryDocumentType I_DeliveryDocument DeliveryDocumentType
DeliveryDocumentTypeName
OverallSDProcessStatus I_DeliveryDocument OverallSDProcessStatus
OverallSDProcessStatusDesc
TotalNetAmount I_DeliveryDocument TotalNetAmount
TransactionCurrency I_DeliveryDocument TransactionCurrency
CreationDate I_DeliveryDocument CreationDate
_DeliveryDocumentType I_DeliveryDocument _DeliveryDocumentType
_OverallSDProcessStatus I_DeliveryDocument _OverallSDProcessStatus
SalesOrganization I_DeliveryDocument SalesOrganization
ShippingPoint I_DeliveryDocument ShippingPoint
ShippingPointName
_ShippingPoint I_DeliveryDocument _ShippingPoint
_SoldToParty I_DeliveryDocument _SoldToParty
//@AbapCatalog.sqlViewName: 'CUST360BDRDEL'

//@AbapCatalog.compiler.compareFilter: true

//@AbapCatalog.preserveKey: true

@ObjectModel: {
//  compositionRoot: true,

//  representativeKey: 'DeliveryDocument',

  usageType: {
    dataClass: #TRANSACTIONAL,
    serviceQuality: #C,
    sizeCategory: #XL
    } 
 }
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Customer 360 Recent Delivery'
@VDM.viewType: #CONSUMPTION


define view entity C_Cust360RecentDeliveryDoc as select from I_DeliveryDocument as DeliveryDocument 
inner join I_Customer360BusDocSetting as Customer360BusDocSetting on Customer360BusDocSetting.Cust360BusDocCategory = DeliveryDocument.SDDocumentCategory
 // I_Customer360GeneralSetting as Customer360GeneralSetting on Customer360GeneralSetting.CustomerViewProfileName = 'CUSTPROFL'

  {
  @ObjectModel.foreignKey.association: '_SoldToParty'
  @ObjectModel.text.element: ['CustomerName'] 
  key DeliveryDocument.SoldToParty as SoldToParty,
  
  @Consumption.semanticObject: 'OutboundDelivery'
  key DeliveryDocument.DeliveryDocument as OutboundDelivery,
  key DeliveryDocument.SDDocumentCategory,
  
      @UI.hidden: true
      DeliveryDocument._SoldToParty.CustomerName as CustomerName,
      DeliveryDocument.DeliveryDocumentType,
      DeliveryDocument._DeliveryDocumentType._Text[1:Language = $session.system_language].DeliveryDocumentTypeName as DeliveryDocumentTypeName,
      @ObjectModel.foreignKey.association: '_OverallSDProcessStatus'
      @UI.lineItem: [{criticality: 'DeliveryStatusCriticality' }]
      DeliveryDocument.OverallSDProcessStatus,
      DeliveryDocument._OverallSDProcessStatus._Text[1:Language = $session.system_language].OverallSDProcessStatusDesc as OverallSDProcessStatusDesc,
      
      case DeliveryDocument.OverallSDProcessStatus
      when 'C'  then 3
      when ' ' then 2
      when 'A' then 0
      end as DeliveryStatusCriticality,
      
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      DeliveryDocument.TotalNetAmount,
      DeliveryDocument.TransactionCurrency,
      DeliveryDocument.CreationDate,
    // DeliveryDocument.LastChangeDate,



      //expose associations


      DeliveryDocument._DeliveryDocumentType,
      DeliveryDocument._OverallSDProcessStatus,
      
      //For DCL

      DeliveryDocument.SalesOrganization,
      
      @ObjectModel.text.element: ['ShippingPointName']         
      @ObjectModel.foreignKey.association: '_ShippingPoint'
      DeliveryDocument.ShippingPoint,
      
      @UI.hidden: true
      DeliveryDocument._ShippingPoint._Text[1:Language = $session.system_language].ShippingPointName as ShippingPointName,
      
      
      DeliveryDocument._ShippingPoint,
      DeliveryDocument._SoldToParty
      
}
where 
  DeliveryDocument.CreationDate > dats_add_days( tstmp_to_dats(tstmp_current_utctimestamp(), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), -Customer360BusDocSetting.RecentBusDocDurationInDays, 'INITIAL')
  and DeliveryDocument.CreationDate <= $session.system_date
  and DeliveryDocument.SDDocumentCategory = 'J'


/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CUSTOMER",
"I_CUSTOMER360BUSDOCSETTING",
"I_DELIVERYDOCUMENT",
"I_DELIVERYDOCUMENTTYPE",
"I_DELIVERYDOCUMENTTYPETEXT",
"I_OVERALLSDPROCESSSTATUS",
"I_OVERALLSDPROCESSSTATUSTEXT",
"I_SHIPPINGPOINT",
"I_SHIPPINGPOINTTEXT"
],
"ASSOCIATED":
[
"I_CUSTOMER",
"I_DELIVERYDOCUMENTTYPE",
"I_OVERALLSDPROCESSSTATUS",
"I_SHIPPINGPOINT"
],
"BASE":
[
"I_DELIVERYDOCUMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/