//@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":""
}
}*/
Depth:
1
2
3
4
5
All
Reload
C_Customer360ApprovalBusDoc view_entity