ARUN_I_SO_REQMT_PREV
Sales Order selection from Preview table
ARUN_I_SO_REQMT_PREV is a CDS View that provides data about "Sales Order selection from Preview table" in SAP S/4HANA. It reads from 19 data sources and exposes 133 fields with key fields vbeln, posnr.
Data Sources (19)
| Source | Alias | Join Type |
|---|---|---|
| vbpa | AG1 | left_outer |
| vbpa | AG2 | left_outer |
| Arun_I_So_1 | Arun_I_So_1 | inner |
| knvv | c | left_outer |
| ekes | ekes | left_outer |
| ekko | ekko | left_outer |
| vbak | h | from |
| kna1 | kna1 | inner |
| lfa1 | lfa1 | left_outer |
| arun_preview | prev | left_outer |
| vbpa | RE1 | left_outer |
| vbpa | RE2 | left_outer |
| vbpa | RG1 | left_outer |
| vbpa | RG2 | left_outer |
| ARUN_I_SO_VBEP_FIELD | sl | inner |
| tvak | tv | inner |
| vbkd | vbkd | left_outer |
| vbpa | WE1 | left_outer |
| vbpa | WE2 | left_outer |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| p_langu | abap.lang |
Annotations (9)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | ARUN_V_SO_REQ_P | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| AccessControl.personalData.blocking | #REQUIRED | view | |
| ObjectModel.usageType.dataClass | #TRANSACTIONAL | view | |
| ClientHandling.algorithm | #AUTOMATED | view | |
| EndUserText.label | Sales Order selection from Preview table | view |
Fields (133)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | vbeln | vbak | vbeln | |
| KEY | posnr | i | posnr | |
| aufnr | vbak | vbeln | ||
| erdat | vbak | erdat | ||
| audat | vbak | audat | ||
| vbtyp | vbak | vbtyp | ||
| augru | vbak | augru | ||
| auart | vbak | auart | ||
| vkorg | vbak | vkorg | ||
| vtweg | vbak | vtweg | ||
| vdatu | vbak | vdatu | ||
| bstdk | vbak | bstdk | ||
| eindt | ||||
| bstnk | vbak | bstnk | ||
| fsh_rereg | vbak | fsh_rereg | ||
| cmgst | vbak | cmgst | ||
| kunnr | vbak | kunnr | ||
| fsh_cq_check | vbak | fsh_cq_check | ||
| vkgrp | vbak | vkgrp | ||
| vkbur | vbak | vkbur | ||
| ernam | vbak | ernam | ||
| lifsk | vbak | lifsk | ||
| lfstk | vbak | lfstk | ||
| grkor | i | grkor | ||
| material | i | matnr | ||
| matkl | i | matkl | ||
| mvgr1 | i | mvgr1 | ||
| plant | i | werks | ||
| fsh_candate | i | fsh_candate | ||
| hfsh_candate | vbak | fsh_candate | ||
| req_segment | i | sgt_rcat | ||
| vbtypGthenVGelseVCendasreq_ind | ||||
| fsh_season | i | fsh_season | ||
| fsh_theme | i | fsh_theme | ||
| lprio | i | lprio | ||
| sobkz | i | sobkz | ||
| kowrr | i | kowrr | ||
| sposn | i | sposn | ||
| bedae | i | bedae | ||
| pstyv | i | pstyv | ||
| fsh_vas_rel | i | fsh_vas_rel | ||
| fsh_item | i | fsh_item | ||
| lfsta | i | lfsta | ||
| vstel | i | vstel | ||
| attyp | i | attyp | ||
| maktg | i | maktg | ||
| netpr | i | netpr | ||
| netwr | i | netwr | ||
| waerk | i | waerk | ||
| mtvfp | i | mtvfp | ||
| berid | i | berid | ||
| route | i | route | ||
| dismm | i | dismm | ||
| stlnr | i | stlnr | ||
| stdat | i | stdat | ||
| fixmg | i | fixmg | ||
| req_conf_qty | ARUN_I_SO_VBEP_FIELD | lmeng | ||
| vbtypGthenVGelseVCendasbdart | ||||
| req_dlvdate | ARUN_I_SO_VBEP_FIELD | req_dlvdate | ||
| cnf_dlvdate | ARUN_I_SO_VBEP_FIELD | edatu | ||
| satnr | i | satnr | ||
| xchpf | i | xchpf | ||
| sgt_stk_prt | i | sgt_stk_prt | ||
| kdgrp | knvv | kdgrp | ||
| fsh_grreg | knvv | fsh_grreg | ||
| sgt_covs | i | sgt_covs | ||
| spart | i | spart | ||
| hspart | vbak | spart | ||
| color_atinn | i | color_atinn | ||
| size1_atinn | i | size1_atinn | ||
| size2_atinn | i | size2_atinn | ||
| color | i | color | ||
| size1 | i | size1 | ||
| size2 | i | size2 | ||
| uepos | i | uepos | ||
| kvgr1 | knvv | kvgr1 | ||
| kvgr2 | knvv | kvgr2 | ||
| kvgr3 | knvv | kvgr3 | ||
| kvgr4 | knvv | kvgr4 | ||
| kvgr5 | knvv | kvgr5 | ||
| kwmeng | i | kwmeng | ||
| arunid | arunid | |||
| arun_status | arun_status | |||
| purchdoc_num | purchdoc_num | |||
| reserv_num | reserv_num | |||
| reserv_item | reserv_item | |||
| stock_source | stock_source | |||
| purchord_num | purchord_num | |||
| prodord_num | prodord_num | |||
| prodord_item | prodord_item | |||
| purchord_sch | purchord_sch | |||
| alloc_qty | arun_preview | alloc_qty | ||
| arun_mode | arun_mode | |||
| changed_by | changed_by | |||
| ilfgsa | ilfgsa | |||
| iuvall | iuvall | |||
| iuvvlk | iuvvlk | |||
| iuvfak | iuvfak | |||
| lfgsk | vbak | lfgsk | ||
| abstk | vbak | abstk | ||
| spstg | vbak | spstg | ||
| uvall | vbak | uvall | ||
| uvvlk | vbak | uvvlk | ||
| uvfak | vbak | uvfak | ||
| uvals | vbak | uvals | ||
| uvvls | vbak | uvvls | ||
| uvfas | vbak | uvfas | ||
| faksk | vbak | faksk | ||
| bukrs | bukrs_vf | |||
| zterm | vbkd | zterm | ||
| inco1 | vbkd | inco1 | ||
| delco | vbkd | delco | ||
| pfmenge | ||||
| phmenge | ||||
| prmenge | ||||
| pomenge | ||||
| stk_segment | arun_preview | stk_segment | ||
| lifnr | ekko | lifnr | ||
| bstkd | vbkd | bstkd | ||
| prreg | ||||
| shipto | ||||
| soldto | ||||
| payer | ||||
| billto | ||||
| land1 | ||||
| sgt_scope | i | sgt_scope | ||
| batch_req | i | charg | ||
| sloc_req | i | lgort | ||
| ibd_num | ekes | vbeln | ||
| ibd_itm | ekes | vbelp | ||
| plnum | arun_preview | plnum | ||
| dmenge | dlvqty_bu | |||
| klmeng | i | klmeng |
@AbapCatalog.sqlViewName: 'ARUN_V_SO_REQ_P'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ObjectModel.usageType.sizeCategory: #XXL
@ObjectModel.usageType.serviceQuality: #X
@AccessControl.personalData.blocking: #REQUIRED
@ObjectModel.usageType.dataClass:#TRANSACTIONAL
@ClientHandling.algorithm: #AUTOMATED
@EndUserText.label: 'Sales Order selection from Preview table'
define view ARUN_I_SO_REQMT_PREV
with parameters
p_langu : abap.lang
as select from vbak as h
inner join tvak as tv on(
h.auart = tv.auart
)
inner join kna1 as kna1 on(
kna1.kunnr = h.kunnr
and kna1.cvp_xblck = ''
)
inner join Arun_I_So_1( p_langu :$parameters.p_langu ) as i on(
h.vbeln = i.vbeln
)
inner join ARUN_I_SO_VBEP_FIELD as sl on(
i.vbeln = sl.vbeln
and i.posnr = sl.posnr
)
left outer join arun_preview as prev on(
sl.vbeln = prev.salesdoc_num
and sl.posnr = prev.salesdoc_item
and sl.mbdat = prev.material_avail_date
and sl.min_mbdat = prev.requested_date
and(
prev.req_ind = 'VC'
or prev.req_ind = 'VI'
or prev.req_ind = 'VG' //For contracts
)
)
// ship to party (Kunwe) WE
left outer join vbpa as WE1 on(
i.vbeln = WE1.vbeln
and i.posnr = WE1.posnr
and WE1.parvw = 'WE'
)
left outer join vbpa as WE2 on(
h.vbeln = WE2.vbeln
and WE2.posnr = '000000'
and WE2.parvw = 'WE'
)
// Sold to party - AG
left outer join vbpa as AG1 on(
i.vbeln = AG1.vbeln
and i.posnr = AG1.posnr
and AG1.parvw = 'AG'
)
left outer join vbpa as AG2 on(
h.vbeln = AG2.vbeln
and AG2.posnr = '000000'
and AG2.parvw = 'AG'
)
//Payer - RG
left outer join vbpa as RG1 on(
i.vbeln = RG1.vbeln
and i.posnr = RG1.posnr
and RG1.parvw = 'RG'
)
left outer join vbpa as RG2 on(
h.vbeln = RG2.vbeln
and RG2.posnr = '000000'
and RG2.parvw = 'RG'
)
// Bill to party - RE
left outer join vbpa as RE1 on(
i.vbeln = RE1.vbeln
and i.posnr = RE1.posnr
and RE1.parvw = 'RE'
)
left outer join vbpa as RE2 on(
h.vbeln = RE2.vbeln
and RE2.posnr = '000000'
and RE2.parvw = 'RE'
)
left outer join knvv as c on(
h.kunnr = c.kunnr
and h.vkorg = c.vkorg
and h.vtweg = c.vtweg
and h.spart = c.spart
)
left outer join vbkd as vbkd on(
i.vbeln = vbkd.vbeln
and i.posnr = vbkd.posnr
)
left outer join ekko as ekko on(
prev.purchord_num = ekko.ebeln
)
left outer join lfa1 as lfa1 on(
lfa1.lifnr = ekko.lifnr
and lfa1.cvp_xblck = ''
)
left outer join ekes as ekes on(
ekes.ebeln = prev.purchord_num
and ekes.ebelp = prev.purchord_item
and ekes.etens = prev.confirmation_no
and prev.stock_source = 'L'
)
{
key h.vbeln,
key i.posnr,
h.vbeln as aufnr,
h.erdat,
h.audat,
h.vbtyp,
h.augru,
h.auart,
h.vkorg,
h.vtweg,
h.vdatu,
h.bstdk,
cast('00000000' as eindt) as eindt,
h.bstnk,
h.fsh_rereg,
h.cmgst,
h.kunnr,
h.fsh_cq_check,
h.vkgrp,
h.vkbur,
h.ernam,
h.lifsk,
h.lfstk,
i.grkor,
i.matnr as material,
case when batch is not null then batch
else i.charg end as batch,
i.matkl,
i.mvgr1,
i.werks as plant,
case when storage_location is not null then storage_location
else i.lgort end as storage_location,
i.fsh_candate,
h.fsh_candate as hfsh_candate,
i.sgt_rcat as req_segment,
case when material_baseunit is not null then material_baseunit
else i.meins end as material_baseunit,
case when prev.salesdoc_num is not null then salesdoc_num
else h.vbeln end as salesdoc_num,
case when prev.salesdoc_item is not null then salesdoc_item
else i.posnr end as salesdoc_item,
case
when h.vbtyp = 'I' then 'VI'
when h.vbtyp = 'G' then 'VG'
else 'VC' end as req_ind,
i.fsh_season,
i.fsh_season_year,
i.fsh_collection,
i.fsh_theme,
i.lprio,
i.sobkz,
i.kowrr,
i.sposn,
i.bedae,
i.pstyv,
i.fsh_vas_rel,
i.fsh_vas_prnt_id,
i.fsh_transaction,
i.fsh_item_group,
i.fsh_item,
i.lfsta,
i.vstel,
i.fsh_mg_arun_req,
i.attyp,
i.maktg,
i.netpr,
i.netwr,
i.waerk,
i.mtvfp,
i.rfm_psst_group,
i.berid,
i.route,
i.dismm,
i.stlnr,
i.stdat,
i.fixmg,
sl.lmeng as req_conf_qty,
case
when h.vbtyp = 'I' then 'VI'
when h.vbtyp = 'G' then 'VG'
else 'VC' end as bdart,
sl.req_dlvdate as req_dlvdate,
sl.edatu as cnf_dlvdate,
sl.mbdat as material_avail_date,
i.satnr,
i.xchpf,
i.sgt_stk_prt,
c.kdgrp,
c.fsh_grreg,
i.sgt_covs,
i.spart,
h.spart as hspart,
i.color_atinn,
i.size1_atinn,
i.size2_atinn,
i.color,
i.size1,
i.size2,
i.uepos,
c.kvgr1,
c.kvgr2,
c.kvgr3,
c.kvgr4,
c.kvgr5,
i.fsh_grid_cond_rec,
i.kwmeng,
arunid,
arun_status,
purchdoc_num,
reserv_num,
purchdoc_item,
reserv_item,
stock_source,
purchord_num,
prodord_num,
purchord_item,
prodord_item,
purchord_sch,
confirmation_no,
consignment_num,
prev.alloc_qty,
@Semantics.quantity.unitOfMeasure: 'material_baseunit'
delivery_date_po,
arun_mode,
creation_time,
changed_by,
mat_avail_date_mrp,
ilfgsa,
iuvall,
iuvvlk,
iuvfak,
h.lfgsk,
h.abstk,
h.spstg,
h.uvall,
h.uvvlk,
h.uvfak,
h.uvals,
h.uvvls,
h.uvfas,
h.faksk,
bukrs_vf as bukrs,
vbkd.zterm,
vbkd.inco1,
vbkd.delco,
case when arun_status = 'F' then prev.alloc_qty else 0 end as pfmenge,
case when arun_status = 'H' then prev.alloc_qty else 0 end as phmenge,
case when arun_status = 'R' then prev.alloc_qty else 0 end as prmenge,
case when arun_status = 'O' then prev.alloc_qty else 0 end as pomenge,
case when prev.requested_date is not null then prev.requested_date else sl.min_mbdat end as requested_date,
prev.stk_segment,
// vbep_date.min_mbdat as new_req_dlvdate,
ekko.lifnr as lifnr,
vbkd.bstkd,
'A' as prreg,
case
when fsh_rereg != '' then fsh_rereg else '$$$$' end as rereg,
case when WE1.kunnr is not null then WE1.kunnr else WE2.kunnr end as shipto,
case when AG1.kunnr is not null then AG1.kunnr else AG2.kunnr end as soldto,
case when RG1.kunnr is not null then RG1.kunnr else RG2.kunnr end as payer,
case when RE1.kunnr is not null then RE1.kunnr else RE2.kunnr end as billto,
case when AG1.land1 is not null then AG1.land1 else AG2.land1 end as land1,
i.sgt_scope,
i.charg as batch_req,
i.lgort as sloc_req,
i.arun_fix_batch,
ekes.vbeln as ibd_num,
ekes.vbelp as ibd_itm,
prev.plnum as plnum,
dlvqty_bu as dmenge,
i.klmeng as klmeng
}
where
// (
// h.uvvlk = 'C'
// ) -- header incompletion status concerning delivery
// and(
// sl.lmeng != 0
// ) -- confirmed quantity
(
h.vbtyp = 'C'
or h.vbtyp = 'I' -- consider only so and free of charge orders
or(
h.vbtyp = 'G'
and tv.fsh_cq_check = 'X'
)
)
and h.rfgsk != 'C' -- total refernce status of all items
and tv.fsh_msoind != '1' -- Exclude Multi Ship-to order
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"ARUN_I_SO_1",
"ARUN_I_SO_VBEP_FIELD",
"ARUN_PREVIEW",
"EKES",
"EKKO",
"KNA1",
"KNVV",
"LFA1",
"TVAK",
"VBAK",
"VBKD",
"VBPA"
],
"ASSOCIATED":
[],
"BASE":
[],
"ANNO_REF":
[],
"SCALAR_FUNCTION":
[],
"VERSION":0,
"ANNOREF_EVALUATION_ERROR":""
}
}*/
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA