@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Maint. Order Operation Relationship TP'
@VDM: { viewType: #COMPOSITE, lifecycle.contract.type: #SAP_INTERNAL_API }
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #L, dataClass: #TRANSACTIONAL}
@VDM.usage.type: [#TRANSACTIONAL_PROCESSING_SERVICE]
define view entity R_MaintOrderOpRelationshipTP
as select from I_MaintOrdOpRelationshipID
association to parent R_MaintenanceOrderOperationTP as _MaintenanceOrderOperation on (
$projection.MaintenanceOrderOperation = _MaintenanceOrderOperation.MaintenanceOrderOperation
and $projection.MaintenanceOrderSubOperation = _MaintenanceOrderOperation.MaintenanceOrderSubOperation
and $projection.MaintenanceOrder = _MaintenanceOrderOperation.MaintenanceOrder
)
//
association [1..1] to R_MaintenanceOrderTP as _MaintenanceOrder on $projection.MaintenanceOrder = _MaintenanceOrder.MaintenanceOrder
association [1..1] to I_MaintenanceOrderOperation as _RelatedMaintenanceOrderOp on $projection.RelatedMaintenanceOrder = _RelatedMaintenanceOrderOp.MaintenanceOrder
and $projection.RelatedMaintOrderOperation = _RelatedMaintenanceOrderOp.MaintenanceOrderOperation
association [0..1] to I_MaintOrdOpRelationshipType as _MaintOrderRelationshipType on $projection.OrderOpRelationshipIntType = _MaintOrderRelationshipType.OrderOpRelationshipIntType
{
key MaintenanceOrder,
key cast( MaintenanceOrderOperation as maintenanceorderoperation preserving type ) as MaintenanceOrderOperation,
key cast( MaintenanceOrderSubOperation as maintenanceordersuboperation preserving type ) as MaintenanceOrderSubOperation,
key I_MaintOrdOpRelationshipID.MaintOrdOperationIsSuccessor,
key I_MaintOrdOpRelationshipID.RelatedMaintenanceOrder,
key cast( RelatedMaintOrderOperation as maintenanceorderoperation preserving type ) as RelatedMaintOrderOperation,
key OrderOpRelationshipIntType,
PredecessorMaintOrderRouting,
PredecessorOrderRoutingNode,
SuccessorMaintOrderRouting,
SuccessorOrderRoutingNode,
RelatedMaintOrderRouting,
RelatedOrderRoutingNode,
FactoryCalendar,
OpRelshpOffsetDuration,
OpRelshpOffsetDurationUnit,
case OpRelshpEarliestStartTime when '240000'
then cast( tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpRelshpEarliestStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as fsabd preserving type )
else cast( tstmp_to_dats( dats_tims_to_tstmp(OpRelshpEarliestStartDate, OpRelshpEarliestStartTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as fsabd preserving type )
end as OpRelshpEarliestStartDate,
case OpRelshpEarliestStartTime when '240000'
then cast( tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpRelshpEarliestStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as fsabz preserving type )
else cast( tstmp_to_tims( dats_tims_to_tstmp(OpRelshpEarliestStartDate, OpRelshpEarliestStartTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as fsabz preserving type )
end as OpRelshpEarliestStartTime,
case OpRelationshipLatestStartTime when '240000'
then cast( tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpRelationshipLatestStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as ssabd preserving type )
else cast( tstmp_to_dats( dats_tims_to_tstmp(OpRelationshipLatestStartDate, OpRelationshipLatestStartTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as ssabd preserving type )
end as OpRelationshipLatestStartDate,
case OpRelationshipLatestStartTime when '240000'
then cast( tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpRelationshipLatestStartDate, 1, 'NULL'), cast( '000000' as abap.tims ),
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as ssabz preserving type )
else cast( tstmp_to_tims( dats_tims_to_tstmp(OpRelationshipLatestStartDate, OpRelationshipLatestStartTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as ssabz preserving type )
end as OpRelationshipLatestStartTime,
case OpRelshpEarliestFinishTime when '240000'
then cast( tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpRelshpEarliestFinishDate, 1, 'NULL'), cast( '000000' as abap.tims ),
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as feabd preserving type )
else cast( tstmp_to_dats( dats_tims_to_tstmp(OpRelshpEarliestFinishDate, OpRelshpEarliestFinishTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as feabd preserving type )
end as OpRelshpEarliestFinishDate,
case OpRelshpEarliestFinishTime when '240000'
then cast( tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpRelshpEarliestFinishDate, 1, 'NULL'), cast( '000000' as abap.tims ),
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as feabz preserving type )
else cast( tstmp_to_tims( dats_tims_to_tstmp(OpRelshpEarliestFinishDate, OpRelshpEarliestFinishTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as feabz preserving type )
end as OpRelshpEarliestFinishTime,
case OpRelshpLatestFinishTime when '240000'
then cast( tstmp_to_dats( dats_tims_to_tstmp(dats_add_days( OpRelshpLatestFinishDate, 1, 'NULL'), cast( '000000' as abap.tims ),
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as seabd preserving type )
else cast( tstmp_to_dats( dats_tims_to_tstmp(OpRelshpLatestFinishDate, OpRelshpLatestFinishTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as seabd preserving type )
end as OpRelshpLatestFinishDate,
case OpRelshpLatestFinishTime when '240000'
then cast( tstmp_to_tims( dats_tims_to_tstmp(dats_add_days( OpRelshpLatestFinishDate, 1, 'NULL'), cast( '000000' as abap.tims ),
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as seabz preserving type )
else cast( tstmp_to_tims( dats_tims_to_tstmp(OpRelshpLatestFinishDate, OpRelshpLatestFinishTime,
abap_system_timezone( $session.client,'NULL' ),
$session.client, 'NULL'), 'UTC', $session.client, 'NULL' ) as seabz preserving type )
end as OpRelshpLatestFinishTime,
_MaintenanceOrder,
_MaintenanceOrderOperation,
_RelatedMaintenanceOrderOp,
_MaintOrderRelationshipType
}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MAINTORDOPRELATIONSHIPID"
],
"ASSOCIATED":
[
"I_MAINTENANCEORDEROPERATION",
"I_MAINTORDOPRELATIONSHIPTYPE",
"R_MAINTENANCEORDEROPERATIONTP",
"R_MAINTENANCEORDERTP"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/