C_Customer360SalesQuotation

DDL: C_CUSTOMER360SALESQUOTATION SQL: CUST360SLSQUT Type: view_entity CONSUMPTION

Sales Quotations for customer 360

C_Customer360SalesQuotation is a Consumption CDS View that provides data about "Sales Quotations for customer 360" in SAP S/4HANA. It reads from 2 data sources (I_Customer360BusDocSetting, I_SalesQuotation) and exposes 60 fields with key field SalesQuotation. It has 11 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_Customer360BusDocSetting Customer360BusDocSetting inner
I_SalesQuotation SalesQuotation from

Associations (11)

CardinalityTargetAliasCondition
[1..1] P_Quotationwl_Duedays _SalesQuotationDueDays $projection.SalesQuotation = _SalesQuotationDueDays.SalesQuotation
[0..1] C_SoldToValueHelp _SoldToParty $projection.SoldToParty = _SoldToParty.Customer
[0..1] C_Dischannelvaluehelp _DistributionChannel $projection.SalesOrganization = _DistributionChannel.SalesOrganization and $projection.DistributionChannel = _DistributionChannel.DistributionChannel
[0..1] C_OrgDivisionValueHelp _Division $projection.SalesOrganization = _Division.SalesOrganization and $projection.DistributionChannel = _Division.DistributionChannel and $projection.OrganizationDivision = _Division.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] C_SalesQuotationTypeValueHelp _SalesDocumentType $projection.SalesQuotationType = _SalesDocumentType.SalesDocumentType
[0..1] C_SalesDocumentUserVH _CreatedByUser $projection.CreatedByUser = _CreatedByUser.UserID
[0..1] C_SalesDocumentUserVH _LastChangedByUser $projection.LastChangedByUser = _LastChangedByUser.UserID
[0..*] C_Quotation_SubsequentDocType _SubsequentDocType $projection.SalesQuotationType = _SubsequentDocType.SourceSalesDocumentType
[1] E_SalesDocumentBasic _Extension $projection.SalesQuotation = _Extension.SalesDocument

Annotations (8)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
EndUserText.label Sales Quotations for customer 360 view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
VDM.viewType #CONSUMPTION view
Metadata.allowExtensions true view
Search.searchable true view

Fields (60)

KeyFieldSource TableSource FieldDescription
KEY SalesQuotation I_SalesQuotation SalesQuotation
PurchaseOrderByCustomer I_SalesQuotation PurchaseOrderByCustomer
OverallSDProcessStatus I_SalesQuotation OverallSDProcessStatus
OverallSDProcessStatusDesc
SoldToParty I_SalesQuotation SoldToParty
SoldToPartyName
BindingPeriodValidityStartDate I_SalesQuotation BindingPeriodValidityStartDate
BindingPeriodValidityEndDate I_SalesQuotation BindingPeriodValidityEndDate
TotalNetAmount I_SalesQuotation TotalNetAmount
TransactionCurrency I_SalesQuotation TransactionCurrency
CurrencyName
SalesQuotationDate I_SalesQuotation SalesQuotationDate
CreationDate I_SalesQuotation CreationDate
SalesQuotationType I_SalesQuotation SalesQuotationType
SalesDocumentTypeName
SalesOrganization I_SalesQuotation SalesOrganization
SalesOrganizationName
OverallSDDocReferenceStatus I_SalesQuotation OverallSDDocReferenceStatus
OverallSDDocRefStatusDesc
OverallSDDocumentRejectionSts I_SalesQuotation OverallSDDocumentRejectionSts
OvrlSDDocumentRejectionStsDesc
SalesDocApprovalStatus I_SalesQuotation SalesDocApprovalStatus
SalesDocApprovalStatusDesc
int1asSlsQtanDueDateCriticality
int1asSlsQtanApprovalStsCriticality
DistributionChannel I_SalesQuotation DistributionChannel
DistributionChannelName
OrganizationDivision I_SalesQuotation OrganizationDivision
DivisionName
SalesOffice I_SalesQuotation SalesOffice
SalesOfficeName
SalesGroup I_SalesQuotation SalesGroup
SalesGroupName
LastChangeDate I_SalesQuotation LastChangeDate
CreatedByUser I_SalesQuotation CreatedByUser
UserDescription
LastChangedByUser I_SalesQuotation LastChangedByUser
LastChangedByUserDescription
SDDocumentReason I_SalesQuotation SDDocumentReason
SDDocumentReasonText
_TransactionCurrency I_SalesQuotation _TransactionCurrency
_SoldToParty _SoldToParty
_SalesDocumentType _SalesDocumentType
_SalesOrganization I_SalesQuotation _SalesOrganization
_DistributionChannel _DistributionChannel
_Division _Division
_OrganizationDivision I_SalesQuotation _OrganizationDivision
_SalesOffice _SalesOffice
_SalesGroup _SalesGroup
_OverallSDProcessStatus I_SalesQuotation _OverallSDProcessStatus
_OverallSDDocReferenceStatus I_SalesQuotation _OverallSDDocReferenceStatus
_OverallSDDocumentRejectionSts I_SalesQuotation _OverallSDDocumentRejectionSts
_SalesDocApprovalStatus I_SalesQuotation _SalesDocApprovalStatus
_CreatedByUser _CreatedByUser
OrganizationBPName1 _SoldToParty OrganizationBPName1
OrganizationBPName2 _SoldToParty OrganizationBPName2
_LastChangedByUser _LastChangedByUser
_SDDocumentReason I_SalesQuotation _SDDocumentReason
_SubsequentDocType _SubsequentDocType
_SalesQuotationType I_SalesQuotation _SalesQuotationType
//@AbapCatalog.sqlViewName: 'CUST360SLSQUT'

