I_MfgOrderDocInfoRecdOrigl

DDL: I_MFGORDERDOCINFORECDORIGL SQL: IPPMFGORERDOCORI Type: view COMPOSITE

Mfg Order Header Document Info Record Original

I_MfgOrderDocInfoRecdOrigl is a Composite CDS View that provides data about "Mfg Order Header Document Info Record Original" in SAP S/4HANA. It reads from 2 data sources (I_MfgOrderDocInfoRecdObjLink, I_DocumentInfoRecordAttachment) and exposes 39 fields with key fields LinkedSAPObjectKey, DocumentType, DocumentInfoRecord, DocumentPart, DocumentVersion. It has 6 associations to related views.

Data Sources (2)

SourceAliasJoin Type
I_MfgOrderDocInfoRecdObjLink docl from
I_DocumentInfoRecordAttachment orig inner

Associations (6)

CardinalityTargetAliasCondition
[1..1] I_DocumentInfoRecordDocType _DocumentType $projection.DocumentType = _DocumentType.DocumentInfoRecordDocType
[1..1] I_DocumentInfoRecordDocNumber _DocumentNumber $projection.DocumentType = _DocumentNumber.DocumentInfoRecordDocType and $projection.DocumentInfoRecord = _DocumentNumber.DocumentInfoRecordDocNumber
[1..1] I_DocumentInfoRecordDocVersion _DocumentVersion $projection.DocumentType = _DocumentVersion.DocumentInfoRecordDocType and $projection.DocumentInfoRecord = _DocumentVersion.DocumentInfoRecordDocNumber and $projection.DocumentVersion = _DocumentVersion.DocumentInfoRecordDocVersion
[1..1] I_DocumentInfoRecordDocPrt _DocumentPart $projection.DocumentType = _DocumentPart.DocumentInfoRecordDocType and $projection.DocumentInfoRecord = _DocumentPart.DocumentInfoRecordDocNumber and $projection.DocumentVersion = _DocumentPart.DocumentInfoRecordDocVersion and $projection.DocumentPart = _DocumentPart.DocumentInfoRecordDocPart
[1..1] I_User _CreatedUser $projection.CreatedByUser = _CreatedUser.UserID
[0..1] I_User _ChangedUser $projection.LastChangedByUser = _ChangedUser.UserID

Annotations (13)

NameValueLevelField
AbapCatalog.sqlViewName IPPMFGORERDOCORI view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #MANDATORY view
ClientHandling.algorithm #SESSION_VARIABLE view
Metadata.allowExtensions true view
ObjectModel.modelingPattern #NONE view
ObjectModel.representativeKey DocumentIndex view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #MIXED view
VDM.lifecycle.contract.type #PUBLIC_LOCAL_API view
VDM.viewType #COMPOSITE view
EndUserText.label Mfg Order Header Document Info Record Original view

Fields (39)

