P_MAINTENANCEORDERCONFIRMATION

CDS View

Maintenance Order Confirmation

P_MAINTENANCEORDERCONFIRMATION is a CDS View in S/4HANA. Maintenance Order Confirmation. It contains 53 fields. 1 CDS views read from this table.

CDS Views using this table (1)

ViewTypeJoinVDMDescription
I_MaintenanceOrderConfirmation view from BASIC Maintenance Order Confirmation

Fields (53)

KeyField CDS FieldsUsed in Views
KEY MaintOrderConf MaintOrderConf 1
KEY MaintOrderConfCntrValue MaintOrderConfCntrValue 1
AccountingIndicatorCode AccountingIndicatorCode 1
ActivityType ActivityType 1
ActualDuration ActualDuration 1
ActualDurationUnit ActualDurationUnit 1
ActualWorkQuantity ActualWorkQuantity 1
ActualWorkQuantityUnit ActualWorkQuantityUnit 1
ActyConfFcstdEndDate ActyConfFcstdEndDate 1
ActyConfFcstdEndTime ActyConfFcstdEndTime 1
CancldMaintOrderConfCntrValue CancldMaintOrderConfCntrValue 1
CapacityInternalID CapacityInternalID 1
ConfirmationExternalEntryDate ConfirmationExternalEntryDate 1
ConfirmationExternalEntryTime ConfirmationExternalEntryTime 1
ConfirmationReworkQuantity ConfirmationReworkQuantity 1
ConfirmationScrapQuantity ConfirmationScrapQuantity 1
ConfirmationText ConfirmationText 1
ConfirmationUnit ConfirmationUnit 1
ConfirmationYieldQuantity ConfirmationYieldQuantity 1
EmployeeWageGroup EmployeeWageGroup 1
EmployeeWageType EmployeeWageType 1
EnteredByExternalUser EnteredByExternalUser 1
EnteredByUser EnteredByUser 1
IsFinalConfirmation IsFinalConfirmation 1
IsReversal IsReversal 1
IsReversed IsReversed 1
Language Language 1
LastChangeDate LastChangeDate 1
LastChangedByUser LastChangedByUser 1
LongTextExists LongTextExists 1
MaintenanceOrder MaintenanceOrder 1
MaintenanceOrderOperation MaintenanceOrderOperation 1
MaintenanceOrderSubOperation MaintenanceOrderSubOperation 1
MaintOrderConfirmationEntryDte MaintOrderConfirmationEntryDte 1
MaintOrderConfirmationEntryTme MaintOrderConfirmationEntryTme 1
MaintOrderOperationCounter MaintOrderOperationCounter 1
MaintOrderOperationInternalID MaintOrderOperationInternalID 1
MaintOrderRoutingNumber MaintOrderRoutingNumber 1
MaterialDocument MaterialDocument 1
NmbrOfMaintTechnicianCapSplits NmbrOfMaintTechnicianCapSplits 1
NoFurtherWorkQuantityIsExpd NoFurtherWorkQuantityIsExpd 1
OpenReservationsIsCleared OpenReservationsIsCleared 1
OperationConfirmedEndDate OperationConfirmedEndDate 1
OperationConfirmedEndTime OperationConfirmedEndTime 1
OperationConfirmedStartDate OperationConfirmedStartDate 1
OperationConfirmedStartTime OperationConfirmedStartTime 1
PersonnelNumber PersonnelNumber 1
Plant Plant 1
PostingDate PostingDate 1
RemainingWorkQuantity RemainingWorkQuantity 1
RemainingWorkQuantityUnit RemainingWorkQuantityUnit 1
VarianceReasonCode VarianceReasonCode 1
WorkCenterInternalID WorkCenterInternalID 1
@AbapCatalog.sqlViewName: 'PMAINTORDCONF'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Maintenance Order Confirmation'
@VDM.private: true
@VDM.viewType: #BASIC
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_MaintenanceOrderConfirmation
  as select from    afru
    left outer join afvc as afvc     on  afvc.aufpl = afru.aufpl
                                     and afvc.aplzl = afru.aplzl
    left outer join afvc as afvc_sub on  afvc_sub.aufpl = afru.aufpl
                                     and afvc_sub.aplzl = afvc.sumnr
  association [0..1] to I_Language as _Language       on $projection.Language = _Language.Language
  association [0..1] to I_Plant    as _Plant          on $projection.Plant = _Plant.Plant
  association [0..1] to tz1appl    as _TimeZoneConfig on _TimeZoneConfig.appl = 'PM_WOC'
{
  key afru.rueck                                                                                                                      as MaintOrderConf,
  key afru.rmzhl                                                                                                                      as MaintOrderConfCntrValue,
      @Semantics.businessDate.createdAt: true
      cast(afru.ersda as ru_ersda)                                                                                                    as MaintOrderConfirmationEntryDte,
      cast(afru.ernam as ru_ernam)                                                                                                    as EnteredByUser,
      @Semantics.businessDate.lastChangedAt: true
      afru.laeda                                                                                                                      as LastChangeDate,
      afru.aenam                                                                                                                      as LastChangedByUser,
      @Semantics.businessDate.at: true
      cast(afru.budat as pph_budat)                                                                                                   as PostingDate,
      afru.arbid                                                                                                                      as WorkCenterInternalID,
      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_PlantStdVH',
                     element: 'Plant' }
        }]
      @ObjectModel.foreignKey.association: '_Plant'
      afru.werks                                                                                                                      as Plant,
      @Semantics.text: true
      afru.ltxa1                                                                                                                      as ConfirmationText,
      @ObjectModel.foreignKey.association: '_Language'
      cast(afru.txtsp as spras)                                                                                                       as Language,
      cast (
        case afru.txtsp
            when '' then ''
            else 'X'
      end as xfeld )                                                                                                                  as LongTextExists,
      //      afru.iserh,

      //      afru.zeier,

      //      afru.ile01,

      //      afru.ism01,

      //      afru.ile02,

      //      afru.ism02,

      //      afru.ile03,

      //      afru.ism03,

      //      afru.ile04,

      //      afru.ism04,

      //      afru.ile05,

      //      afru.ism05,

      //      afru.ile06,

      //      afru.ism06,

      //      afru.abarb,

      afru.ismnw                                                                                                                      as ActualWorkQuantity,
      afru.ismne                                                                                                                      as ActualWorkQuantityUnit,
      afru.learr                                                                                                                      as ActivityType,
      afru.idaur                                                                                                                      as ActualDuration,
      afru.idaue                                                                                                                      as ActualDurationUnit,
      //      afru.zcode,

      afru.loart                                                                                                                      as EmployeeWageType,
      //      afru.qualf,

      //      afru.anzma,

      afru.logrp                                                                                                                      as EmployeeWageGroup,
      //      afru.gmnga,

      @Semantics.quantity.unitOfMeasure: 'ConfirmationUnit'
      @DefaultAggregation: #SUM
      afru.lmnga                                                                                                                      as ConfirmationYieldQuantity,
      @Semantics.quantity.unitOfMeasure: 'ConfirmationUnit'
      @DefaultAggregation: #SUM
      afru.xmnga                                                                                                                      as ConfirmationScrapQuantity,
      //      afru.gmein,

      @Semantics.unitOfMeasure: true
      afru.meinh                                                                                                                      as ConfirmationUnit,
      cast(afru.grund as pph_agrnd)                                                                                                   as VarianceReasonCode,
      afru.pernr                                                                                                                      as PersonnelNumber,
      afru.isdd                                                                                                                       as OperationConfirmedStartDate,
      //      case

      //        when afru.isdz is null      then '000000'

      //        when afru.isdz = ''         then '000000'

      //        when afru.isdz = '240000'   then '235959'

      //        else afru.isdz

      //      end                             as OperationConfirmedStartTime,

      afru.isdz                                                                                                                       as OperationConfirmedStartTime,
      //      afru.ierd,

      //      afru.ierz,

      //      afru.isbd,

      //      afru.isbz,

      //      afru.iebd,

      //      afru.iebz,

      //      afru.isad,

      //      afru.isaz,

      afru.iedd                                                                                                                       as OperationConfirmedEndDate,

      //      case

      //        when afru.iedz is null      then '000000'

      //        when afru.iedz = ''         then '000000'

      //        when afru.iedz = '240000'   then '235959'

      //        else afru.iedz

      //      end                           as OperationConfirmedEndTime,

      afru.iedz                                                                                                                       as OperationConfirmedEndTime,
      //      case

      //        when afru.pedd is null then isdd

      //        else afru.pedd

      //      end                           as ActyConfFcstdEndDate,

      afru.pedd                                                                                                                       as ActyConfFcstdEndDate,
      //      case

      //        when afru.pedz is null      then '000000'

      //        when afru.pedz = ''         then '000000'

      //        when afru.pedz = '240000'   then '235959'

      //        else afru.pedz

      //      end                           as ActyConfFcstdEndTime,

      afru.pedz                                                                                                                       as ActyConfFcstdEndTime,
      afru.wablnr                                                                                                                     as MaterialDocument,
      //      afru.weblnr,

      //      cast (afru.aueru  as xfeld)                                                  as IsFinalConfirmation,

      cast (
        case afru.aueru
            when '' then afru.aueru
            else 'X'
        end
      as xfeld)                                                                                                                       as IsFinalConfirmation,
      afru.ausor                                                                                                                      as OpenReservationsIsCleared,
      //      afru.stndr,

      //      afru.manur,

      //      afru.meilr,

      afru.aufpl                                                                                                                      as MaintOrderRoutingNumber,
      afru.aplzl                                                                                                                      as MaintOrderOperationCounter,
      @Consumption.valueHelpDefinition: [
        { entity:  { name:    'I_MaintenanceOrderStdVH',
                     element: 'MaintenanceOrder' }
        }]
      afru.aufnr                                                                                                                      as MaintenanceOrder,
      //      afru.aplfl,

      cast ( case afvc.sumnr
        when '00000000' then afvc.vornr //Main Operation

        else afvc_sub.vornr //Sub Operation

      end                           as maintenanceorderoperation )                                                                    as MaintenanceOrderOperation,
      cast(case afvc.sumnr
        when '00000000' then ''  //Main Operation

        else afvc.vornr  //Sub Operation

      end                           as maintenanceordersuboperation )                                                                 as MaintenanceOrderSubOperation,
      //      afru.ofm01,

      //      afru.ofe01,

      //      afru.lek01,

      //      afru.ofm02,

      //      afru.ofe02,

      //      afru.lek02,

      //      afru.ofm03,

      //      afru.ofe03,

      //      afru.lek03,

      //      afru.ofm04,

      //      afru.ofe04,

      //      afru.lek04,

      //      afru.ofm05,

      //      afru.ofe05,

      //      afru.lek05,

      //      afru.ofm06,

      //      afru.ofe06,

      //      afru.lek06,

      afru.ofmnw                                                                                                                      as RemainingWorkQuantity,
      afru.ofmne                                                                                                                      as RemainingWorkQuantityUnit,
      afru.leknw                                                                                                                      as NoFurtherWorkQuantityIsExpd,
      //      afru.odaur,

      //      afru.odaue,

      afru.stokz                                                                                                                      as IsReversed,
      cast (case afru.stzhl
        when '00000000' then ''
        else 'X'
      end as xfeld)                                                                                                                   as IsReversal,
      afru.stzhl                                                                                                                      as CancldMaintOrderConfCntrValue,
      //      afru.smeng,

      //      afru.rueck_mst,

      //      afru.rmzhl_mst,

      //      afru.pdsnr,

      afru.kapid                                                                                                                      as CapacityInternalID,
      afru.split                                                                                                                      as NmbrOfMaintTechnicianCapSplits,
      //      afru.zausw,

      //      afru.orind,

      //      afru.origf,

      //      afru.canum,

      //      afru.belnr_ist,

      //      afru.belnr_umb,

      @Semantics.quantity.unitOfMeasure: 'ConfirmationUnit'
      @DefaultAggregation: #SUM
      afru.rmnga                                                                                                                      as ConfirmationReworkQuantity,
      //      afru.catsbelnr,

      //      afru.satza,

      cast(afru.erzet as ru_erzet)                                                                                                    as MaintOrderConfirmationEntryTme,
      //      afru.catsprice,

      //      afru.catstcurr,

      //      afru.catspeinh,

      afru.bemot                                                                                                                      as AccountingIndicatorCode,
      //      afru.iprz1,

      //      afru.ipre1,

      //      afru.iprk1,

      afru.exnam                                                                                                                      as EnteredByExternalUser,
      @Semantics.businessDate.createdAt: true
      cast(afru.exerd as ru_exerd)                                                                                                    as ConfirmationExternalEntryDate,
      cast(afru.exerz as ru_exerz)                                                                                                    as ConfirmationExternalEntryTime,
      //      afru.prz01,

      //      afru.oprz1,

      //      afru.opre1,

      //      afru.skokrs,

      //      afru.skostl,

      //      afru.nodat,

      afru.ismnu                                                                                                                      as ActualWorkExternalQuantityUnit,
      afru.ofmnu                                                                                                                      as RemainingWorkExtQuantityUnit,
      //      afru.packno,

      //      afru.extid,

      //      afru.schgrup,

      //      afru.kaptprog,

      //      afru.eew_afru_ps_dummy,

      //      afru.obmat,

      //      afru.obcha,

      //      afru.licha,

      //      afru.myear,

      //      afru.me_sfcid,

      //      afru.me_2nd_conf_qty,

      //      afru.role_id,

      //      afru.ucmat,

      //      afru.uccha,

      //      afru.wty_ind,


      //    Make association public

      afvc.objnr                                                                                                                      as MaintOrderOperationInternalID,
      @Semantics.timeZone: true
      case when _TimeZoneConfig.active = 'X' then cast( abap_system_timezone(   $session.client,'NULL' )   as tzonso preserving type )
             else cast( _Plant._OrganizationAddress[1:AddressRepresentationCode = ''].AddressTimeZone as tzonso preserving type ) end as AddressTimeZone,
      _Language,
      _Plant
}
where
  afru.orind = '3' // Maintenance orders only

/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_ORGANIZATIONADDRESS",
"I_PLANT",
"AFRU",
"AFVC",
"TZ1APPL"
],
"ASSOCIATED":
[
"I_LANGUAGE",
"I_PLANT",
"TZ1APPL"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/