R_DEBITCREDITDOCUMENT

CDS View

Material Ledger Debit Credit Documents

R_DEBITCREDITDOCUMENT is a CDS View in S/4HANA. Material Ledger Debit Credit Documents. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
C_MatlLdgrDebitCreditDocument view_entity projection CONSUMPTION ML Documents for Debit Credit
@AbapCatalog.viewEnhancementCategory: [ #NONE ]

@AccessControl.privilegedAssociations: [ '_CreatedBy' ]
@AccessControl.authorizationCheck: #MANDATORY
@AccessControl.personalData.blocking: #NOT_REQUIRED
@ObjectModel.usageType: { serviceQuality: #C, sizeCategory: #XL, dataClass: #MIXED }
@EndUserText.label: 'Material Ledger Debit Credit Documents'
@VDM.viewType: #COMPOSITE
@VDM.lifecycle.contract.type: #SAP_INTERNAL_API
define root view entity R_DebitCreditDocument
  as select from R_PriceChangeDocument         as header

  // select the posting date from items to include in header

  inner join   P_DebitCreditDocumentPostgDte as _Aggregation on  header.PriceChangeDocument        = _Aggregation.MaterialLedgerDocument
                                                               and header.MaterialLedgerDocumentYear = _Aggregation.MaterialLedgerDocumentYear

  association [0..1] to I_MatlLdgrDocUserContactCard as _CreatedBy on $projection.CreatedByUser = _CreatedBy.ContactCardID
  
  composition [0..*] of R_DebitCreditDocumentItem    as _Item

{

  key header.PriceChangeDocument,
  key header.MaterialLedgerDocumentYear,

      header.DocumentDate,
      header.CreationDate,
      header.CreationTime,
      cast(header.ReferenceDocumentType as fml_mpchd_ref_document_type preserving type)                                                                                  as ReferenceDocumentType,

      cast(dats_tims_to_tstmp(header.CreationDate, header.CreationTime, abap_system_timezone($session.client, 'NULL'), $session.client, 'NULL') as fap_creationdatetime) as CreationDateTime,

      cast(concat(header.PriceChangeDocument, header.MaterialLedgerDocumentYear) as fac_awkey)                                                                           as OriginalReferenceDocument,

      @ObjectModel.foreignKey.association: '_CreatedBy'
      header.CreatedByUser,

      @Semantics.nullValueIndicatorFor: 'CreatedByUser'
      case when header.CreatedByUser is initial or header.CreatedByUser is null then 'X' else '' end                                                                     as ConditionRateValueIsNull,

      header.ExecutedTransaction,
      header.BusinessTransactionType,
      header.DocumentHeaderText,
      header.MatlPrChgAcctDetnDiffntnRsn,
      _Aggregation.CompanyCode                                                                                                                                           as CompanyCode,
      _Aggregation.CompanyCodeName,
//      _Aggregation.PostingDate,

      _Aggregation.FiscalYear,
      _Aggregation.FiscalPeriod,

      _Item,
      _CreatedBy
}