-------------------------------------------------------------------------------
-- Assess Marketability Sub Object Page (Market Assessment for one Country)
-------------------------------------------------------------------------------
@EndUserText.label: 'Market Assessment for one Country/Region'
@Metadata.allowExtensions: true
@AbapCatalog:
{
sqlViewName: 'CCCMKTCVRGTP',
compiler.compareFilter: true
}
@AccessControl:
{
authorizationCheck: #CHECK,
privilegedAssociations: [ '_ContactData' ],
// blocking of personal data not required (no personal data fields exposed for material; user can not be blocked and no business partner data from user exposed)
personalData.blocking: #NOT_REQUIRED
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@ObjectModel:
{
transactionalProcessingDelegated: true,
createEnabled: true,
updateEnabled: true,
deleteEnabled: 'EXTERNAL_CALCULATION',
semanticKey: [ 'CountryName' ],
usageType:
{
dataClass: #MASTER,
sizeCategory: #M,
serviceQuality: #C
}
}
@UI:
{
headerInfo:
{
typeName: 'Product - Assess for One Country/Region',
typeNamePlural: 'Assess Markets and Production Countries/Regions',
title:
{
label: 'Material Name',
value: 'CountryName'
}
},
presentationVariant :
{
sortOrder: [{by: 'CountryName', direction: 'ASC' }],
requestAtLeast: [ 'ChmlCmplncInfoUUID', 'CountryName', 'Country' ]
}
}
--Search - at the moment not possible with virtual elements
@Search.searchable : true
define view C_ChmlCmplncMktCvrgTP
as select from I_ChmlCmplncMktCvrgTP
-- Use association alias _ChmlCmplncInfo from transactional view I_ChmlCmplncMktReqTP to make sure SADL can handle CRUD operations !!!
association [1..1] to C_ChmlCmplncMktTP as _ChmlCmplncInfo on _ChmlCmplncInfo.ChmlCmplncInfoUUID = $projection.ChmlCmplncInfoUUID
-- Corresponding non-transactional Consumption View
association [0..1] to P_ChmlCmplncMktCvrg as _ChmlCmplncMktCvrg on _ChmlCmplncMktCvrg.ChmlCmplncMktCvrgUUID = $projection.ActiveChmlCmplncMktCvrgUUID
-- Marketability Request
association [0..1] to I_ChmlCmplncMktReqTP as _ChmlCmplncMktReq on _ChmlCmplncMktReq.ActiveChmlCmplncInfoUUID = $projection.ActiveChmlCmplncInfoUUID
and _ChmlCmplncMktReq.Country = $projection.Country
-- Value Helps for Coverage Status
association [0..1] to I_ChmlCmplncMktCvrgStsVH as _CvrgStsProdnVH on _CvrgStsProdnVH.ChmlCmplncCvrgStatus = $projection.ChmlCmplncProdnAllwd
association [0..1] to I_ChmlCmplncMktCvrgStsVH as _CvrgStsSalesVH on _CvrgStsSalesVH.ChmlCmplncCvrgStatus = $projection.ChmlCmplncSalesAllwd
-- Marketability for Packaged Products
association [0..*] to C_ChmlCmplncMktCvrgProdAssgmt as _PackagedProducts on _PackagedProducts.ChmlCmplncProdUUID = $projection.ActiveChmlCmplncInfoUUID
and _PackagedProducts.Country = $projection.Country
-- Compliance Requirement Results
association [0..*] to C_ChmlCmplncMktCmplRqRslt as _CmplRqRslt on _CmplRqRslt.ChmlCmplncProdUUID = $projection.ActiveChmlCmplncInfoUUID
and (
_CmplRqRslt.Country = $projection.Country
or _CmplRqRslt.Country = 'Worldwide'
)
-- Contact Data
association [0..1] to C_ChmlContactData as _ContactData on $projection.LastChangedByUser = _ContactData.ContactCardID
{
// Market Coverage UUID
@ObjectModel.readOnly: true
key ChmlCmplncMktCvrgUUID,
// Active Market Coverage UUID
@ObjectModel.readOnly: true
ActiveChmlCmplncMktCvrgUUID,
// Market Request UUID
@ObjectModel.readOnly: true
ChmlCmplncMktReqUUID,
// Chemical Compliance Information UUID
@ObjectModel.readOnly: true
ChmlCmplncInfoUUID,
// Active Chemical Compliance Information UUID
@ObjectModel.readOnly: true
ActiveChmlCmplncInfoUUID,
// Active CCI UUID as navigation link
@ObjectModel.readOnly: true
ActiveChmlCmplncInfoUUID as ChmlCmplncInfoNavgnLink,
// Internal Name
@ObjectModel.readOnly: true
_ChmlCmplncInfo.ChmlCmplncInternalName,
// Combined Name
@ObjectModel.readOnly: true
// @Consumption.semanticObject: 'UnpackagedChemicalInfo'
cast(_ChmlCmplncMktCvrg._MaterialDataPrimary.ChmlCmplncInfoCombinedName as ehfnd_cci_up ) as ChmlCmplncInfoCombinedName,
// Application
@ObjectModel.readOnly: true
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT3'
cast( '' as ehpma_application ) as ChmlCmplncApplication,
// Last Changed By
@ObjectModel.readOnly: true
@ObjectModel.text.element: [ 'UserDescription' ]
LastChangedByUser,
// Last Changed By Name
@ObjectModel.readOnly: true
_LastChangedByUser.UserDescription,
// Last Changed Date
@ObjectModel.readOnly: true
LastChangeUTCDateTime,
// Country Name (needed for sorting)
@ObjectModel.readOnly: true
_ChmlCmplncMktCvrg.ChmlCmplncInfoCntryProdName as ChmlCmplncInfoCntryProdName,
@ObjectModel.readOnly: true
cast(_Country._Text[1: Language = $session.system_language ].CountryName as ehfnd_country_desc_long) as CountryName,
// Country
Country,
// Specific Coverage Exists Indicator
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
cast( '' as ehpma_specific_cov_exists) as ChmlCmplncSpcfcCvrgExists,
// Specific Coverage Exists Name
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
cast( '' as ehpma_specific_cov_exists_dsc ) as ChmlCmplncSpcfcCvrgExistsName,
// Production is Requested Indicator
@ObjectModel.readOnly: true
_ChmlCmplncMktReq.ChmlCmplncProdnIsReqd as ChmlCmplncProdnIsReqd,
// Production is Requested Name
@ObjectModel:
{
readOnly: true
}
// Used in Side Effects!
cast (_ChmlCmplncMktReq._ReqStsProdn._Text[1: Language = $session.system_language ].ChmlCmplncReqStatusName
as ehfnd_cci_prod_is_rqstd_dsc) as ChmlCmplncProdnIsReqdName,
// Production is Requested Criticality
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
// Used in Side Effects!
cast( 0 as integer ) as ChmlCmplncProdnIsReqdCritlty,
// Production Allowed Indicator
@ObjectModel:
{
text.element: [ 'ChmlCmplncProdnAllwdName' ],
foreignKey.association: '_CvrgStsProdnVH'
}
// Used in Side Effects!
ChmlCmplncProdnAllwd,
// Production Allowed Name
@ObjectModel.readOnly: true
@Semantics.text: true
// Used in Side Effects!
_CvrgStsProdnVH.ChmlCmplncCvrgStatusName as ChmlCmplncProdnAllwdName,
// Production Allowed Criticality
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
// Used in Side Effects!
cast( 0 as integer ) as ChmlCmplncProdnCvrgStsCritlty,
// Production Combined Coverage Request Status Name
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
// Used in Side Effects!
cast( '' as ehpma_prod_covreq_status_dsc ) as ChmlCmplncProdnAllwdReqdName,
// Production Combined Coverage Request Status Criticality
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
// Used in Side Effects!
cast( 0 as integer ) as ChmlCmplncProdnCvrgReqdCritlty,
// Sales is Requested Indicator
@ObjectModel.readOnly: true
_ChmlCmplncMktReq.ChmlCmplncSalesIsReqd as ChmlCmplncSalesIsReqd,
// Sales is Requested Name
@ObjectModel:
{
readOnly: true
}
// Used in Side Effects!
cast(_ChmlCmplncMktReq._ReqStsSales._Text[1: Language = $session.system_language ].ChmlCmplncReqStatusName as ehfnd_cci_sales_is_rqstd_dsc) as ChmlCmplncSalesIsReqdName,
// Sales is Requested Criticality
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
// Used in Side Effects!
cast( 0 as integer ) as ChmlCmplncSalesIsReqdCritlty,
// Sales Allowed Indicator
@ObjectModel:
{
foreignKey.association: '_CvrgStsSalesVH',
text.element: [ 'ChmlCmplncSalesAllwdName' ]
}
// Used in Side Effects!
ChmlCmplncSalesAllwd,
// Sales Allowed Name
@ObjectModel.readOnly: true
@Semantics.text: true
// Used in Side Effects!
_CvrgStsSalesVH.ChmlCmplncCvrgStatusName as ChmlCmplncSalesAllwdName,
// Sales Allowed Criticality
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
// Used in Side Effects!
cast( 0 as integer ) as ChmlCmplncSalesCvrgStsCritlty,
// Sales Combined Coverage Request Status Name
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
// Used in Side Effects!
cast( '' as ehpma_sales_covreq_status_dsc ) as ChmlCmplncSalesAllwdReqdName,
// Sales Combined Coverage Request Status Criticality
@ObjectModel.virtualElement
@ObjectModel.virtualElementCalculatedBy: 'ABAP:CL_EHPMA_MKT_CALC_EXIT1'
@ObjectModel.readOnly: true
// Used in Side Effects!
cast( 0 as integer ) as ChmlCmplncSalesCvrgReqdCritlty,
// Marktetability remark
ChmlCmplncMktCvrgRemark,
/* Associations */
@ObjectModel.association.type: [ #TO_COMPOSITION_PARENT, #TO_COMPOSITION_ROOT ]
_ChmlCmplncInfo,
_ChmlCmplncMktReq,
_CvrgStsProdnVH,
_CvrgStsSalesVH,
_PackagedProducts,
_CmplRqRslt,
_ContactData,
_Country
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"C_CHMLCMPLNCMKTTP",
"C_CHMLCMPLNCPRIMMATL",
"I_CHMLCMPLNCMKTCVRGSTSVH",
"I_CHMLCMPLNCMKTCVRGTP",
"I_CHMLCMPLNCMKTREQSTS",
"I_CHMLCMPLNCMKTREQSTSTXT",
"I_CHMLCMPLNCMKTREQTP",
"I_COUNTRY",
"I_COUNTRYTEXT",
"I_USER",
"P_CHMLCMPLNCMKTCVRG"
],
"ASSOCIATED":
[
"C_CHMLCMPLNCMKTCMPLRQRSLT",
"C_CHMLCMPLNCMKTCVRGPRODASSGMT",
"C_CHMLCMPLNCMKTTP",
"C_CHMLCONTACTDATA",
"I_CHMLCMPLNCMKTCVRGSTSVH",
"I_CHMLCMPLNCMKTREQTP",
"I_COUNTRY",
"P_CHMLCMPLNCMKTCVRG"
],
"BASE":
[
"I_CHMLCMPLNCMKTCVRGTP"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/