@AbapCatalog.sqlViewName: 'CCADOCREVERSE'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@AccessControl.personalData.blocking: #NOT_REQUIRED
@EndUserText.label: 'Reverse Document'
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@UI.headerInfo: {
typeName: 'Document',
typeNamePlural: 'Documents',
title: {
value: 'CADocumentNumber'
}
}
@ObjectModel: {
usageType.dataClass: #TRANSACTIONAL,
usageType.serviceQuality: #D,
usageType.sizeCategory: #XXL,
updateEnabled: true
}
@Search.searchable: true
@UI.presentationVariant.sortOrder: { by: 'CAPostingDate', direction: #DESC }
@UI.presentationVariant.requestAtLeast: ['CADocumentIsBlockedForUser, AuthorizationGroup, IsBusinessPurposeCompleted, CANumberOfAuthorizationGroups']
define view C_CADocumentReversal
as select from I_CADocumentHeader
association [1..1] to I_CADocumentType as _CADocumentType on $projection.CADocumentType = _CADocumentType.CADocumentType
and $projection.CAApplicationArea = _CADocumentType.CAApplicationArea
association [1..1] to I_CADocumentOriginCode as _CADocumentOriginCode on $projection.CADocumentOriginCode = _CADocumentOriginCode.CADocumentOriginCode
association [0..1] to C_CAInvcgUserContact as _CreatedByContact on $projection.CreatedByUser = _CreatedByContact.ContactCardID
association [0..1] to P_CADocumentIsBlocked as _CADocumentIsBlocked on $projection.CADocumentNumber = _CADocumentIsBlocked.CADocumentNumber
{
/* Default columns in the list report*/
@UI: {
lineItem: { position: 10, importance: #HIGH },
selectionField.position: 10
}
//@Consumption.filter.defaultValue: '400042561'
//@Consumption.filter: { mandatory: true , selectionType: #SINGLE, multipleSelections: true}
@Consumption.valueHelpDefinition: [{entity: { name: 'C_CADocumentHeaderValueHelp', element: 'CADocumentNumber'}}]
@Search: { defaultSearchElement: true, fuzzinessThreshold: 1}
key CADocumentNumber,
@UI: {
lineItem: { position: 20},
selectionField.position: 20,
fieldGroup:{ qualifier: 'HeaderInfo1', groupLabel: 'Header Data', position: 10 ,importance: #HIGH}
}
@Search: { defaultSearchElement: true, fuzzinessThreshold: 1 }
cast (CAReferenceDocument as xblnr_gfn_kk preserving type) as CAReferenceDocument,
@UI: {
lineItem: {position: 30},
fieldGroup:{ qualifier: 'HeaderInfo1', position: 20 ,importance: #HIGH}
}
@ObjectModel.text.element: ['CADocumentTypeName']
@Consumption.valueHelpDefinition: [{entity: { name: 'C_CADocumentTypeValueHelp', element: 'CADocumentType'}}]
CADocumentType,
@UI.hidden: true
@Semantics.text
_CADocumentType._Text[1:Language = $session.system_language].CADocumentTypeName,
@UI: {
lineItem: {position: 40},
fieldGroup:{ qualifier: 'HeaderInfo1', position: 30 ,importance: #HIGH}
}
@ObjectModel.text.element: ['CADocumentOriginCodeName']
@Consumption.valueHelpDefinition: [{ entity: { name: 'C_CADocumentOriginCodeVH', element: 'CADocumentOriginCode'}}]
CADocumentOriginCode,
@UI.hidden: true
@Semantics.text
_CADocumentOriginCode._Text[1:Language = $session.system_language].CADocumentOriginCodeName,
@UI: {
lineItem: { position: 50},
fieldGroup:{ qualifier: 'FurtherDetails', groupLabel: 'Further Details'}
}
@Consumption.semanticObject: 'CADocument'
CAReversedDocumentNumber,
@UI: {
lineItem: { position: 60},
fieldGroup:{ qualifier: 'FurtherDetails', groupLabel: 'Further Details'}
}
@Consumption.semanticObject: 'CAClearingDocument'
CAReversalDocumentNumber,
@UI: {
lineItem: {position: 70},
fieldGroup:{ qualifier: 'HeaderInfo2', groupLabel: 'Creation Data', position: 20 ,importance: #HIGH}
}
@ObjectModel: { text.element: [ 'CreatedByUserName' ] }
@UI.textArrangement: #TEXT_ONLY
CreatedByUser,
@UI.hidden: true
@Semantics.text
_CreatedByContact.FullName as CreatedByUserName,
@UI: {
lineItem: {position: 80},
fieldGroup:{ qualifier: 'HeaderInfo2', position: 30 ,importance: #HIGH}
}
@Consumption.filter.selectionType: #INTERVAL
CreationDate,
@UI: {
lineItem: {position: 90},
fieldGroup:{ qualifier: 'HeaderInfo2', position: 10 ,importance: #HIGH}
}
@Consumption.filter.selectionType: #INTERVAL
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_CADocRptnItemPostingDateVH', element: 'CAPostingDate'}}]
CAPostingDate,
@UI: {
fieldGroup:{ qualifier: 'FurtherDetails', groupLabel: 'Further Details'}
}
@Consumption.valueHelpDefinition: [{entity: { name: 'C_CurrencyValueHelp', element: 'Currency'}}]
TransactionCurrency,
@UI: {
fieldGroup:{ qualifier: 'FurtherDetails', groupLabel: 'Further Details'}
}
@Consumption.filter.selectionType: #INTERVAL
@EndUserText.label: 'Document Date'
DocumentDate,
// Virtual Element for blocked business partner
@UI.hidden: true
@ObjectModel.readOnly: true
@ObjectModel.virtualElement: true
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_O2C_FICA_DOC_REVERSE_BLOCK'
cast ('' as xfeld) as CADocumentIsBlockedForUser,
@UI.hidden: true
_CADocumentIsBlocked.AuthorizationGroup,
@UI.hidden: true
_CADocumentIsBlocked.IsBusinessPurposeCompleted,
@UI.hidden: true
_CADocumentIsBlocked.CANumberOfAuthorizationGroups,
@UI.hidden: true
CAClearingInformation,
@UI.hidden: true
// @EndUserText.label: 'Clearing Doc'
cast('' as xfeld) as CAClearingDocIsExisting,
@UI.hidden: true
// @EndUserText.label: 'Clarification Doc'
cast('' as xfeld) as CAClarificationDocIsExisting,
@UI.hidden: true
cast('' as opbel_semobj_kk) as CADocumentSemanticObject,
@UI.hidden: true
cast('' as xfeld) as CADocRepetitionItemIsExisting,
@UI.hidden: true
cast('' as xfeld) as CADocumentRepetitionItemIsOpen,
@UI.hidden: true
cast('' as xfeld) as ChequeIsExisting,
@UI.hidden: true
cast('X' as xfeld) as CAAllRepetitionsAreReversed,
@UI.hidden: true
cast('' as xfeld) as CAPostgToClrfctnAcctIsAllowed,
@UI.hidden: true
@Consumption.valueHelpDefinition: [{ entity: { name: 'I_CAReconciliationKeyVH', element: 'CAReconciliationKey'}}]
CAReconciliationKey,
@UI.hidden: true
CADocumentClass,
@UI.hidden: true
CAApplicationArea
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_CAINVCGUSERCONTACT",
"I_CADOCUMENTHEADER",
"I_CADOCUMENTORIGINCODE",
"I_CADOCUMENTORIGINCODETEXT",
"I_CADOCUMENTTYPE",
"I_CADOCUMENTTYPETEXT",
"P_CADOCUMENTISBLOCKED"
],
"ASSOCIATED":
[
"C_CAINVCGUSERCONTACT",
"I_CADOCUMENTORIGINCODE",
"I_CADOCUMENTTYPE",
"P_CADOCUMENTISBLOCKED"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/