P_DocInfoRecd

DDL: P_DOCINFORECD SQL: PCVDOCINFORECD Type: view BASIC

P_DocInfoRecd is a Basic CDS View in SAP S/4HANA. It reads from 2 data sources (dost, draw_last_change) and exposes 28 fields with key fields DocumentType, DocumentInfoRecord, DocumentVersion, DocumentPart.

Data Sources (2)

SourceAliasJoin Type
dost DocumentStructureBOM left_outer
draw_last_change Last_Change left_outer

Annotations (12)

NameValueLevelField
AbapCatalog.sqlViewName PCVDOCINFORECD view
AbapCatalog.compiler.compareFilter true view
VDM.viewType #BASIC view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.serviceQuality #A view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
VDM.lifecycle.contract.type #NONE view
VDM.lifecycle.status #DEPRECATED view
VDM.lifecycle.successor P_DocumentInfoRecord view

Fields (28)

KeyFieldSource TableSource FieldDescription
KEY DocumentType doc_info dokar
KEY DocumentInfoRecord doc_info doknr
KEY DocumentVersion doc_info dokvr
KEY DocumentPart doc_info doktl
ResponsiblePersonName doc_info dwnam
InternalDocumentStatus doc_info dokst
LaboratoryOrDesignOffice doc_info labor
ChangeNumber doc_info aennr
Plant doc_info werka
SuperiorDocumentInfoRecord doc_info prenr
SuperiorDocumentVersion doc_info prevr
SuperiorDocumentPart doc_info pretl
SuperiorDocumentType doc_info prear
AuthorizationGroup doc_info begru
DueDate doc_info vrldat
ProcessingPriority doc_info vprior
DocInfoRecdOutputDate doc_info adatum
SourceDocInfoRecd doc_info doknr_vl
DocInfoRecdSourceDocPart doc_info doktl_vl
DocInfoRecdSourceDocVersion doc_info dokvr_vl
DocInfoRecdConfignMgmtFixed doc_info cm_fixed
char1endasIsDocInfoRecdStructure
DocInfoRecdIsMarkedForDeletion doc_info loedk
DocumentIsCreatedByCAD doc_info cadkz
CreationDateTime draw_last_change created_at
CreatedByUser draw_last_change created_by
ChangedDateTime draw_last_change changed_at
LastChangedByUser draw_last_change changed_by
@AbapCatalog.sqlViewName: 'PCVDOCINFORECD'
@AbapCatalog.compiler.compareFilter: true
@VDM.viewType: #BASIC
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType: {serviceQuality: #A, sizeCategory: #L, dataClass: #TRANSACTIONAL}
@VDM.lifecycle: {
  contract: {
    type: #NONE
  },
  status: #DEPRECATED,
  successor: 'P_DocumentInfoRecord'
}

define view P_DocInfoRecd
  as select distinct from draw as doc_info
    left outer join draw_last_change as Last_Change on  doc_info.doknr = Last_Change.doknr
                                                    and doc_info.doktl = Last_Change.doktl
                                                    and doc_info.dokvr = Last_Change.dokvr
                                                    and doc_info.dokar = Last_Change.dokar

  /*   Association to get Document Structure indicator */
  --Get Document BOM Link
    left outer join  dost  as DocumentStructureBOM  on  doc_info.doknr = DocumentStructureBOM.doknr
                                                    and doc_info.doktl = DocumentStructureBOM.doktl
                                                    and doc_info.dokvr = DocumentStructureBOM.dokvr
                                                    and doc_info.dokar = DocumentStructureBOM.dokar

{

  key doc_info.dokar  as DocumentType,
  key doc_info.doknr  as DocumentInfoRecord,
  key doc_info.dokvr  as DocumentVersion,
  key doc_info.doktl  as DocumentPart,
      doc_info.dwnam  as ResponsiblePersonName,
      doc_info.dokst  as InternalDocumentStatus,
      doc_info.labor  as LaboratoryOrDesignOffice,
      doc_info.aennr  as ChangeNumber,
      doc_info.werka  as Plant,
      doc_info.prenr  as SuperiorDocumentInfoRecord,
      doc_info.prevr  as SuperiorDocumentVersion,
      doc_info.pretl  as SuperiorDocumentPart,
      doc_info.prear  as SuperiorDocumentType,
      doc_info.begru  as AuthorizationGroup,
      doc_info.vrldat as DueDate,
      doc_info.vprior as ProcessingPriority,
      doc_info.adatum as DocInfoRecdOutputDate,
      doc_info.doknr_vl as SourceDocInfoRecd,
      doc_info.doktl_vl as DocInfoRecdSourceDocPart,
      doc_info.dokvr_vl as DocInfoRecdSourceDocVersion,
      doc_info.cm_fixed as DocInfoRecdConfignMgmtFixed,

      /*      Document Structure,CAD,hierarchy Indicator    */
      case
        when DocumentStructureBOM.doknr is not null then cast('X' as abap.char(1))
        when DocumentStructureBOM.doknr is null then cast(' ' as abap.char(1))
      end as IsDocInfoRecdStructure,

      case  doc_info.prenr
          when ''  then ''
          else  'X'
      end as DocInfoRecdHierarchy,

      doc_info.loedk as DocInfoRecdIsMarkedForDeletion,
      doc_info.cadkz as DocumentIsCreatedByCAD,

      /*  DIR Administrative Data                                        */
      @Semantics.businessDate.at: true
      @Semantics.businessDate.createdAt: true
      Last_Change.created_at as CreationDateTime,

      @Semantics.user.createdBy: true
      Last_Change.created_by as CreatedByUser,

      @Semantics.businessDate.at: true
      @Semantics.businessDate.lastChangedAt: true
      Last_Change.changed_at as ChangedDateTime,

      @Semantics.user.lastChangedBy: true
      Last_Change.changed_by as LastChangedByUser

}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"DOST",
"DRAW",
"DRAW_LAST_CHANGE"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/