C_CADocumentReversal

DDL: C_CADOCUMENTREVERSAL SQL: CCADOCREVERSE Type: view CONSUMPTION

Reverse Document

C_CADocumentReversal is a Consumption CDS View that provides data about "Reverse Document" in SAP S/4HANA. It reads from 1 data source (I_CADocumentHeader) and exposes 30 fields with key field CADocumentNumber. It has 4 associations to related views.

Data Sources (1)

SourceAliasJoin Type
I_CADocumentHeader I_CADocumentHeader from

Associations (4)

CardinalityTargetAliasCondition
[1..1] I_CADocumentType _CADocumentType $projection.CADocumentType = _CADocumentType.CADocumentType and $projection.CAApplicationArea = _CADocumentType.CAApplicationArea
[1..1] I_CADocumentOriginCode _CADocumentOriginCode $projection.CADocumentOriginCode = _CADocumentOriginCode.CADocumentOriginCode
[0..1] C_CAInvcgUserContact _CreatedByContact $projection.CreatedByUser = _CreatedByContact.ContactCardID
[0..1] P_CADocumentIsBlocked _CADocumentIsBlocked $projection.CADocumentNumber = _CADocumentIsBlocked.CADocumentNumber

Annotations (18)

NameValueLevelField
AbapCatalog.sqlViewName CCADOCREVERSE view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #CHECK view
AccessControl.personalData.blocking #NOT_REQUIRED view
EndUserText.label Reverse Document view
ClientHandling.algorithm #SESSION_VARIABLE view
VDM.viewType #CONSUMPTION view
UI.headerInfo.typeName Document view
UI.headerInfo.typeNamePlural Documents view
UI.headerInfo.title.value CADocumentNumber view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #D view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.updateEnabled true view
Search.searchable true view
UI.presentationVariant.sortOrder.by CAPostingDate view
UI.presentationVariant.sortOrder.direction #DESC view

Fields (30)

KeyFieldSource TableSource FieldDescription
KEY CADocumentNumber CADocumentNumber
CAReferenceDocument
CADocumentType CADocumentType
CADocumentTypeName
CADocumentOriginCode CADocumentOriginCode
CADocumentOriginCodeName
CAReversedDocumentNumber CAReversedDocumentNumber
CAReversalDocumentNumber CAReversalDocumentNumber
CreatedByUser CreatedByUser
CreatedByUserName _CreatedByContact FullName
CreationDate CreationDate
CAPostingDate CAPostingDate
TransactionCurrency TransactionCurrency
DocumentDate DocumentDate Document Date
CADocumentIsBlockedForUser
AuthorizationGroup _CADocumentIsBlocked AuthorizationGroup
IsBusinessPurposeCompleted _CADocumentIsBlocked IsBusinessPurposeCompleted
CANumberOfAuthorizationGroups _CADocumentIsBlocked CANumberOfAuthorizationGroups
CAClearingInformation CAClearingInformation
CAClearingDocIsExisting
CAClarificationDocIsExisting
CADocumentSemanticObject
CADocRepetitionItemIsExisting
CADocumentRepetitionItemIsOpen
ChequeIsExisting
CAAllRepetitionsAreReversed
CAPostgToClrfctnAcctIsAllowed
CAReconciliationKey CAReconciliationKey
CADocumentClass CADocumentClass
CAApplicationArea CAApplicationArea
@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":""
}
}*/