P_InfoRecordLeadTime

DDL: P_INFORECORDLEADTIME SQL: PINFORECORDLT Type: view COMPOSITE

P_InfoRecordLeadTime is a Composite CDS View in SAP S/4HANA. It reads from 3 data sources (I_PurchasingInfoRecord, I_PurgInfoRecdOrgPlantData, P_StandardPurchaseOrders) and exposes 7 fields.

Data Sources (3)

SourceAliasJoin Type
I_PurchasingInfoRecord _eina from
I_PurgInfoRecdOrgPlantData _eine inner
P_StandardPurchaseOrders P_StandardPurchaseOrders left_outer

Parameters (2)

NameTypeDefault
p_days abap.int2
p_date sydatum

Annotations (6)

NameValueLevelField
AbapCatalog.sqlViewName PINFORECORDLT view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.viewType #COMPOSITE view
VDM.private true view
ClientHandling.algorithm #SESSION_VARIABLE view

Fields (7)

KeyFieldSource TableSource FieldDescription
Material I_PurchasingInfoRecord Material
Plant I_PurgInfoRecdOrgPlantData Plant
PlantendasMRPArea
PurchasingInfoRecord I_PurgInfoRecdOrgPlantData PurchasingInfoRecord
PurchasingOrganization I_PurgInfoRecdOrgPlantData PurchasingOrganization
PurchasingDocument PurchasingDocument
PurchasingDocumentItem PurchasingDocumentItem
@AbapCatalog.sqlViewName: 'PINFORECORDLT'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.viewType: #COMPOSITE
@VDM.private: true
@ClientHandling.algorithm: #SESSION_VARIABLE

define view P_InfoRecordLeadTime
  with parameters
    p_days : abap.int2,
    p_date : sydatum
  as select from    I_PurchasingInfoRecord                                  as _eina
    inner join      I_PurgInfoRecdOrgPlantData                              as _eine   on _eina.PurchasingInfoRecord = _eine.PurchasingInfoRecord
    left outer join P_StandardPurchaseOrders (p_days : $parameters.p_days,
                                              p_date : $parameters.p_date ) as _orders on  _eine.PurchasingInfoRecord   = _orders.PurchasingInfoRecord
                                                                                       and _eine.Plant                  = _orders.Plant
                                                                                       and _eina.Material               = _orders.Material
                                                                                       and _eine.PurchasingOrganization = _orders.PurchasingOrganization
{
  _eina.Material,
  _eine.Plant,
  case
  when MRPArea is not null
  then MRPArea
  else
   _eine.Plant
  end                                                                                      as MRPArea,

  _eine.PurchasingInfoRecord,
  _eine.PurchasingOrganization,

  case
  when _orders.ReplenishmentType is not null
  then 'PO'
  else
  'NPO'
  end                                                                                      as STATUS,

  case
  when _orders.ReplenishmentType is not null
  then _orders.ReplenishmentType
  else
  'B'
  end                                                                                      as ReplenishmentType,

  PurchasingDocument,
  PurchasingDocumentItem,

  case
  when _orders.DifferenceInDays is not null
   then
  cast( _orders.DifferenceInDays as abap.dec( 7, 2 ))
   else
   _eine.MaterialPlannedDeliveryDurn
   end                                                                                     as DifferenceInDays



}
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_PURCHASINGINFORECORD",
"I_PURGINFORECDORGPLANTDATA",
"P_STANDARDPURCHASEORDERS"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/