@EndUserText.label: 'Process Requests from Logistics'
@AbapCatalog:
{
sqlViewName: 'CCREQMNTR',
compiler.compareFilter: true
}
@AccessControl:
{
authorizationCheck: #MANDATORY,
personalData.blocking: #NOT_REQUIRED
}
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #CONSUMPTION
@ObjectModel:
{
createEnabled: false,
updateEnabled: false,
deleteEnabled: false,
usageType:
{
dataClass: #MIXED,
sizeCategory: #L,
serviceQuality: #C
},
semanticKey: [ 'ProductName' ]
}
@Metadata.allowExtensions: true
@Search.searchable : true
define view C_ChmlCmplncReqMntr
--Select data from basic view of chemical compliance request
as select from I_ChmlCmplncReqTP as ComplianceRequest
left outer to one join I_ChmlCmplncReqReasonDetail as ChmlCmplncReqReasonDetail on ComplianceRequest.ChmlCmplncReqDetails = ChmlCmplncReqReasonDetail.CmplncReqReasonDetailConcept
left outer to one join I_ChmlCmplncReqConfignRespy as ReqConfignRespy on ComplianceRequest.ChmlCmplncBusinessProcess = ReqConfignRespy.CmplncReqBusinessProcess
and ComplianceRequest.ChmlCmplncReqOriginProc = ReqConfignRespy.CmplncReqReason
and ComplianceRequest.ChmlCmplncReqCmplncProc = ReqConfignRespy.CmplncReqSolutionArea
and ChmlCmplncReqReasonDetail.CmplncReqReasonDetailAlias = ReqConfignRespy.CmplncReqReasonDetailAlias
-- Requested Markets (Persisted) - for area search only (cl_ehpma_cplreq_calc_exit->map_atom)
association [0..*] to C_ChmlCmplncReqMktTP as _RequestedMarket on $projection.ChmlCmplncRequestUUID = _RequestedMarket.ChmlCmplncRequestUUID
-- Requested Plants (Persisted) - for area search only (cl_ehpma_cplreq_calc_exit->map_atom)
association [0..*] to C_ChmlCmplncReqPlntTP as _RequestedPlnt on $projection.ChmlCmplncRequestUUID = _RequestedPlnt.ChmlCmplncRequestUUID
-- Requested VKOrgs (Persisted) - for area search only (cl_ehpma_cplreq_calc_exit->map_atom)
association [0..*] to C_ChmlCmplncReqSlsOrgTP as _RequestedSlsOrg on $projection.ChmlCmplncRequestUUID = _RequestedSlsOrg.ChmlCmplncRequestUUID
association [0..1] to I_ChmlCmplncInfo as _ChmlCmplncInfo on $projection.ChmlCmplncInfoUUID = _ChmlCmplncInfo.ChmlCmplncInfoUUID
--Additional Information
association [0..1] to I_ChmlCmplncBusProcVH as _BusinessProcessVH on $projection.ChmlCmplncBusinessProcess = _BusinessProcessVH.ChmlCmplncBusinessProcess
association [0..1] to I_ChmlCmplncReqOrigTypeVH as _OriginTypeVH on $projection.ChmlCmplncRequestOriginType = _OriginTypeVH.ChmlCmplncRequestOriginType
association [1..1] to I_ChmlCmplncReqOriginProcVH as _OriginProcessVH on $projection.ChmlCmplncReqOriginProc = _OriginProcessVH.ChmlCmplncReqOriginProc
association [0..1] to C_ChmlCmplncReqRequesterVH as _RequesterVH on $projection.ChmlCmplncReqBPRequester = _RequesterVH.ChmlCmplncReqBPRequester
association [0..1] to C_ChmlCmplncReqRequesterUserVH as _RequesterUserVH on $projection.ChmlCmplncReqRequester = _RequesterUserVH.UserID
association [1..1] to I_ChmlCmplncReqCmplncProcVH as _CmplncProcVH on $projection.ChmlCmplncReqCmplncProc = _CmplncProcVH.ChmlCmplncReqCmplncProc
association [0..1] to I_CmplncReqResponsibility as _ReqResponsibility on $projection.CmplncReqResponsibility = _ReqResponsibility.CmplncReqResponsibility
association [0..1] to I_Plant as _ActivePlant on $projection.ActivePlant = _ActivePlant.Plant
association [0..*] to I_SalesOrganizationText as _SalesOrganizationText on $projection.SalesOrganization = _SalesOrganizationText.SalesOrganization
--Product Information
association [0..1] to I_ProductGroup_2 as _ProductGroupVH on $projection.MaterialGroup = _ProductGroupVH.ProductGroup
{
--UUID of active chemical compliance request
@ObjectModel.readOnly: true
key ComplianceRequest.ChmlCmplncRequestUUID,
@ObjectModel.readOnly: true
ComplianceRequest.ChmlCmplncRequestUUID as ChmlCmplncRequestNavgnLink,
--Material/Product number ------------------------------------------------
@ObjectModel.readOnly: true
@ObjectModel.text.element: ['ProductName']
cast( ComplianceRequest.Material as ehfnd_cci_product preserving type ) as Material,
// -- Product Name (Material Name) ------------------------------------------------
@ObjectModel.readOnly: true
cast( ComplianceRequest._Product._Text[1: Language = $session.system_language ].ProductName as ehfnd_cci_product_name ) as ProductName,
-- Material Group (hidden for tablet) ------------------------------------------------
@ObjectModel:
{
readOnly: true,
text.element: [ 'MaterialGroupName' ],
foreignKey.association: '_ProductGroupVH'
}
cast(ComplianceRequest._Product._ProductGroup_2.ProductGroup as ehfnd_cci_material_group_l preserving type ) as MaterialGroup,
--Material Group Name
@ObjectModel.readOnly: true
ComplianceRequest._Product._ProductGroup_2._ProductGroupText[1: Language = $session.system_language ].ProductGroupName as MaterialGroupName,
-- Origin Process ------------------------------------------------
@ObjectModel:
{
readOnly: true,
text.element: [ 'ChmlCmplncReqOriginProcName' ],
foreignKey.association: '_OriginProcessVH'
}
ComplianceRequest.ChmlCmplncReqOriginProc as ChmlCmplncReqOriginProc,
-- Origin Process Name
@ObjectModel.readOnly: true
ComplianceRequest._OriginProcess._Text[1: Language = $session.system_language ].ChmlCmplncReqOriginProcName as ChmlCmplncReqOriginProcName,
-- Origin Type (hidden for tablet) ------------------------------------------------
@ObjectModel:
{
readOnly: true,
text.element: [ 'ChmlCmplncRequestOriginName' ],
foreignKey.association: '_OriginTypeVH'
}
ComplianceRequest.ChmlCmplncRequestOriginType as ChmlCmplncRequestOriginType,
-- Origin Type Name
@ObjectModel.readOnly: true
ComplianceRequest._OriginType._Text[1: Language = $session.system_language ].ChmlCmplncRequestOriginName as ChmlCmplncRequestOriginName,
-- Request Responible ------------------------------------------------
@ObjectModel:
{
readOnly: true,
text.element: [ 'CmplncReqResponsibilityName' ]
}
ReqConfignRespy.CmplncReqResponsibility as CmplncReqResponsibility,
@ObjectModel.readOnly: true
_ReqResponsibility._Text[1: Language = $session.system_language ].CmplncReqResponsibilityName as CmplncReqResponsibilityName,
-- Business Process ------------------------------------------------
@ObjectModel:
{
readOnly: true,
text.element: [ 'ChmlCmplncBusinessProcessName' ],
foreignKey.association: '_BusinessProcessVH'
}
ComplianceRequest.ChmlCmplncBusinessProcess as ChmlCmplncBusinessProcess,
--Business Process Name
@ObjectModel.readOnly: true
ComplianceRequest._BusinessProcess._Text[1: Language = $session.system_language ].ChmlCmplncBusinessProcessName as ChmlCmplncBusinessProcessName,
-- Area (calculated countries or sales organisation) ------------------------------------------------
@ObjectModel: {
readOnly: true,
virtualElement,
virtualElementCalculatedBy: 'ABAP:CL_EHPMA_CPLREQ_CALC_EXIT',
filter.transformedBy: 'ABAP:CL_EHPMA_CPLREQ_CALC_EXIT'
}
cast( '' as ehfnd_crq_subjectmatter ) as ChmlCmplncRequestSubjectMatter,
@ObjectModel: {
readOnly: true,
virtualElement,
filter.transformedBy: 'ABAP:CL_EHPMA_CPLREQ_CALC_EXIT'
}
@Semantics.address.country: true
cast( '' as ehfnd_country_desc_long ) as CountryName,
@ObjectModel: {
readOnly: true,
virtualElement,
filter.transformedBy: 'ABAP:CL_EHPMA_CPLREQ_CALC_EXIT'
// text.association: '_SalesOrganizationText'
}
cast( ' ' as ehfnd_sales_org_id preserving type ) as SalesOrganization,
@ObjectModel: {
readOnly: true,
virtualElement,
filter.transformedBy: 'ABAP:CL_EHPMA_CPLREQ_CALC_EXIT'
// text.association: '_ActivePlant'
}
cast( ' ' as ehfnd_plant_id preserving type ) as ActivePlant,
-- Compliance Process (Solution Area)
@ObjectModel:
{
readOnly: true,
text.element: [ 'ChmlCmplncReqCmplncProcName' ],
foreignKey.association: '_CmplncProcVH'
}
ComplianceRequest.ChmlCmplncReqCmplncProc as ChmlCmplncReqCmplncProc,
-- Compliance Process (Solution Area) Name
@ObjectModel.readOnly: true
ComplianceRequest._ChmlCmplncReqCmplncProc._Text[1: Language = $session.system_language ].ChmlCmplncReqCmplncProcName as ChmlCmplncReqCmplncProcName,
--Criticality due date
@ObjectModel.readOnly: true
@ObjectModel.filter.enabled: false
case
when ComplianceRequest.ChmlCmplncRequestDueDate < $session.system_date
then 1
end as DueDateCriticality,
-- Due Date
@ObjectModel.readOnly: true
ComplianceRequest.ChmlCmplncRequestDueDate as ChmlCmplncRequestDueDate,
-- Processor - display only in View "In Assessment"
@ObjectModel:
{
readOnly: true,
text.element: [ 'ChmlCmplncReqBPProcessorName' ]
}
ComplianceRequest.ChmlCmplncReqBPProcessor as ChmlCmplncReqBPProcessor,
-- User Description Processor
@ObjectModel.readOnly: true
ComplianceRequest._BusinessUserProcessor.PersonFullName as ChmlCmplncReqBPProcessorName,
-- Requester (Business User)
@ObjectModel:
{
readOnly: true,
text.element: [ 'ChmlCmplncReqBPRequesterName' ],
foreignKey.association: '_RequesterVH'
}
@Consumption.valueHelp: '_RequesterVH'
ComplianceRequest.ChmlCmplncReqBPRequester as ChmlCmplncReqBPRequester,
-- User Description
@ObjectModel.readOnly: true
ComplianceRequest._BusinessUserRequester.PersonFullName as ChmlCmplncReqBPRequesterName,
-- Requester (System User)
@ObjectModel:
{
readOnly: true,
text.element: [ 'ChmlCmplncReqRequesterName' ],
foreignKey.association: '_RequesterUserVH'
}
@Consumption.valueHelp: '_RequesterUserVH'
ComplianceRequest.ChmlCmplncReqRequester as ChmlCmplncReqRequester,
-- User Description
@ObjectModel.readOnly: true
@Semantics.text: true
ComplianceRequest._RequesterUser.UserDescription as ChmlCmplncReqRequesterName,
-- Processing Date - display only in View "In Assessment" ------------------------------------------------
@ObjectModel.readOnly: true
cast( ComplianceRequest.LastChangeUTCDateTime as ehfnd_crq_acceptdate preserving type ) as ChmlCmplncRequestProcDateTime,
-- Origin ID ( Sales Documents ID / Production order ID / Material Number ------------------------------------------------
@ObjectModel.readOnly: true
ComplianceRequest.SalesDocument as SalesDocument,
@ObjectModel.readOnly: true
case when ComplianceRequest.ProdCmplncLogsDocument != ''
then ComplianceRequest.ProdCmplncLogsDocument
else ComplianceRequest.SalesDocument
end as ProdCmplncLogsDocument,
-- Request Status --
@ObjectModel.filter.enabled: false // disable filtering otherwise collision with the defined selection variant "CLOSED" filters
@ObjectModel.foreignKey.association: '_RequestStatus'
@ObjectModel.readOnly: true
ComplianceRequest.ChmlCmplncRequestPrgrsStatus as ChmlCmplncRequestPrgrsStatus,
-- Assosiciated Packaged Product ------------------------------------------------
--UUID of chemical compliance info
@ObjectModel.readOnly: true
ComplianceRequest.ChmlCmplncInfoUUID as ChmlCmplncInfoUUID,
/*Association*/
ComplianceRequest._BusinessProcess,
ComplianceRequest._OriginType,
_ProductGroupVH,
_OriginTypeVH,
_OriginProcessVH,
_ReqResponsibility,
_BusinessProcessVH,
_CmplncProcVH,
_ChmlCmplncInfo,
_RequesterVH,
_RequesterUserVH,
_RequestedMarket,
_RequestedPlnt,
ComplianceRequest._RequestedApplication,
ComplianceRequest._RequestedPurpose,
_RequestedSlsOrg,
_ActivePlant,
_SalesOrganizationText,
ComplianceRequest._RequestStatus
}