P_MfgOrderDocInfoRecdObjLink

DDL: P_MFGORDERDOCINFORECDOBJLINK SQL: PPPMFGORDDOCOBJL Type: view COMPOSITE

P_MfgOrderDocInfoRecdObjLink is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_DocumentInfoRecord, I_DocumentInfoRecordObjectLink, P_MfgOrdLinkedSAPObjKeyRnge) and exposes 44 fields with key fields LinkedSAPObjectKey, LinkedSAPObject, DocumentType, DocumentInfoRecord, DocumentPart. It has 10 associations to related views.

Data Sources (3)

SourceAliasJoin Type
I_DocumentInfoRecord docu inner
I_DocumentInfoRecordObjectLink link inner
P_MfgOrdLinkedSAPObjKeyRnge ord from

Associations (10)

CardinalityTargetAliasCondition
[1..1] I_ManufacturingOrder _MfgOrder $projection.ManufacturingOrder = _MfgOrder.ManufacturingOrder
[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
[0..1] I_DocumentInfoRecordDocStatus _DocumentStatus $projection.DocumentType = _DocumentStatus.DocumentInfoRecordDocType and $projection.InternalDocumentStatus = _DocumentStatus.InternalDocumentStatus
[0..*] I_DocumentInfoRecordDesc _DocumentText $projection.DocumentType = _DocumentText.DocumentInfoRecordDocType and $projection.DocumentInfoRecord = _DocumentText.DocumentInfoRecordDocNumber and $projection.DocumentVersion = _DocumentText.DocumentInfoRecordDocVersion and $projection.DocumentPart = _DocumentText.DocumentInfoRecordDocPart
[0..1] I_ChangeMaster _ChangeNumber $projection.ChangeNumber = _ChangeNumber.ChangeNumber
[0..1] I_User _CreatedUser $projection.CreatedByUser = _CreatedUser.UserID
[0..1] I_User _ChangedUser $projection.LastChangedByUser = _ChangedUser.UserID

Annotations (11)

NameValueLevelField
AbapCatalog.sqlViewName PPPMFGORDDOCOBJL view
AbapCatalog.compiler.compareFilter true view
AbapCatalog.preserveKey true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ClientHandling.algorithm #SESSION_VARIABLE view
ObjectModel.usageType.serviceQuality #C view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #MIXED view
VDM.lifecycle.contract.type #NONE view
VDM.viewType #COMPOSITE view
VDM.private true view

Fields (44)

KeyFieldSource TableSource FieldDescription
KEY LinkedSAPObjectKey I_DocumentInfoRecordObjectLink LinkedSAPObjectKey
KEY LinkedSAPObject I_DocumentInfoRecordObjectLink LinkedSAPObject
KEY DocumentType I_DocumentInfoRecordObjectLink DocumentInfoRecordDocType
KEY DocumentInfoRecord I_DocumentInfoRecordObjectLink DocumentInfoRecordDocNumber
KEY DocumentPart I_DocumentInfoRecordObjectLink DocumentInfoRecordDocPart
KEY DocumentVersion I_DocumentInfoRecordObjectLink DocumentInfoRecordDocVersion
CreationDateTime I_DocumentInfoRecordObjectLink CreationDateTime
CreatedByUser I_DocumentInfoRecordObjectLink CreatedByUser
ChangedDateTime I_DocumentInfoRecordObjectLink ChangedDateTime
LastChangedByUser I_DocumentInfoRecordObjectLink LastChangedByUser
InternalDocumentStatus I_DocumentInfoRecord InternalDocumentStatus
ChangeNumber I_DocumentInfoRecord ChangeNumber
AuthorizationGroup I_DocumentInfoRecord AuthorizationGroup
ResponsiblePersonName I_DocumentInfoRecord ResponsiblePersonName
LaboratoryOrDesignOffice I_DocumentInfoRecord LaboratoryOrDesignOffice
Plant I_DocumentInfoRecord Plant
DocInfoRecdLinkStatus I_DocumentInfoRecordObjectLink DocInfoRecdLinkStatus
DocInfoRecdObjectLinkStatus I_DocumentInfoRecordObjectLink DocInfoRecdObjectLinkStatus
ObjectTypeDatabaseTable I_DocumentInfoRecordObjectLink ObjectTypeDatabaseTable
IsDefaultDocument I_DocumentInfoRecordObjectLink IsDefaultDocument
DocInfoRecdIsMarkedForDeletion I_DocumentInfoRecordObjectLink DocInfoRecdIsMarkedForDeletion
ManufacturingOrder P_MfgOrdLinkedSAPObjKeyRnge ManufacturingOrder
MfgOrderLinkedObjType
ManufacturingOrderItem
ManufacturingOrderSequence
ManufacturingOrderOperation
OrderOperationInternalID
OpActyNtwkElementExternalID
SerialNumber
ManufacturingOrderCategory P_MfgOrdLinkedSAPObjKeyRnge ManufacturingOrderCategory
ManufacturingOrderType P_MfgOrdLinkedSAPObjKeyRnge ManufacturingOrderType
_MfgOrder _MfgOrder
_DocumentType _DocumentType
_DocumentNumber _DocumentNumber
_DocumentVersion _DocumentVersion
_DocumentPart _DocumentPart
_DocumentStatus _DocumentStatus
_DocumentText _DocumentText
_CreatedUser _CreatedUser
_ChangedUser _ChangedUser
_ChangeNumber _ChangeNumber
_MfgOrderCategory P_MfgOrdLinkedSAPObjKeyRnge _MfgOrderCategory
_MfgOrderType P_MfgOrdLinkedSAPObjKeyRnge _MfgOrderType
_Text I_DocumentInfoRecordObjectLink _DocumentInfoRecordDesc
@AbapCatalog.sqlViewName: 'PPPMFGORDDOCOBJL'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@ObjectModel.usageType: {serviceQuality: #C, sizeCategory: #L, dataClass: #MIXED}
@VDM.lifecycle.contract.type: #NONE
@VDM.viewType: #COMPOSITE
@VDM.private: true

define view P_MfgOrderDocInfoRecdObjLink
  as select from P_MfgOrdLinkedSAPObjKeyRnge    as ord
    inner join   I_DocumentInfoRecordObjectLink as link on link.LinkedSAPObjectKey between ord.LinkedSAPObjectKeyLow and ord.LinkedSAPObjectKeyHigh
    inner join   I_DocumentInfoRecord           as docu on  link.DocumentInfoRecordDocType    = docu.DocumentInfoRecordDocType
                                                        and link.DocumentInfoRecordDocNumber  = docu.DocumentInfoRecordDocNumber
                                                        and link.DocumentInfoRecordDocPart    = docu.DocumentInfoRecordDocPart
                                                        and link.DocumentInfoRecordDocVersion = docu.DocumentInfoRecordDocVersion

  association [1..1] to I_ManufacturingOrder           as _MfgOrder        on  $projection.ManufacturingOrder = _MfgOrder.ManufacturingOrder
  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 [0..1] to I_DocumentInfoRecordDocStatus  as _DocumentStatus  on  $projection.DocumentType           = _DocumentStatus.DocumentInfoRecordDocType
                                                                           and $projection.InternalDocumentStatus = _DocumentStatus.InternalDocumentStatus
  association [0..*] to I_DocumentInfoRecordDesc       as _DocumentText    on  $projection.DocumentType       = _DocumentText.DocumentInfoRecordDocType
                                                                           and $projection.DocumentInfoRecord = _DocumentText.DocumentInfoRecordDocNumber
                                                                           and $projection.DocumentVersion    = _DocumentText.DocumentInfoRecordDocVersion
                                                                           and $projection.DocumentPart       = _DocumentText.DocumentInfoRecordDocPart
  association [0..1] to I_ChangeMaster                 as _ChangeNumber    on  $projection.ChangeNumber = _ChangeNumber.ChangeNumber
  association [0..1] to I_User                         as _CreatedUser     on  $projection.CreatedByUser = _CreatedUser.UserID
  association [0..1] to I_User                         as _ChangedUser     on  $projection.LastChangedByUser = _ChangedUser.UserID
{
  key link.LinkedSAPObjectKey           as LinkedSAPObjectKey,
  key link.LinkedSAPObject              as LinkedSAPObject,
  key link.DocumentInfoRecordDocType    as DocumentType,
  key link.DocumentInfoRecordDocNumber  as DocumentInfoRecord,
  key link.DocumentInfoRecordDocPart    as DocumentPart,
  key link.DocumentInfoRecordDocVersion as DocumentVersion,

      // Administrative Data

      link.CreationDateTime,
      link.CreatedByUser,
      link.ChangedDateTime,
      link.LastChangedByUser,

      // Document Data

      docu.InternalDocumentStatus,
      docu.ChangeNumber,
      docu.AuthorizationGroup,
      docu.ResponsiblePersonName,
      docu.LaboratoryOrDesignOffice,
      docu.Plant,

      // Miscellaneous Data

      link.DocInfoRecdLinkStatus,
      link.DocInfoRecdObjectLinkStatus,
      link.ObjectTypeDatabaseTable,
      @Semantics.booleanIndicator
      case link.DocLinkDirectionIsActive
        when '' then ''
        else 'X'
      end as DocLinkDirectionIsActive,
      link.IsDefaultDocument,
      @Semantics.booleanIndicator
      link.DocInfoRecdIsMarkedForDeletion,

      // build substrings for I_ view

      ord.ManufacturingOrder                         as ManufacturingOrder,
      substring(link.LinkedSAPObjectKey, 13, 1)      as MfgOrderLinkedObjType,
      substring(link.LinkedSAPObjectKey, 14, 4)      as ManufacturingOrderItem,
      substring(link.LinkedSAPObjectKey, 18, 6)      as ManufacturingOrderSequence,
      substring(link.LinkedSAPObjectKey, 24, 4)      as ManufacturingOrderOperation,
      substring(link.LinkedSAPObjectKey, 28, 8)      as OrderOperationInternalID,
--    substring(link.LinkedSAPObjectKey, 36, 4)      as DocObjectLinkCounter
      substring(link.LinkedSAPObjectKey, 40, 1)      as OpActyNtwkSegmentType,
      substring(link.LinkedSAPObjectKey, 41,10)      as OpActyNtwkElementExternalID,
      substring(link.LinkedSAPObjectKey, 51,18)      as SerialNumber,

      //Order Data

      ord.ManufacturingOrderCategory,
      ord.ManufacturingOrderType,

      // Associations

      _MfgOrder,
      _DocumentType,
      _DocumentNumber,
      _DocumentVersion,
      _DocumentPart,
      _DocumentStatus,
      _DocumentText,
      _CreatedUser,
      _ChangedUser,
      _ChangeNumber,
      ord._MfgOrderCategory,
      ord._MfgOrderType,
      link._DocumentInfoRecordDesc as _Text
}
where
  link.LinkedSAPObject = 'PORDER';  // only prod. orders