aruni_sto_line

DDL: ARUNI_STO_LINE SQL: ARUNI_V_STO_LINE Type: view

PO selection at date level

aruni_sto_line is a CDS View that provides data about "PO selection at date level" in SAP S/4HANA. It reads from 6 data sources and exposes 31 fields.

Data Sources (6)

SourceAliasJoin Type
ekko hdr from
ekpo item inner
lfa1 lfa1 inner
mara m inner
marc mc inner
eket sch inner

Annotations (8)

NameValueLevelField
AbapCatalog.sqlViewName ARUNI_V_STO_LINE view
AbapCatalog.compiler.compareFilter true view
AccessControl.authorizationCheck #NOT_REQUIRED view
ObjectModel.usageType.sizeCategory #XXL view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.dataClass #TRANSACTIONAL view
AccessControl.personalData.blocking #REQUIRED view
EndUserText.label PO selection at date level view

Fields (31)

KeyFieldSource TableSource FieldDescription
purchord_num ekko ebeln
company_code ekko bukrs
purchord_sch eket etenr
delv_date eket eindt
sgt_scat ekpo sgt_scat
material ekpo matnr
plant ekpo werks
PurchDocType ekko bsart
PurchDocDate ekko bedat
Supplier ekko lifnr
StorageLocation ekpo lgort
StockSegment ekpo sgt_scat
SeasonYear ekpo fsh_season_year
Season ekpo fsh_season
SCollection ekpo fsh_collection
theme ekpo fsh_theme
webaz ekpo webaz
color mara color
size1 mara size1
size2 mara size2
color_atinn mara color_atinn
size1_atinn mara size1_atinn
size2_atinn mara size2_atinn
fsh_mg_at1 mara fsh_mg_at1
fsh_mg_at2 mara fsh_mg_at2
fsh_mg_at3 mara fsh_mg_at3
matkl mara matkl
satnr mara satnr
attyp mara attyp
reswk ekko reswk
reslo ekpo reslo
@AbapCatalog.sqlViewName: 'ARUNI_V_STO_LINE'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #X
@ObjectModel.usageType.dataClass:#TRANSACTIONAL
@AccessControl.personalData.blocking: #REQUIRED
@EndUserText.label: 'PO selection at date level'
define view aruni_sto_line
  as select from ekko as hdr
    inner join   ekpo as item on hdr.ebeln = item.ebeln
    inner join   eket as sch  on  item.ebeln = sch.ebeln
                              and item.ebelp = sch.ebelp
    inner join   mara as m    on item.matnr = m.matnr
    inner join   marc as mc   on  m.matnr            = mc.matnr
                              and item.werks         = mc.werks
                              and mc.fsh_mg_arun_req = '1'
    inner join   lfa1 as lfa1 on  lfa1.mandt     = hdr.mandt
                              and lfa1.lifnr     = hdr.lifnr
                              and lfa1.cvp_xblck = ''

{
  hdr.ebeln                                            as purchord_num,
  hdr.bukrs                                            as company_code,
  item.ebelp                                           as purchord_item,
  sch.etenr                                            as purchord_sch,
  sch.eindt                                            as delv_date,
  DATS_ADD_DAYS(sch.eindt,ceil(item.webaz), 'INITIAL') as po_arrival_date,
  item.sgt_scat,
  item.matnr                                           as material,
  item.werks                                           as plant,
  hdr.bsart                                            as PurchDocType,
  hdr.bedat                                            as PurchDocDate,
  hdr.lifnr                                            as Supplier,
  item.lgort                                           as StorageLocation,
  item.sgt_scat                                        as StockSegment,
  item.fsh_season_year                                 as SeasonYear,
  item.fsh_season                                      as Season,
  item.fsh_collection                                  as SCollection,
  item.fsh_theme                                       as theme,
  item.webaz,
  
 case                  
  when item.fixmg <> '' and sch.mng02 > 0 then sch.mng02 
  when item.fixmg = '' and sch.menge > 0 then sch.menge
  end                                                         as quantity,

  case when item.umren != 0
  then
      sch.wemng * div(item.umrez,item.umren)
  else
      sch.wemng
  end                                                  as quantity_gr,

  case when item.umren != 0
  then
      sch.dabmg * div(item.umrez,item.umren)
  else
      sch.dabmg
  end                                                  as quantity_conf,

  item.meins                                           as materialbaseunit,
  m.color,
  m.size1,
  m.size2,
  m.color_atinn,
  m.size1_atinn,
  m.size2_atinn,
  m.fsh_mg_at1,
  m.fsh_mg_at2,
  m.fsh_mg_at3,
  m.matkl,
  m.satnr,
  m.attyp,
  hdr.reswk                                            as reswk,
  item.reslo                                           as reslo
}
where
  (
       m.attyp        = ''
    or m.attyp        = '00'
    or m.attyp        = '02'
    or m.attyp        = '10'
    or m.attyp        = '11'
    or m.attyp        = '12'
  )
  and  item.knttp     = ''
  and  item.loekz     = ''
  and  item.elikz     = ''
  and  item.eglkz     = ''
  and  item.bstyp     = 'F'
  and  hdr.memorytype = ''
  and(
       item.pstyp     = '0'
    or item.pstyp     = '2'
    or item.pstyp     = '3'
    or item.pstyp     = '7'
  )
  and  item.retpo     = ''
  and  item.lblkz != 'X'
  and  hdr.frgrl      = ''
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"EKET",
"EKKO",
"EKPO",
"LFA1",
"MARA",
"MARC"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/