A_ProductionOrderStatus_2

DDL: A_PRODUCTIONORDERSTATUS_2 Type: view_entity COMPOSITE

Production Order Status

A_ProductionOrderStatus_2 is a Composite CDS View that provides data about "Production Order Status" in SAP S/4HANA. It reads from 3 data sources (I_MfgOrderStatus, I_StatusCodeText, I_UserStatusText) and exposes 4 fields with key fields ManufacturingOrder, StatusCode. It has 1 association to related views.

Data Sources (3)

SourceAliasJoin Type
I_MfgOrderStatus _MfgOrderStatus inner
I_StatusCodeText _StatusCodeText left_outer
I_UserStatusText _UserStatusText left_outer

Associations (1)

CardinalityTargetAliasCondition
[1..1] A_ProductionOrder _ProductionOrder $projection.ManufacturingOrder = _ProductionOrder.ProductionOrder

Annotations (9)

NameValueLevelField
AccessControl.authorizationCheck #CHECK view
EndUserText.label Production Order Status view
VDM.viewType #COMPOSITE view
AccessControl.personalData.blocking #NOT_REQUIRED view
Metadata.ignorePropagatedAnnotations true view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
VDM.lifecycle.contract.type #PUBLIC_REMOTE_API view

Fields (4)

KeyFieldSource TableSource FieldDescription
KEY ManufacturingOrder
KEY StatusCode _StatusObject StatusCode
IsUserStatus
_ProductionOrder _ProductionOrder
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Production Order Status'
@VDM.viewType: #COMPOSITE
@AccessControl.personalData.blocking: #NOT_REQUIRED
@Metadata.ignorePropagatedAnnotations: true
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #XL, dataClass: #MIXED}
@VDM.lifecycle.contract.type: #PUBLIC_REMOTE_API

define view entity A_ProductionOrderStatus_2   
as select distinct from I_StatusObjectActiveStatus as _StatusObject
                                                      //Get Manufacturing Order

    inner join          I_MfgOrderStatus           as _MfgOrderStatus  on _MfgOrderStatus.ManufacturingObject        = _StatusObject.StatusObject
                                                                      and _MfgOrderStatus.ManufacturingOrderCategory = '10'
                                                                        
                                                      //Get system status short name and description

    left outer join     I_StatusCodeText           as _StatusCodeText  on _StatusObject.StatusCode = _StatusCodeText.StatusCode
                                                                      and _StatusCodeText.Language = $session.system_language
                                                                        
                                                      //Get user status short name and description

    left outer join     I_UserStatusText           as _UserStatusText  on _StatusObject.StatusProfile = _UserStatusText.StatusProfile
                                                                      and _StatusObject.StatusCode    = _UserStatusText.UserStatus
                                                                      and _UserStatusText.Language    = $session.system_language

  association [1..1] to A_ProductionOrder          as _ProductionOrder on  $projection.ManufacturingOrder = _ProductionOrder.ProductionOrder
                                                                                                          
{
      // Key

  @ObjectModel.sapObjectNodeTypeReference: 'ProductionOrder'
  key cast(_MfgOrderStatus.ManufacturingOrder      as vdm_manufacturingorder preserving type) as ManufacturingOrder,     
  key _StatusObject.StatusCode,

      // Status  

      _StatusObject._StatusCode._StatusCodeText[1:Language=$session.system_language].IsUserStatus, 
        
      cast( case _StatusObject._StatusCode._StatusCodeText[1:Language=$session.system_language].IsUserStatus
         when 'X' then _UserStatusText.UserStatusShortName
         else  _StatusCodeText.StatusShortName
         end as j_txt04 preserving type )          as StatusShortName,                                                     
         
      cast(case _StatusObject._StatusCode._StatusCodeText[1:Language=$session.system_language].IsUserStatus
        when 'X' then _UserStatusText.UserStatusName
        else _StatusCodeText.StatusName
        end as j_txt30 preserving type )           as StatusName,                                                              
        _ProductionOrder
                
} 
where 
  _StatusCodeText._StatusCode.StatusIsHidden = ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_MFGORDERSTATUS",
"I_STATUSCODE",
"I_STATUSCODETEXT",
"I_STATUSOBJECTACTIVESTATUS",
"I_USERSTATUSTEXT"
],
"ASSOCIATED":
[
"A_PRODUCTIONORDER"
],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/