@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType.dataClass: #MIXED
@ObjectModel.usageType.serviceQuality: #D
@ObjectModel.usageType.sizeCategory: #XL
@ObjectModel.representativeKey: 'SalesDocument'
@EndUserText.label: 'Track Sales Orders'
@VDM.viewType: #CONSUMPTION
@AbapCatalog.compiler.compareFilter: true
@Search.searchable: true
@AccessControl.authorizationCheck: #CHECK
@Metadata.allowExtensions: true
@AccessControl.personalData.blocking: #BLOCKED_DATA_EXCLUDED
@AbapCatalog.preserveKey: true
@AbapCatalog.sqlViewName: 'CSOFANALYZER'
@AbapCatalog.dbHints: [{ dbSystem: #HDB, hint: 'NO_SUBPLAN_SHARING' }]
define view C_SlsDocFlfllmntAnalyzer
as select from I_SalesDocument as SalesDocument
left outer to one join P_SlsDocFlfllmntAnalyzer4 as FulfillmentStatus on SalesDocument.SalesDocument = FulfillmentStatus.SalesDocument --AT26.7.2023 Performance Improvement
and SalesDocument.SalesOrganization = FulfillmentStatus.SalesOrganization
and SalesDocument.DistributionChannel = FulfillmentStatus.DistributionChannel
and SalesDocument.OrganizationDivision = FulfillmentStatus.OrganizationDivision
--AT 27.07.2017: improving performance by pushing down typical sales order filter
and SalesDocument.RequestedDeliveryDate = FulfillmentStatus.RequestedDeliveryDate
--and SalesDocument.OverallSDProcessStatus = FulfillmentStatus.OverallSDProcessStatus --AT14.2.2020 no longer needed after vbap enhancement
and SalesDocument.SalesDocumentDate = FulfillmentStatus.SalesDocumentDate
and SalesDocument.SalesGroup = FulfillmentStatus.SalesGroup
and SalesDocument.SalesOffice = FulfillmentStatus.SalesOffice
and SalesDocument.SoldToParty = FulfillmentStatus.SoldToParty
and SalesDocument.PurchaseOrderByCustomer = FulfillmentStatus.PurchaseOrderByCustomer --AT26.7.2023 Attention ! vbak w/o vbkd is a data inconsistency. The resulting NULL would lead to a FALSE here !
left outer to one join I_SDDocumentCompletePartners as SoldToPartyAddressInfo on SalesDocument.SalesDocument = SoldToPartyAddressInfo.SDDocument
and SoldToPartyAddressInfo.SDDocumentItem = '000000'
and SoldToPartyAddressInfo.PartnerFunction = 'AG'
association [0..1] to I_SalesDocumentRjcnReason as _SalesDocumentRjcnReason on $projection.SalesDocumentRjcnReason = _SalesDocumentRjcnReason.SalesDocumentRjcnReason
association [0..1] to C_Dischannelvaluehelp as _DistributionChannelVH on $projection.SalesOrganization = _DistributionChannelVH.SalesOrganization
and $projection.DistributionChannel = _DistributionChannelVH.DistributionChannel
association [0..1] to C_OrgDivisionValueHelp as _OrganizationDivisionVH on $projection.SalesOrganization = _OrganizationDivisionVH.SalesOrganization
and $projection.DistributionChannel = _OrganizationDivisionVH.DistributionChannel
and $projection.OrganizationDivision = _OrganizationDivisionVH.Division
association [0..1] to C_SalesOfficeValueHelp as _SalesOfficeVH on $projection.SalesOrganization = _SalesOfficeVH.SalesOrganization
and $projection.DistributionChannel = _SalesOfficeVH.DistributionChannel
and $projection.OrganizationDivision = _SalesOfficeVH.OrganizationDivision
and $projection.SalesOffice = _SalesOfficeVH.SalesOffice
association [0..1] to C_SalesGroupValueHelp as _SalesGroupVH on $projection.SalesOffice = _SalesGroupVH.SalesOffice
and $projection.SalesGroup = _SalesGroupVH.SalesGroup
association [0..1] to C_Overallsddocumentrjcnstatus as _OverallSDDocRejectionStsVH on $projection.OverallSDDocumentRejectionSts = _OverallSDDocRejectionStsVH.OverallSDDocumentRejectionSts
//Extensibility
association [0..1] to E_SalesDocumentBasic as _Extension on SalesDocument.SalesDocument = _Extension.SalesDocument
{
//Key
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.7
@Search.ranking: #HIGH
@ObjectModel.readOnly: true
key SalesDocument.SalesDocument,
// Semantic Object
case
when SalesDocument.SDDocumentCategory = 'C'
then 'SalesOrder'
when SalesDocument.SDDocumentCategory = 'I'
then 'SalesOrderWithoutCharge'
when SalesDocument.SDDocumentCategory = 'L'
then 'DebitMemoRequest'
end
as SemanticObject,
@Consumption.valueHelpDefinition: [{entity:{name:'C_SlsOrdFlfmtOvrlFlfmtStsVH', element:'OverallFulfillmentStatus'} }]
FulfillmentStatus.OverallFulfillmentStatus,
@Consumption.valueHelpDefinition: [{entity:{name:'C_SlsOrdFlfmtOrderStatusVH', element:'FulfillmentStatusInOrder'} }]
FulfillmentStatus.FulfillmentStatusInOrder,
@Consumption.valueHelpDefinition: [{entity:{name:'C_SlsOrdFlfmtSupplyStatusVH', element:'FulfillmentStatusInSupply'} }]
FulfillmentStatus.FulfillmentStatusInSupply,
FulfillmentStatus.FulfillmentStatusInDelivery,
@Consumption.valueHelpDefinition: [{entity:{name:'C_SlsOrdFlfmtTransitStatusVH', element:'FulfillmentStatusInTransit'} }]
FulfillmentStatus.FulfillmentStatusInTransit,
@Consumption.valueHelpDefinition: [{entity:{name:'C_SlsOrdFlfmtInvoiceStatusVH', element:'FulfillmentStatusInInvoice'} }]
FulfillmentStatus.FulfillmentStatusInInvoice,
@Consumption.valueHelpDefinition: [{entity:{name:'C_SlsOrdFlfmtAcctgStsVH', element:'FulfillmentStatusInAccounting'} }]
FulfillmentStatus.FulfillmentStatusInAccounting,
FulfillmentProcessPhase,
//Category
@Consumption.valueHelpDefinition: [{entity: {name: 'C_SlsDocFlfmtSlsDocCatVH', element: 'SDDocumentCategory'} }]
SalesDocument.SDDocumentCategory,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Consumption.valueHelpDefinition: [{entity: {name: 'C_SlsDocFlfmtSlsDocTypeVH', element: 'SalesDocumentType'} }]
SalesDocument.SalesDocumentType,
@UI.hidden: true
SalesDocument.SalesDocumentProcessingType,
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.9
@ObjectModel.text.element: 'CreatedByUserName'
@Consumption.valueHelpDefinition: [{entity:{name:'C_SalesDocumentUserVH', element:'UserID'} }]
SalesDocument.CreatedByUser,
@Semantics.text: true
@ObjectModel.readOnly: true
@UI.hidden: true
_CreatedByUser.UserDescription as CreatedByUserName,
@ObjectModel.text.element: 'LastChangedByUserName'
@Consumption.valueHelpDefinition: [{entity:{name:'C_SalesDocumentUserVH', element:'UserID'} }]
SalesDocument.LastChangedByUser,
@Semantics.text: true
@ObjectModel.readOnly: true
@UI.hidden: true
_LastChangedByUser.UserDescription as LastChangedByUserName,
@Semantics.systemDate.createdAt: true
SalesDocument.CreationDate,
@Semantics.systemDate.lastChangedAt: true
SalesDocument.LastChangeDate,
//Organization
@Consumption.valueHelpDefinition: [{entity:{name:'C_SalesDocSalesOrganizationVH', element:'SalesOrganization'} }]
SalesDocument.SalesOrganization,
@Consumption.valueHelp: '_DistributionChannelVH'
SalesDocument.DistributionChannel,
@Consumption.valueHelp: '_OrganizationDivisionVH'
SalesDocument.OrganizationDivision,
@Consumption.valueHelp: '_SalesGroupVH'
SalesDocument.SalesGroup,
@Consumption.valueHelp: '_SalesOfficeVH'
SalesDocument.SalesOffice,
//Sales
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Consumption.semanticObject: 'Customer'
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_SoldToValueHelp', element: 'Customer' }}]
@ObjectModel.text.element: [ 'SoldToPartyFullName' ]
SalesDocument.SoldToParty,
@Consumption.filter.selectionType: #SINGLE
cast(SoldToPartyAddressInfo.PartnerIsOneTimeAccount as isonetimeaccountsoldtoparty) as SoldToPartyIsOneTimeAccount,
-- AT18.05.2021: changes for BP Adoption (CE2108) --*FullName
@ObjectModel.filter.enabled: false
@ObjectModel.sort.enabled: false
@Consumption.filter.hidden: true
@ObjectModel.readOnly: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOF_FULLNAME'
cast( '' as fullnamesoldtoparty ) as SoldToPartyFullName,
-- AT18.05.2021: end
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
@Consumption.filter.hidden: true
SalesDocument.PurchaseOrderByCustomer,
SalesDocument.SalesDocumentDate,
//Pricing
@DefaultAggregation: #NONE
@Semantics.amount.currencyCode: 'TransactionCurrency'
@Consumption.filter.hidden: true
@ObjectModel.filter.enabled: false
SalesDocument.TotalNetAmount,
@Semantics.currencyCode: true
@Consumption.filter.hidden: true
SalesDocument.TransactionCurrency,
@DefaultAggregation: #NONE
@Semantics.amount.currencyCode: 'TransactionCurrency'
@Consumption.filter.hidden: true
@ObjectModel.filter.enabled: false
@ObjectModel.sort.enabled: false
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_SD_SOF_TGA'
cast( 0 as slsdoc_totalamount) as TotalGrossAmount,
//Shipping
SalesDocument.RequestedDeliveryDate,
//Status
SalesDocument.OverallSDProcessStatus,
SalesDocument.OverallTotalDeliveryStatus,
@ObjectModel.foreignKey.association: '_OverallPurchaseConfStatus'
cast(SalesDocument.OverallPurchaseConfStatus as totpurchaseconfsts preserving type ) as OverallPurchaseConfStatus,
@Consumption.valueHelp: '_OverallSDDocRejectionStsVH'
SalesDocument.OverallSDDocumentRejectionSts,
SalesDocument.DeliveryBlockReason,
SalesDocument.HeaderBillingBlockReason,
@ObjectModel.foreignKey.association: '_SalesDocumentRjcnReason'
cast( ' ' as abgru_va) as SalesDocumentRjcnReason,
SalesDocApprovalStatus,
@ObjectModel.foreignKey.association: '_OverallChmlCmplncStatus'
cast(SalesDocument.OverallChmlCmplncStatus as mon_tdd_total_pcsta preserving type) as OverallChmlCmplncStatus,
@ObjectModel.foreignKey.association: '_OverallDangerousGoodsStatus'
cast(SalesDocument.OverallDangerousGoodsStatus as mon_tdd_total_dgsta preserving type) as OverallDangerousGoodsStatus,
@ObjectModel.foreignKey.association: '_OvrlSftyDataSheetSts'
cast(SalesDocument.OverallSafetyDataSheetStatus as mon_tdd_total_sdssta preserving type) as OverallSafetyDataSheetStatus,
@ObjectModel.foreignKey.association: '_OvrlTradeCmplncEmbargoStatus'
cast(SalesDocument.OverallTrdCmplncEmbargoSts as totembargochksts preserving type) as OverallTrdCmplncEmbargoSts,
@ObjectModel.foreignKey.association: '_OvTrdCmplncSnctndListChkSts'
cast(SalesDocument.OvrlTrdCmplncSnctndListChkSts as totwatchlistscrngchksts preserving type) as OvrlTrdCmplncSnctndListChkSts,
@ObjectModel.foreignKey.association: '_OvrlTrdCmplncLegalCtrlChkSts'
cast(SalesDocument.OvrlTrdCmplncLegalCtrlChkSts as totlglctrlchksts preserving type) as OvrlTrdCmplncLegalCtrlChkSts,
//Reference
@ObjectModel.foreignKey.association: '_SolutionOrder'
@Consumption.valueHelpDefinition: [ { entity: { name: 'C_BusinessSolutionOrderStdVH', element: 'BusinessSolutionOrder' } } ]
SalesDocument.BusinessSolutionOrder, --AT Added for CE2008
//Associations
@Consumption.filter.hidden: true
_OverallFulfillmentStatus,
@Consumption.filter.hidden: true
_FulfillmentStatusInOrder,
@Consumption.filter.hidden: true
_FulfillmentStatusInSupply,
@Consumption.filter.hidden: true
_FulfillmentStatusInDelivery,
@Consumption.filter.hidden: true
_FulfillmentStatusInTransit,
@Consumption.filter.hidden: true
_FulfillmentStatusInInvoice,
@Consumption.filter.hidden: true
_FulfillmentStatusInAccounting,
@Consumption.filter.hidden: true
_FulfillmentProcessPhase,
@Consumption.filter.hidden: true
_SDDocumentCategory,
@Consumption.filter.hidden: true
_SalesDocumentType,
@Consumption.filter.hidden: true
_SalesOrganization,
@Consumption.filter.hidden: true
_DistributionChannel,
@Consumption.filter.hidden: true
_OrganizationDivision,
@Consumption.filter.hidden: true
_SalesGroup,
@Consumption.filter.hidden: true
_SalesOffice,
@Consumption.filter.hidden: true
_SoldToParty,
@Consumption.filter.hidden: true
_TransactionCurrency,
@Consumption.filter.hidden: true
_OverallSDProcessStatus,
@Consumption.filter.hidden: true
_OverallPurchaseConfStatus,
@Consumption.filter.hidden: true
_OverallTotalDeliveryStatus,
@Consumption.filter.hidden: true
_OverallSDDocumentRejectionSts,
@Consumption.filter.hidden: true
_SalesDocApprovalStatus,
@Consumption.filter.hidden: true
_OverallChmlCmplncStatus,
@Consumption.filter.hidden: true
_OverallDangerousGoodsStatus,
@Consumption.filter.hidden: true
_OvrlSftyDataSheetSts,
@Consumption.filter.hidden: true
_OvrlTradeCmplncEmbargoStatus,
@Consumption.filter.hidden: true
_OvTrdCmplncSnctndListChkSts,
@Consumption.filter.hidden: true
_OvrlTrdCmplncLegalCtrlChkSts,
@Consumption.filter.hidden: true
_DeliveryBlockReason,
@Consumption.filter.hidden: true
_HeaderBillingBlockReason,
@Consumption.filter.hidden: true
_SalesDocumentRjcnReason,
@Consumption.filter.hidden: true
_DistributionChannelVH,
@Consumption.filter.hidden: true
_OrganizationDivisionVH,
@Consumption.filter.hidden: true
_SalesOfficeVH,
@Consumption.filter.hidden: true
_SalesGroupVH,
@Consumption.filter.hidden: true
_OverallSDDocRejectionStsVH,
@UI.hidden: true
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.9
_SoldToParty.OrganizationBPName1,
@UI.hidden: true
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.9
_SoldToParty.OrganizationBPName2,
@UI.hidden: true
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.9
_LastChangedByUser.UserDescription,
@Consumption.filter.hidden: true
SalesDocument._SolutionOrder --AT Added for CE2008
}
where (SalesDocument.SDDocumentCategory = 'C' or --> Order
SalesDocument.SDDocumentCategory = 'I' or --> Order w/o charge
SalesDocument.SDDocumentCategory = 'L' ) --> Debit Memo Request
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CUSTOMER",
"I_SALESDOCUMENT",
"I_SDDOCUMENTCOMPLETEPARTNERS",
"I_USER",
"P_SLSDOCFLFLLMNTANALYZER4"
],
"ASSOCIATED":
[
"C_DISCHANNELVALUEHELP",
"C_ORGDIVISIONVALUEHELP",
"C_OVERALLSDDOCUMENTRJCNSTATUS",
"C_SALESGROUPVALUEHELP",
"C_SALESOFFICEVALUEHELP",
"E_SALESDOCUMENTBASIC",
"I_BILLINGBLOCKREASON",
"I_CURRENCY",
"I_CUSTOMER",
"I_DELIVERYBLOCKREASON",
"I_DISTRIBUTIONCHANNEL",
"I_DIVISION",
"I_FULFILLMENTPROCESSPHASE",
"I_FULFILLMENTSTATUS",
"I_OVERALLCHMLCMPLNCSTATUS",
"I_OVERALLDANGEROUSGOODSSTATUS",
"I_OVERALLPURCHASECONFSTATUS",
"I_OVERALLSDDOCUMENTRJCNSTATUS",
"I_OVERALLSDPROCESSSTATUS",
"I_OVERALLTOTALDELIVERYSTATUS",
"I_OVRLSFTYDATASHEETSTS",
"I_OVRLTRADECMPLNCEMBARGOSTATUS",
"I_OVRLTRDCMPLNCLEGALCTRLCHKSTS",
"I_OVTRDCMPLNCSNCTNDLISTCHKSTS",
"I_SALESDOCAPPROVALSTATUS",
"I_SALESDOCUMENTRJCNREASON",
"I_SALESDOCUMENTTYPE",
"I_SALESGROUP",
"I_SALESOFFICE",
"I_SALESORGANIZATION",
"I_SDDOCUMENTCATEGORY",
"I_SERVICEDOCUMENTENHCD"
],
"BASE":
[
"I_SALESDOCUMENT",
"P_SLSDOCFLFLLMNTANALYZER4"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/