KeyFieldSource TableSource FieldDescription
KEY LinkedSAPObjectKey I_MfgOrderDocInfoRecdObjLink LinkedSAPObjectKey
KEY DocumentType I_DocumentInfoRecordAttachment DocumentInfoRecordDocType
KEY DocumentInfoRecord I_DocumentInfoRecordAttachment DocumentInfoRecordDocNumber
KEY DocumentPart
KEY DocumentVersion
KEY DocumentIndex I_DocumentInfoRecordAttachment DocumentIndex
KEY FileUUID
ChangeNumber I_MfgOrderDocInfoRecdObjLink ChangeNumber
ResponsiblePersonName I_MfgOrderDocInfoRecdObjLink ResponsiblePersonName
CreationDateTime
CreatedByUser
ChangedDateTime
LastChangedByUser
InternalComment I_DocumentInfoRecordAttachment InternalComment
FileName I_DocumentInfoRecordAttachment FileName
WorkstationApplication I_DocumentInfoRecordAttachment WorkstationApplication
MimeType I_DocumentInfoRecordAttachment MimeType
FileSize I_DocumentInfoRecordAttachment FileSize
StorageCategory I_DocumentInfoRecordAttachment StorageCategory
OriginalType I_DocumentInfoRecordAttachment OriginalType
DocumentTitle I_DocumentInfoRecordAttachment DocumentTitle
DocumentFormat I_DocumentInfoRecordAttachment DocumentFormat
OriginalIsProtected I_DocumentInfoRecordAttachment OriginalIsProtected
IsOriginalVersionActive
ManufacturingOrder I_MfgOrderDocInfoRecdObjLink ManufacturingOrder
ManufacturingOrderItem I_MfgOrderDocInfoRecdObjLink ManufacturingOrderItem
ManufacturingOrderCategory I_MfgOrderDocInfoRecdObjLink ManufacturingOrderCategory
ManufacturingOrderType I_MfgOrderDocInfoRecdObjLink ManufacturingOrderType
_CreatedUser _CreatedUser
_ChangedUser _ChangedUser
_DocumentNumber _DocumentNumber
_DocumentType _DocumentType
_DocumentVersion _DocumentVersion
_DocumentPart _DocumentPart
_ChangeNumber I_MfgOrderDocInfoRecdObjLink _ChangeNumber
_MfgOrder I_MfgOrderDocInfoRecdObjLink _MfgOrder
_MfgOrderItem I_MfgOrderDocInfoRecdObjLink _MfgOrderItem
_MfgOrderCategory I_MfgOrderDocInfoRecdObjLink _MfgOrderCategory
_MfgOrderType I_MfgOrderDocInfoRecdObjLink _MfgOrderType
@AbapCatalog.sqlViewName: 'IPPMFGORERDOCORI'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #MANDATORY
@ClientHandling.algorithm: #SESSION_VARIABLE
@Metadata.allowExtensions: true
@ObjectModel.modelingPattern: #NONE
@ObjectModel.supportedCapabilities: [#CDS_MODELING_DATA_SOURCE, #SQL_DATA_SOURCE]
@ObjectModel.representativeKey: 'DocumentIndex'
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #L, dataClass: #MIXED}
@VDM.lifecycle.contract.type: #PUBLIC_LOCAL_API
@VDM.viewType: #COMPOSITE
@EndUserText.label: 'Mfg Order Header Document Info Record Original'

define view I_MfgOrderDocInfoRecdOrigl
  as select from I_MfgOrderDocInfoRecdObjLink   as docl
    inner join   I_DocumentInfoRecordAttachment as orig on  orig.DocumentInfoRecordDocType    = docl.DocumentType
                                                        and orig.DocumentInfoRecordDocPart    = docl.DocumentPart
                                                        and orig.DocumentInfoRecordDocNumber  = docl.DocumentInfoRecord
                                                        and orig.DocumentInfoRecordDocVersion = docl.DocumentVersion
                                                        
  association [1..1] to I_DocumentInfoRecordDocType    as _DocumentType    on  $projection.DocumentType       = _DocumentType.DocumentInfoRecordDocType
  association [1..1] to I_DocumentInfoRecordDocNumber  as _DocumentNumber  on  $projection.DocumentType       = _DocumentNumber.DocumentInfoRecordDocType
                                                                           and $projection.DocumentInfoRecord = _DocumentNumber.DocumentInfoRecordDocNumber
  association [1..1] to I_DocumentInfoRecordDocVersion as _DocumentVersion on  $projection.DocumentType       = _DocumentVersion.DocumentInfoRecordDocType
                                                                           and $projection.DocumentInfoRecord = _DocumentVersion.DocumentInfoRecordDocNumber
                                                                           and $projection.DocumentVersion    = _DocumentVersion.DocumentInfoRecordDocVersion
  association [1..1] to I_DocumentInfoRecordDocPrt     as _DocumentPart    on  $projection.DocumentType       = _DocumentPart.DocumentInfoRecordDocType
                                                                           and $projection.DocumentInfoRecord = _DocumentPart.DocumentInfoRecordDocNumber
                                                                           and $projection.DocumentVersion    = _DocumentPart.DocumentInfoRecordDocVersion
                                                                           and $projection.DocumentPart       = _DocumentPart.DocumentInfoRecordDocPart
  association [1..1] to I_User                         as _CreatedUser     on  $projection.CreatedByUser      = _CreatedUser.UserID
  association [0..1] to I_User                         as _ChangedUser     on  $projection.LastChangedByUser  = _ChangedUser.UserID                                                                           
{
      // Document Key

  key docl.LinkedSAPObjectKey,
      @ObjectModel.foreignKey.association: '_DocumentType'
  key orig.DocumentInfoRecordDocType                                       as DocumentType,
      @ObjectModel.foreignKey.association: '_DocumentNumber'
  key orig.DocumentInfoRecordDocNumber                                     as DocumentInfoRecord,
      @ObjectModel.foreignKey.association: '_DocumentPart'
  key cast(orig.DocumentInfoRecordDocPart    as pph_doktl preserving type) as DocumentPart,
      @ObjectModel.foreignKey.association: '_DocumentVersion'
  key cast(orig.DocumentInfoRecordDocVersion as pph_dokvr preserving type) as DocumentVersion,

      // Original Key

  key orig.DocumentIndex,
  key cast(orig.FileUUID as edoc_file_guid preserving type)        as FileUUID,

      // Document Data

      @ObjectModel.foreignKey.association: '_ChangeNumber'
      docl.ChangeNumber,
      @Semantics.user.responsible: true
      docl.ResponsiblePersonName,

      // Admin Data

      @Semantics.systemDateTime.createdAt: true
      cast(orig.CreationDateTime as hp_created_at preserving type) as CreationDateTime,
      @Semantics.user.createdBy: true
      cast(orig.CreatedByUser    as ernam preserving type)         as CreatedByUser,
      @Semantics.systemDateTime.lastChangedAt: true
      cast(orig.ChangedDateTime  as hp_changed_at preserving type) as ChangedDateTime,
      @Semantics.user.lastChangedBy: true
      cast(orig.LastChangedByUser as aenam preserving type)        as LastChangedByUser,

      // Original Data

      orig.InternalComment,
      orig.FileName,
      orig.WorkstationApplication,
      orig.MimeType,
      orig.FileSize,
      orig.StorageCategory,
      orig.OriginalType,
      orig.DocumentTitle,
      orig.DocumentFormat,
      orig.OriginalIsProtected,
      @Semantics.booleanIndicator: true
      substring(orig.IsOriginalVersionActive, 1, 1)                as IsOriginalVersionActive,
  
      // Mfg Order Data

      @ObjectModel.foreignKey.association: '_MfgOrder'
      docl.ManufacturingOrder,
      @ObjectModel.foreignKey.association: '_MfgOrderItem'
      docl.ManufacturingOrderItem,
      @ObjectModel.foreignKey.association: '_MfgOrderCategory'
      docl.ManufacturingOrderCategory,
      @ObjectModel.foreignKey.association: '_MfgOrderType'
      docl.ManufacturingOrderType,
  
      // Associations

      _CreatedUser,
      _ChangedUser,
      _DocumentNumber,
      _DocumentType,
      _DocumentVersion,
      _DocumentPart,
      docl._ChangeNumber,
      docl._MfgOrder,
      docl._MfgOrderItem,
      docl._MfgOrderCategory,
      docl._MfgOrderType
};
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_DOCUMENTINFORECORDATTACHMENT",
"I_MFGORDERDOCINFORECDOBJLINK"
],
"ASSOCIATED":
[
"I_CHANGEMASTER",
"I_DOCUMENTINFORECORDDOCNUMBER",
"I_DOCUMENTINFORECORDDOCPRT",
"I_DOCUMENTINFORECORDDOCTYPE",
"I_DOCUMENTINFORECORDDOCVERSION",
"I_MANUFACTURINGORDER",
"I_MANUFACTURINGORDERITEM",
"I_MFGORDERCATEGORY",
"I_MFGORDERTYPE",
"I_USER"
],
"BASE":
[
"I_MFGORDERDOCINFORECDOBJLINK"
],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/