@AbapCatalog: { sqlViewName: 'PDISPCASEDR',
compiler: { compareFilter: true },
preserveKey: true }
@AccessControl: { authorizationCheck: #NOT_REQUIRED,
personalData: { blocking: #BLOCKED_DATA_EXCLUDED },
privilegedAssociations: [ '_DraftAdministrativeData' ] }
@VDM: { viewType: #COMPOSITE,
private: true }
@ClientHandling: { algorithm: #SESSION_VARIABLE }
@ObjectModel: { usageType: { serviceQuality: #A,
sizeCategory: #L,
dataClass: #TRANSACTIONAL },
representativeKey: 'DisputeCaseUUID' }
define view P_DisputeCaseDraft
as select from R_DisputeCase
// VDM Associations
// Root Cause Code
association [0..1] to I_RootCause as _RootCause on $projection.DisputeCaseRootCause = _RootCause.DisputeCaseRootCause
and $projection.CaseType = _RootCause.CaseType
// Created by Contact Card
association [0..1] to I_UserContactCard as _CreatedByContactCard on $projection.CaseCreatedBy = _CreatedByContactCard.ContactCardID
// Changed by Contact Card
association [0..1] to I_UserContactCard as _ChangedByContactCard on $projection.CaseLastChangedBy = _ChangedByContactCard.ContactCardID
// Closed by Contact Card
association [0..1] to I_UserContactCard as _ClosedByContactCard on $projection.CaseClosedBy = _ClosedByContactCard.ContactCardID
// Processor Contact Card
association [0..1] to I_UserContactCard as _ProcessorContactCard on $projection.CaseProcessor = _ProcessorContactCard.ContactCardID
// Person Responsible Contact Card
association [0..1] to I_UserContactCard as _ResponsibleContactCard on $projection.CaseResponsible = _ResponsibleContactCard.ContactCardID
// Draft
association [0..1] to I_DisputeCaseDraft as _DisputeCaseDraft on $projection.DisputeCaseUUID = _DisputeCaseDraft.DisputeCaseUUID
// Dispute Case Coordinator
association [0..1] to I_UserContactCard as _DisputeCaseCoordinatorCard on $projection.DisputeCaseCoordinator = _DisputeCaseCoordinatorCard.ContactCardID
// Customer
association [0..1] to I_Customer as _Customer on $projection.Customer = _Customer.Customer
// Company Code
association [0..1] to I_CompanyCode as _CompanyCode on $projection.CompanyCode = _CompanyCode.CompanyCode
// External Application
association [0..1] to I_DisputeCaseExternalAppl as _DisputeCaseExternalAppl on $projection.DisputeCaseExternalApplication = _DisputeCaseExternalAppl.DisputeCaseExternalApplication
// Country
association [0..1] to I_Country as _Country on $projection.ContactPersonFaxCountry = _Country.Country
// Case Entity
association [0..1] to I_Caseentity as _CaseEntity on $projection.CaseID = _CaseEntity.CaseUniqueID
// Case Types
association [0..1] to I_Casetypes as _CaseTypes on $projection.CaseType = _CaseTypes.CaseType
// Case Escalation Reason
association [0..1] to I_CaseEscalationReason as _Escalation on $projection.CaseEscalationReason = _Escalation.CaseEscalationReason
// Case Category
association [0..1] to I_CaseCategory as _CaseCategory on $projection.CaseCategory = _CaseCategory.CaseCategory
and $projection.CaseType = _CaseCategory.CaseType
// Case Priority
association [0..1] to I_CasePriority as _Priority on $projection.CasePriority = _Priority.CasePriority
// Case Authorization Level
association [0..1] to I_Caseauthorizationlevel as _AuthLevel on $projection.CaseAuthorizationLevel = _AuthLevel.CaseAuthorizationLevel
// Status Profile
association [0..1] to I_CaseStatusProfile as _StatProfile on $projection.CaseStatusProfile = _StatProfile.CaseStatusProfile
// Case Status
association [0..1] to I_Caseindividualstatus as _Individual on $projection.CaseStatus = _Individual.CaseStatus
and $projection.CaseStatusProfile = _Individual.CaseStatusProfile
// System Status
association [0..1] to I_CaseSystemStatus as _CaseSystemStatus on $projection.CaseSystemStatus = _CaseSystemStatus.CaseSystemStatus
// Case Reason
association [0..1] to I_CaseReasons as _Reasons on $projection.CaseReason = _Reasons.CaseReason
and $projection.CaseType = _Reasons.CaseType
// Draft Admin Table
association [0..1] to I_DraftAdministrativeData as _DraftAdministrativeData on $projection.DraftAdministrativeDataUUID = _DraftAdministrativeData.DraftUUID
and _DraftAdministrativeData.DraftEntityType = 'R_DISPUTECASETP'
{
// VDM Fields
key DisputeCaseUUID,
_DisputeCaseDraft.DraftUUID as DraftUUID,
case
when _DisputeCaseDraft.DraftUUID is null
then DisputeCaseCoordinator
else _DisputeCaseDraft.DisputeCaseCoordinator
end as DisputeCaseCoordinator,
case
when _DisputeCaseDraft.DraftUUID is null
then DisputeCaseRootCause
else _DisputeCaseDraft.DisputeCaseRootCause
end as DisputeCaseRootCause,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseProcessingDeadlineDate
else _DisputeCaseDraft.CaseProcessingDeadlineDate
end as CaseProcessingDeadlineDate,
case
when _DisputeCaseDraft.DraftUUID is null
then OriginalAmount
else _DisputeCaseDraft.OriginalAmount
end as OriginalAmount,
case
when _DisputeCaseDraft.DraftUUID is null
then DisputedAmount
else _DisputeCaseDraft.DisputedAmount
end as DisputedAmount,
case
when _DisputeCaseDraft.DraftUUID is null
then PaidAmount
else _DisputeCaseDraft.PaidAmount
end as PaidAmount,
case
when _DisputeCaseDraft.DraftUUID is null
then CreditedAmount
else _DisputeCaseDraft.CreditedAmount
end as CreditedAmount,
case
when _DisputeCaseDraft.DraftUUID is null
then WriteOffAmount
else _DisputeCaseDraft.WriteOffAmount
end as WriteOffAmount,
case
when _DisputeCaseDraft.DraftUUID is null
then ManuallyClearedAmount
else _DisputeCaseDraft.ManuallyClearedAmount
end as ManuallyClearedAmount,
case
when _DisputeCaseDraft.DraftUUID is null
then DisputeCaseCurrency
else _DisputeCaseDraft.DisputeCaseCurrency
end as DisputeCaseCurrency,
case
when _DisputeCaseDraft.DraftUUID is null
then ContactPersonName
else _DisputeCaseDraft.ContactPersonName
end as ContactPersonName,
case
when _DisputeCaseDraft.DraftUUID is null
then ContactPersonEmailAddress
else _DisputeCaseDraft.ContactPersonEmailAddress
end as ContactPersonEmailAddress,
case
when _DisputeCaseDraft.DraftUUID is null
then ContactPersonPhoneNumber
else _DisputeCaseDraft.ContactPersonPhoneNumber
end as ContactPersonPhoneNumber,
case
when _DisputeCaseDraft.DraftUUID is null
then ContactPersonFaxNumber
else _DisputeCaseDraft.ContactPersonFaxNumber
end as ContactPersonFaxNumber,
case
when _DisputeCaseDraft.DraftUUID is null
then ContactPersonFaxCountry
else _DisputeCaseDraft.ContactPersonFaxCountry
end as ContactPersonFaxCountry,
case
when _DisputeCaseDraft.DraftUUID is null
then ContactPerson
else _DisputeCaseDraft.ContactPerson
end as ContactPerson,
case
when _DisputeCaseDraft.DraftUUID is null
then Customer
else _DisputeCaseDraft.Customer
end as Customer,
case
when _DisputeCaseDraft.DraftUUID is null
then CompanyCode
else _DisputeCaseDraft.CompanyCode
end as CompanyCode,
case
when _DisputeCaseDraft.DraftUUID is null
then DisputeCaseExternalApplication
else _DisputeCaseDraft.DisputeCaseExternalApplication
end as DisputeCaseExternalApplication,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseType
else _DisputeCaseDraft.CaseType
end as CaseType,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseID
else _DisputeCaseDraft.CaseID
end as CaseID,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseExternalReference
else _DisputeCaseDraft.CaseExternalReference
end as CaseExternalReference,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseCreatedBy
else _DisputeCaseDraft.CaseCreatedBy
end as CaseCreatedBy,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseCreatedOn
else _DisputeCaseDraft.CaseCreatedOn
end as CaseCreatedOn,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseLastChangedBy
else _DisputeCaseDraft.CaseLastChangedBy
end as CaseLastChangedBy,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseLastChangedOn
else _DisputeCaseDraft.CaseLastChangedOn
end as CaseLastChangedOn,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseClosedBy
else _DisputeCaseDraft.CaseClosedBy
end as CaseClosedBy,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseClosedTime
else _DisputeCaseDraft.CaseClosedTime
end as CaseClosedTime,
case
when _DisputeCaseDraft.DraftUUID is null
then CasePlannedCloseDate
else _DisputeCaseDraft.CasePlannedCloseDate
end as CasePlannedCloseDate,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseProcessor
else _DisputeCaseDraft.CaseProcessor
end as CaseProcessor,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseResponsible
else _DisputeCaseDraft.CaseResponsible
end as CaseResponsible,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseTitle
else _DisputeCaseDraft.CaseTitle
end as CaseTitle,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseEscalationReason
else _DisputeCaseDraft.CaseEscalationReason
end as CaseEscalationReason,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseCategory
else _DisputeCaseDraft.CaseCategory
end as CaseCategory,
case
when _DisputeCaseDraft.DraftUUID is null
then CasePriority
else _DisputeCaseDraft.CasePriority
end as CasePriority,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseAuthorizationLevel
else _DisputeCaseDraft.CaseAuthorizationLevel
end as CaseAuthorizationLevel,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseStatusProfile
else _DisputeCaseDraft.CaseStatusProfile
end as CaseStatusProfile,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseStatus
else _DisputeCaseDraft.CaseStatus
end as CaseStatus,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseSystemStatus
else _DisputeCaseDraft.CaseSystemStatus
end as CaseSystemStatus,
case
when _DisputeCaseDraft.DraftUUID is null
then CaseReason
else _DisputeCaseDraft.CaseReason
end as CaseReason,
case
when _DisputeCaseDraft.DraftUUID is null
then CustomerDisputedAmount
else _DisputeCaseDraft.CustomerDisputedAmount
end as CustomerDisputedAmount,
case
when _DisputeCaseDraft.DraftUUID is null
then CustomerDisputedCurrency
else _DisputeCaseDraft.CustomerDisputedCurrency
end as CustomerDisputedCurrency,
cast( case
when _DisputeCaseDraft.DraftUUID is null
then 'X'
else ''
end as boolean ) as IsActiveEntity,
cast ( 'X'as boolean ) as HasActiveEntity,
cast( case
when _DisputeCaseDraft.DraftUUID is null
then 0
else _DisputeCaseDraft.DraftCreationDateTime
end as sdraft_created_at ) as DraftCreationDateTime,
cast( case
when _DisputeCaseDraft.DraftUUID is null
then 0
else _DisputeCaseDraft.DraftLastChangedDateTime
end as sdraft_last_changed_at ) as DraftLastChangedDateTime,
_DisputeCaseDraft.DraftAdministrativeDataUUID as DraftAdministrativeDataUUID,
// Exposed Associations
_AuthLevel,
_CaseSystemStatus,
_CaseTypes,
_CaseCategory,
_ChangedByContactCard,
_ClosedByContactCard,
_CompanyCode,
_Country,
_CreatedByContactCard,
_Customer,
_DisputeCaseCoordinatorCard,
_DisputeCaseExternalAppl,
_Escalation,
_Individual,
_Priority,
_ProcessorContactCard,
_Reasons,
_ResponsibleContactCard,
_RootCause,
_StatProfile,
_DraftAdministrativeData
}
union all select from I_DisputeCaseDraft
// Draft Admin Table
association [0..1] to I_DraftAdministrativeData as _DraftAdministrativeData on $projection.DraftAdministrativeDataUUID = _DraftAdministrativeData.DraftUUID
and _DraftAdministrativeData.DraftEntityType = 'R_DISPUTECASETP'
{
// VDM Fields
key DisputeCaseUUID,
DraftUUID,
DisputeCaseCoordinator,
DisputeCaseRootCause,
CaseProcessingDeadlineDate,
OriginalAmount,
DisputedAmount,
PaidAmount,
CreditedAmount,
WriteOffAmount,
ManuallyClearedAmount,
DisputeCaseCurrency,
ContactPersonName,
ContactPersonEmailAddress,
ContactPersonPhoneNumber,
ContactPersonFaxNumber,
ContactPersonFaxCountry,
ContactPerson,
Customer,
CompanyCode,
DisputeCaseExternalApplication,
CaseType,
CaseID,
CaseExternalReference,
CaseCreatedBy,
CaseCreatedOn,
CaseLastChangedBy,
CaseLastChangedOn,
CaseClosedBy,
CaseClosedTime,
CasePlannedCloseDate,
CaseProcessor,
CaseResponsible,
CaseTitle,
CaseEscalationReason,
CaseCategory,
CasePriority,
CaseAuthorizationLevel,
CaseStatusProfile,
CaseStatus,
CaseSystemStatus,
CaseReason,
CustomerDisputedAmount,
CustomerDisputedCurrency,
cast( '' as boolean ) as IsActiveEntity,
HasActiveEntity,
DraftCreationDateTime,
DraftLastChangedDateTime,
DraftAdministrativeDataUUID,
// Exposed Associations
_AuthLevel,
_CaseSystemStatus,
_CaseTypes,
_CaseCategory,
_ChangedByContactCard,
_ClosedByContactCard,
_CompanyCode,
_Country,
_CreatedByContactCard,
_Customer,
_DisputeCaseCoordinatorCard,
_DisputeCaseExternalAppl,
_Escalation,
_Individual,
_Priority,
_ProcessorContactCard,
_Reasons,
_ResponsibleContactCard,
_RootCause,
_StatProfile,
_DraftAdministrativeData
}
where
HasActiveEntity <> 'X'
and _DraftAdministrativeData.DraftIsCreatedByMe = 'X'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DISPUTECASEDRAFT",
"I_DRAFTADMINISTRATIVEDATA",
"R_DISPUTECASE"
],
"ASSOCIATED":
[
"I_CASEAUTHORIZATIONLEVEL",
"I_CASECATEGORY",
"I_CASEENTITY",
"I_CASEESCALATIONREASON",
"I_CASEINDIVIDUALSTATUS",
"I_CASEPRIORITY",
"I_CASEREASONS",
"I_CASESTATUSPROFILE",
"I_CASESYSTEMSTATUS",
"I_CASETYPES",
"I_COMPANYCODE",
"I_COUNTRY",
"I_CUSTOMER",
"I_DISPUTECASEDRAFT",
"I_DISPUTECASEEXTERNALAPPL",
"I_DRAFTADMINISTRATIVEDATA",
"I_ROOTCAUSE",
"I_USERCONTACTCARD"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/