C_Customer360ApprovalBusDoc

DDL: C_CUSTOMER360APPROVALBUSDOC SQL: CUST360BDAPRVL Type: view_entity CONSUMPTION

Customer 360 business doc approvals

C_Customer360ApprovalBusDoc is a Consumption CDS View that provides data about "Customer 360 business doc approvals" in SAP S/4HANA. It reads from 2 data sources (I_Customer360BusDocSetting, I_SalesDocument) and exposes 19 fields with key fields SoldToParty, SalesDocument, SalesDocumentType.

Data Sources (2)

SourceAliasJoin Type
I_Customer360BusDocSetting Customer360BusDocSetting inner
I_SalesDocument SalesDocument from

Annotations (6)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
EndUserText.label Customer 360 business doc approvals view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
VDM.viewType #CONSUMPTION view

Fields (19)

KeyFieldSource TableSource FieldDescription
KEY SoldToParty I_SalesDocument SoldToParty
KEY SalesDocument I_SalesDocument SalesDocument
KEY SalesDocumentType I_SalesDocument SalesDocumentType
CustomerName
SDDocumentCategory I_SalesDocument SDDocumentCategory
SalesDocApprovalStatus I_SalesDocument SalesDocApprovalStatus
TotalNetAmount I_SalesDocument TotalNetAmount
TransactionCurrency I_SalesDocument TransactionCurrency
CreationDate I_SalesDocument CreationDate
int1asSalesDocApprovalStsCriticality
SDDocumentCategoryName
SalesDocApprovalStatusDesc
SalesDocumentTypeName
_SalesDocApprovalStatus I_SalesDocument _SalesDocApprovalStatus
_SalesDocumentType I_SalesDocument _SalesDocumentType
SalesOrganization I_SalesDocument SalesOrganization
OrganizationDivision I_SalesDocument OrganizationDivision
DistributionChannel I_SalesDocument DistributionChannel
_SDDocumentCategory I_SalesDocument _SDDocumentCategory
//@AbapCatalog.sqlViewName: 'CUST360BDAPRVL'

//@AbapCatalog.compiler.compareFilter: true

//@AbapCatalog.preserveKey: true

@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Customer 360 business doc approvals'
@ObjectModel: {
//   compositionRoot: true,

//   representativeKey: 'SalesDocument',

   usageType: {
     dataClass:      #TRANSACTIONAL,
     serviceQuality: #C,
     sizeCategory:   #L
   }
}
@VDM.viewType: #CONSUMPTION
 
define view entity C_Customer360ApprovalBusDoc
  as select from I_SalesDocument            as SalesDocument
    inner join   I_Customer360BusDocSetting as Customer360BusDocSetting on Customer360BusDocSetting.Cust360BusDocCategory             = SalesDocument.SDDocumentCategory
                                                                        and Customer360BusDocSetting.BusDocInApprovalIsEnabled = 'X'
{
       @ObjectModel.text.element: ['CustomerName']   
  key SalesDocument.SoldToParty                                                                                     as SoldToParty,
  key SalesDocument.SalesDocument,
      @ObjectModel.foreignKey.association: '_SalesDocumentType'
  key SalesDocument.SalesDocumentType,
  
         @UI.hidden: true
      SalesDocument._SoldToParty.CustomerName as CustomerName,
  
      @ObjectModel.foreignKey.association: '_SDDocumentCategory'
      SalesDocument.SDDocumentCategory,
      @ObjectModel.foreignKey.association: '_SalesDocApprovalStatus'
      SalesDocument.SalesDocApprovalStatus,
      @Semantics.amount.currencyCode: 'TransactionCurrency'
      SalesDocument.TotalNetAmount,
      SalesDocument.TransactionCurrency,
      SalesDocument.CreationDate,

      cast( case SalesDocument.SalesDocApprovalStatus
      when 'D'  then 2
      when 'A' then 0
      end   as abap.int1 )                                                                                          as SalesDocApprovalStsCriticality,

      SalesDocument._SDDocumentCategory._Text[1:Language = $session.system_language].SDDocumentCategoryName         as SDDocumentCategoryName,
      SalesDocument._SalesDocApprovalStatus._Text[1:Language = $session.system_language].SalesDocApprovalStatusDesc as SalesDocApprovalStatusDesc,
      SalesDocument._SalesDocumentType._Text[1:Language = $session.system_language].SalesDocumentTypeName           as SalesDocumentTypeName,
      //expose associations

      SalesDocument._SalesDocApprovalStatus,
      SalesDocument._SalesDocumentType,

      //For DCL

      SalesDocument.SalesOrganization,
      SalesDocument.OrganizationDivision,
      SalesDocument.DistributionChannel,

      //associations

      @Consumption.filter.hidden: true
      SalesDocument._SDDocumentCategory

}
where
     SalesDocument.SalesDocApprovalStatus = 'A'
  or SalesDocument.SalesDocApprovalStatus = 'D'
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_CUSTOMER",
"I_CUSTOMER360BUSDOCSETTING",
"I_SALESDOCAPPROVALSTATUS",
"I_SALESDOCAPPROVALSTATUST",
"I_SALESDOCUMENT",
"I_SALESDOCUMENTTYPE",
"I_SALESDOCUMENTTYPETEXT",
"I_SDDOCUMENTCATEGORY",
"I_SDDOCUMENTCATEGORYTEXT"
],
"ASSOCIATED":
[
"I_SALESDOCAPPROVALSTATUS",
"I_SALESDOCUMENTTYPE",
"I_SDDOCUMENTCATEGORY"
],
"BASE":
[
"I_SALESDOCUMENT"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/