//@AbapCatalog.compiler.compareFilter: true

//@AbapCatalog.preserveKey: true

@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales Quotations for customer 360'
@ObjectModel: {
//   compositionRoot: true,

//   representativeKey: 'SalesDocument',

   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #C,
     sizeCategory:   #L
   }
}
@VDM.viewType: #CONSUMPTION
@Metadata.allowExtensions: true
@Search.searchable: true
define view entity C_Customer360SalesQuotation
  as select from I_SalesQuotation           as SalesQuotation
    inner join   I_Customer360BusDocSetting as Customer360BusDocSetting on Customer360BusDocSetting.Cust360BusDocCategory     = 'B'
                                                                        and Customer360BusDocSetting.BusinessDocumentIsEnabled = 'X'

  association [1..1] to P_Quotationwl_Duedays         as _SalesQuotationDueDays on  $projection.SalesQuotation = _SalesQuotationDueDays.SalesQuotation

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

  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 _Division              on  $projection.SalesOrganization    = _Division.SalesOrganization
                                                                                and $projection.DistributionChannel  = _Division.DistributionChannel
                                                                                and $projection.OrganizationDivision = _Division.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 C_SalesQuotationTypeValueHelp as _SalesDocumentType     on  $projection.SalesQuotationType = _SalesDocumentType.SalesDocumentType

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

  association [0..1] to C_SalesDocumentUserVH         as _LastChangedByUser     on  $projection.LastChangedByUser = _LastChangedByUser.UserID

  association [0..*] to C_Quotation_SubsequentDocType as _SubsequentDocType     on  $projection.SalesQuotationType = _SubsequentDocType.SourceSalesDocumentType

  // association [0..*] to C_SalesDocumentItemWl         as _SalesDocumentItemWl   on  $projection.SalesQuotation = _SalesDocumentItemWl.SalesDocument


  //Extension Association

  association [1]    to E_SalesDocumentBasic          as _Extension             on  $projection.SalesQuotation = _Extension.SalesDocument
{
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold:0.8
      @Search.ranking : #HIGH
  key SalesQuotation.SalesQuotation                                                                                             as SalesQuotation,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Search.ranking: #HIGH
      SalesQuotation.PurchaseOrderByCustomer                                                                                    as PurchaseOrderByCustomer,

      @ObjectModel.foreignKey.association: '_OverallSDProcessStatus'
      @ObjectModel.text.element: ['OverallSDProcessStatusDesc']
      SalesQuotation.OverallSDProcessStatus,
      @UI.hidden: true
      SalesQuotation._OverallSDProcessStatus._Text[1:Language = $session.system_language].OverallSDProcessStatusDesc            as OverallSDProcessStatusDesc,
      //      SalesQuotation.DistributionChannel as DistributionChannel,

      //      SalesQuotation.OverallSDProcessStatus as OverallSDProcessStatus,


      @ObjectModel: { text.element: ['SoldToPartyName']      }
      SalesQuotation.SoldToParty                                                                                                as SoldToParty,

      @Semantics.text:true
      @ObjectModel.virtualElement: true
      @ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SLSQTAN_UI_PARTNER_UTIL'
      cast('' as ad_namtext )                                                                                                   as SoldToPartyName,
      

      SalesQuotation.BindingPeriodValidityStartDate                                                                             as BindingPeriodValidityStartDate,
      SalesQuotation.BindingPeriodValidityEndDate                                                                               as BindingPeriodValidityEndDate,
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      SalesQuotation.TotalNetAmount,


      @ObjectModel.text.element: ['CurrencyName']
      SalesQuotation.TransactionCurrency,
      @UI.hidden: true
      SalesQuotation._TransactionCurrency._Text[1:Language = $session.system_language].CurrencyName                             as CurrencyName,

      //      SalesQuotation.TransactionCurrency,


      SalesQuotation.SalesQuotationDate                                                                                         as SalesQuotationDate,
      SalesQuotation.CreationDate,

      @ObjectModel.foreignKey.association: '_SalesDocumentType'
      @ObjectModel.text.element: ['SalesDocumentTypeName']
      SalesQuotation.SalesQuotationType as SalesQuotationType,
      @UI.hidden: true
      SalesQuotation._SalesQuotationType._Text[1:Language = $session.system_language].SalesDocumentTypeName                     as SalesDocumentTypeName,

      //      SalesQuotation.SalesQuotationType as SalesQuotationType,



      @ObjectModel.text.element: ['SalesOrganizationName']
      SalesQuotation.SalesOrganization,
      @UI.hidden: true
      SalesQuotation._SalesOrganization._Text[1:Language = $session.system_language].SalesOrganizationName                      as SalesOrganizationName,

      //      SalesQuotation.SalesOrganization as SalesOrganization,


      @ObjectModel.foreignKey.association: '_OverallSDDocReferenceStatus'
      @UI.textArrangement: #TEXT_ONLY
      @ObjectModel.text.element: ['OverallSDDocRefStatusDesc']
      SalesQuotation.OverallSDDocReferenceStatus,
      @UI.hidden: true
      SalesQuotation._OverallSDDocReferenceStatus._Text[1:Language = $session.system_language].OverallSDDocRefStatusDesc        as OverallSDDocRefStatusDesc,

      //      SalesQuotation.OverallSDDocReferenceStatus as OverallSDDocReferenceStatus,


      @ObjectModel.foreignKey.association: '_OverallSDDocumentRejectionSts'
      @ObjectModel.text.element: ['OvrlSDDocumentRejectionStsDesc']
      SalesQuotation.OverallSDDocumentRejectionSts,
      @UI.hidden: true
      SalesQuotation._OverallSDDocumentRejectionSts._Text[1:Language = $session.system_language].OvrlSDDocumentRejectionStsDesc as OvrlSDDocumentRejectionStsDesc,
      //      SalesQuotation.OverallSDDocumentRejectionSts as OverallSDDocumentRejectionSts,


      @ObjectModel.foreignKey.association: '_SalesDocApprovalStatus'
      @ObjectModel.text.element: ['SalesDocApprovalStatusDesc']
      SalesQuotation.SalesDocApprovalStatus,
      @UI.hidden: true
      SalesQuotation._SalesDocApprovalStatus._Text[1:Language = $session.system_language].SalesDocApprovalStatusDesc            as SalesDocApprovalStatusDesc,

      //      SalesQuotation.SalesDocApprovalStatus,

      @ObjectModel.readOnly: true
      //      cast ( ( case TSTMP_IS_VALID(SalesQuotation.LastChangeDateTime)

      //        when 0 then cast( dats_tims_to_tstmp( SalesQuotation.CreationDate, SalesQuotation.CreationTime, 'UTC', $session.client, 'NULL' ) as last_changed_date_time )

      //        else SalesQuotation.LastChangeDateTime

      //      end ) as last_changed_date_time preserving type ) as LastChangeDateTime,


      cast(
      case

      when _SalesQuotationDueDays.DueDays = -999999999                                then 0  -- | 0: neutral (for unlimited or completed quotations)
      when _SalesQuotationDueDays.DueDays > 7                                         then 3  -- | 3: green colour
      when _SalesQuotationDueDays.DueDays > 0 and _SalesQuotationDueDays.DueDays <= 7 then 2  -- | 2: yellow colour
                                                                                      else 1  -- | 1: red colour

      end
      as abap.int1
      )                                                                                                                         as SlsQtanDueDateCriticality,

      cast(
      case
        when SalesQuotation.SalesDocApprovalStatus  = 'A' then  2 -- | 2: yellow colour
        when SalesQuotation.SalesDocApprovalStatus  = 'B' then  3 -- | 3: green colour
        when SalesQuotation.SalesDocApprovalStatus  = 'C' then  1 -- | 1: red colour
        when SalesQuotation.SalesDocApprovalStatus  = 'D' then  2 -- | 2: yellow colour
                                                            else  0 -- | 0: neutral
      end  as abap.int1
      )                                                                                                                         as SlsQtanApprovalStsCriticality,

      @Consumption.valueHelp: '_DistributionChannel'
      @ObjectModel.text.element: ['DistributionChannelName']
      SalesQuotation.DistributionChannel,
      @UI.hidden: true
      SalesQuotation._DistributionChannel._Text[1:Language = $session.system_language].DistributionChannelName                  as DistributionChannelName,

      //      SalesQuotation.DistributionChannel as DistributionChannel,


      @Consumption.valueHelp: '_Division'
      @ObjectModel.text.element: ['DivisionName']
      SalesQuotation.OrganizationDivision,
      @UI.hidden: true
      SalesQuotation._OrganizationDivision._Text[1:Language = $session.system_language].DivisionName                            as DivisionName,

      //      SalesQuotation.OrganizationDivision as OrganizationDivision,


      @Consumption.valueHelp: '_SalesOffice'
      @ObjectModel.text.element: ['SalesOfficeName']
      SalesQuotation.SalesOffice,
      @UI.hidden: true
      SalesQuotation._SalesOffice._Text[1:Language = $session.system_language].SalesOfficeName                                  as SalesOfficeName,

      //       SalesQuotation.SalesOffice as SalesOffice,

      @Consumption.valueHelp: '_SalesGroup'
      @ObjectModel.text.element: ['SalesGroupName']
      SalesQuotation.SalesGroup,
      @UI.hidden: true
      SalesQuotation._SalesGroup._Text[1:Language = $session.system_language].SalesGroupName                                    as SalesGroupName,

      //      SalesQuotation.SalesGroup as SalesGroup,

      @UI.textArrangement: #TEXT_FIRST
      SalesQuotation.LastChangeDate                                                                                             as LastChangeDate,

      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @UI.textArrangement: #TEXT_FIRST
      @ObjectModel.foreignKey.association: '_CreatedByUser'
      @ObjectModel.text.element: ['UserDescription']
      SalesQuotation.CreatedByUser                                                                                              as CreatedByUser,
      @Search.defaultSearchElement: true
      @Search.fuzzinessThreshold: 0.8
      @Search.ranking: #HIGH
      @UI.hidden: true
      SalesQuotation._CreatedByUser.UserDescription                                                                             as UserDescription,

      //      SalesQuotation.CreatedByUser as CreatedByUser,


      @ObjectModel.foreignKey.association: '_LastChangedByUser'
      @ObjectModel.text.element: ['LastChangedByUserDescription']
      SalesQuotation.LastChangedByUser                                                                                          as LastChangedByUser,
      @UI.hidden: true
      SalesQuotation._LastChangedByUser.UserDescription                                                                         as LastChangedByUserDescription,
      //      SalesQuotation.LastChangedByUser as LastChangedByUser,



      @ObjectModel.text.element: ['SDDocumentReasonText']
      SalesQuotation.SDDocumentReason,
      @UI.hidden: true
      SalesQuotation._SDDocumentReason._Text[1:Language = $session.system_language].SDDocumentReasonText                        as SDDocumentReasonText,
      //      SalesQuotation.SDDocumentReason as SDDocumentReason,




      @Consumption.filter.hidden: true
      SalesQuotation._TransactionCurrency,
      @Consumption.filter.hidden: true
      _SoldToParty,
      @Consumption.filter.hidden: true
      _SalesDocumentType,
      @Consumption.filter.hidden: true
      SalesQuotation._SalesOrganization,
      @Consumption.filter.hidden: true
      _DistributionChannel,
      @Consumption.filter.hidden: true
      _Division,
      @Consumption.filter.hidden: true
      SalesQuotation._OrganizationDivision,
      @Consumption.filter.hidden: true
      _SalesOffice,
      @Consumption.filter.hidden: true
      _SalesGroup,
      @Consumption.filter.hidden: true
      SalesQuotation._OverallSDProcessStatus,
      @Consumption.filter.hidden: true
      SalesQuotation._OverallSDDocReferenceStatus,
      @Consumption.filter.hidden: true
      SalesQuotation._OverallSDDocumentRejectionSts,
      @Consumption.filter.hidden: true
      SalesQuotation._SalesDocApprovalStatus,
      @Consumption.filter.hidden: true
      _CreatedByUser,
      @UI.hidden: true
      _SoldToParty.OrganizationBPName1,
      @UI.hidden: true
      _SoldToParty.OrganizationBPName2,
      @Consumption.filter.hidden: true
      _LastChangedByUser,
      @Consumption.filter.hidden: true
      SalesQuotation._SDDocumentReason,
      @Consumption.filter.hidden: true
      _SubsequentDocType,

      @Consumption.filter.hidden: true
      SalesQuotation._SalesQuotationType
      //      @Consumption.filter.hidden: true

      //      @Search.defaultSearchElement: true

      //      _SalesDocumentItemWl



}
where
      SalesQuotation.CreationDate > dats_add_days( tstmp_to_dats(tstmp_current_utctimestamp(), abap_system_timezone( $session.client,'NULL' ), $session.client, 'NULL'), -Customer360BusDocSetting.BusDocumentDurationInDays, 'INITIAL')
  and SalesQuotation.CreationDate <= $session.system_date
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_SOLDTOVALUEHELP",
"I_CURRENCY",
"I_CURRENCYTEXT",
"I_CUSTOMER360BUSDOCSETTING",
"I_DISTRIBUTIONCHANNEL",
"I_DISTRIBUTIONCHANNELTEXT",
"I_DIVISION",
"I_DIVISIONTEXT",
"I_OVERALLSDDOCREFERENCESTATUS",
"I_OVERALLSDDOCREFERENCESTATUST",
"I_OVERALLSDDOCUMENTRJCNSTATUS",
"I_OVERALLSDDOCUMENTRJCNSTATUST",
"I_OVERALLSDPROCESSSTATUS",
"I_OVERALLSDPROCESSSTATUSTEXT",
"I_SALESDOCAPPROVALSTATUS",
"I_SALESDOCAPPROVALSTATUST",
"I_SALESDOCUMENTTYPETEXT",
"I_SALESGROUP",
"I_SALESGROUPTEXT",
"I_SALESOFFICE",
"I_SALESOFFICETEXT",
"I_SALESORGANIZATION",
"I_SALESORGANIZATIONTEXT",
"I_SALESQUOTATION",
"I_SALESQUOTATIONTYPE",
"I_SDDOCUMENTREASON",
"I_SDDOCUMENTREASONTEXT",
"I_USER",
"P_QUOTATIONWL_DUEDAYS"
],
"ASSOCIATED":
[
"C_DISCHANNELVALUEHELP",
"C_ORGDIVISIONVALUEHELP",
"C_QUOTATION_SUBSEQUENTDOCTYPE",
"C_SALESDOCUMENTUSERVH",
"C_SALESGROUPVALUEHELP",
"C_SALESOFFICEVALUEHELP",
"C_SALESQUOTATIONTYPEVALUEHELP",
"C_SOLDTOVALUEHELP",
"I_CURRENCY",
"I_DIVISION",
"I_OVERALLSDDOCREFERENCESTATUS",
"I_OVERALLSDDOCUMENTRJCNSTATUS",
"I_OVERALLSDPROCESSSTATUS",
"I_SALESDOCAPPROVALSTATUS",
"I_SALESORGANIZATION",
"I_SALESQUOTATIONTYPE",
"I_SDDOCUMENTREASON"
],
"BASE":
[
"I_SALESQUOTATION"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/