Atpc_Cds_Vbep
CDS View on VBEP Table for ATP BOP
Atpc_Cds_Vbep is a CDS View that provides data about "CDS View on VBEP Table for ATP BOP" in SAP S/4HANA. It reads from 2 data sources (I_SalesDocumentScheduleLine, vbap) and exposes 72 fields with key fields mandt, delnr, delps, delet, atpcat. It has 1 association to related views.
Data Sources (2)
| Source | Alias | Join Type |
|---|---|---|
| I_SalesDocumentScheduleLine | sched | from |
| vbap | vbap | left_outer |
Associations (1)
| Cardinality | Target | Alias | Condition |
|---|---|---|---|
| [0..1] | I_UnitOfMeasure | _BaseUnit | $projection.base_uom = _BaseUnit.UnitOfMeasure |
Annotations (9)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | ATPC_VBEP | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| EndUserText.label | CDS View on VBEP Table for ATP BOP | view | |
| ObjectModel.usageType.serviceQuality | #X | view | |
| ObjectModel.usageType.sizeCategory | #XXL | view | |
| ObjectModel.usageType.dataClass | #MIXED | view |
Fields (72)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | mandt | I_SalesDocumentScheduleLine | mandt | |
| KEY | delnr | I_SalesDocumentScheduleLine | SalesDocument | |
| KEY | delps | I_SalesDocumentScheduleLine | SalesDocumentItem | |
| KEY | delet | I_SalesDocumentScheduleLine | ScheduleLine | |
| KEY | atpcat | |||
| matnr | ||||
| werks | ||||
| berid | ||||
| lgort | ||||
| bwtar | vbap | bwtar | ||
| sgt_rcat | ||||
| sobkz | ||||
| kdauf | ||||
| kdpos | ||||
| pspel | ||||
| kunnr | ||||
| char1asGroup_Type | ||||
| fixmg | ||||
| uepvw | vbap | uepvw | ||
| uepos | ||||
| mtvfp | ||||
| abgru | ||||
| lfsta | ||||
| xchar | ||||
| lprio | ||||
| kztlf | ||||
| antlf | ||||
| char1asresmd | ||||
| RequirementsClassasreq_class | ||||
| pstyv | ||||
| ProductAvailabilityDateasmat_avail_date | ||||
| RRQQTY_BUiffilled | ||||
| CRQQTY_BUiffilled | ||||
| BaseUnitasbase_uom | ||||
| SalesOrganizationasvkorg | ||||
| vtweg | ||||
| spart | ||||
| auart | ||||
| vsbed | ||||
| vstel | ||||
| route | ||||
| aulwe | ||||
| tddat | I_SalesDocumentScheduleLine | TransportationPlanningDate | ||
| tduhr | I_SalesDocumentScheduleLine | TransportationPlanningTime | ||
| wadat | I_SalesDocumentScheduleLine | GoodsIssueDate | ||
| wauhr | I_SalesDocumentScheduleLine | GoodsIssueTime | ||
| lddat | I_SalesDocumentScheduleLine | LoadingDate | ||
| lduhr | I_SalesDocumentScheduleLine | LoadingTime | ||
| BaseUnitasdelivered_qty_uom | ||||
| ProdAvailabilityCheckRqmtTypeasreq_type | ||||
| ConfirmedDeliveryDateendassline_date | ||||
| ConfirmedDeliveryTimeendassline_time | ||||
| OrderToBaseQuantityDnmntr3endasorder_qty | ||||
| BaseUnitasorder_qty_uom | ||||
| ItemGrossWeightasbrgew | ||||
| gewei | ||||
| kwmeng | ||||
| vrkme | ||||
| uvvlk | ||||
| fsh_candate | ||||
| CreationDate | ||||
| LastChangeDate | ||||
| Substn_Numerator | ||||
| Substn_Denominator | ||||
| cuobj | ||||
| cuobj_ch | vbap | cuobj_ch | ||
| rfsta | vbap | rfsta | ||
| bwart | I_SalesDocumentScheduleLine | GoodsMovementType | ||
| shkzg | ||||
| awahr | vbap | awahr | ||
| vbtyp | ||||
| BPSTMUsecase_BaseUnit |
@AbapCatalog.sqlViewName: 'ATPC_VBEP'
@ClientHandling.algorithm: #SESSION_VARIABLE
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@AccessControl.personalData.blocking
@EndUserText.label: 'CDS View on VBEP Table for ATP BOP'
@ObjectModel: {
usageType: {
serviceQuality: #X,
sizeCategory: #XXL,
dataClass: #MIXED
}
}
define view Atpc_Cds_Vbep
as select from I_SalesDocumentScheduleLine as sched
-- join to vbap needed for fashion resmd override (not part of VDM)
left outer join vbap on vbap.vbeln = sched.SalesDocument
and vbap.posnr = sched.SalesDocumentItem
association [0..1] to I_UnitOfMeasure as _BaseUnit on $projection.base_uom = _BaseUnit.UnitOfMeasure
{
key sched.mandt as mandt,
key sched.SalesDocument as delnr,
key sched.SalesDocumentItem as delps,
key sched.ScheduleLine as delet,
key cast(concat('V', sched._SalesDocumentItem._SDDocumentCategory.SDDocumentCategory) as atpcat) as atpcat,
sched._SalesDocumentItem.Material as matnr,
sched._SalesDocumentItem.Plant as werks,
sched._SalesDocumentItem.MRPArea as berid,
sched._SalesDocumentItem.StorageLocation as lgort,
cast(case
when sched._SalesDocumentItem.Batch <> '' then sched._SalesDocumentItem.Batch
when vbap.xchpf = ''
and sched._SalesDocumentItem.Batch = '' then vbap.bwtar
else ''
end as abap.char(10)) as charg,
vbap.bwtar as bwtar,
sched._SalesDocumentItem.RequirementSegment as sgt_rcat,
sched._SalesDocumentItem.InventorySpecialStockType as sobkz,
sched._SalesDocumentItem.OriginSDDocument as kdauf,
sched._SalesDocumentItem.OriginSDDocumentItem as kdpos,
sched._SalesDocumentItem.WBSElement as pspel,
sched._SalesDocument.SoldToParty as kunnr,
cast(case
when sched._SalesDocumentItem.InventorySpecialStockType = 'E' then sched._SalesDocumentItem.OriginSDDocument
when sched._SalesDocumentItem.InventorySpecialStockType = 'Q' then sched._SalesDocumentItem.WBSElement
when sched._SalesDocumentItem.InventorySpecialStockType = 'V'
or sched._SalesDocumentItem.InventorySpecialStockType = 'W'
or sched._SalesDocumentItem.InventorySpecialStockType = 'B' then sched._SalesDocument.SoldToParty
else ''
end as abap.char(20)) as sskey, -- TODO: global field name
cast(case
when sched._SalesDocumentItem.InventorySpecialStockType = 'E' then sched._SalesDocumentItem.OriginSDDocumentItem
else ''
end as abap.char(6)) as sskey_ext, -- TODO: global field name
cast( case when sched._SalesDocument.CompleteDeliveryIsDefined = 'X' then '001'
else sched._SalesDocumentItem.DeliveryGroup
end as abap.char(3)) as group_number,
cast(case when sched._SalesDocument.CompleteDeliveryIsDefined = ''
and sched._SalesDocumentItem.QuantityIsFixed = ''
and sched._SalesDocumentItem.BillOfMaterial <> '' then 'B'
when sched._SalesDocument.CompleteDeliveryIsDefined = 'X'
or sched._SalesDocumentItem.DeliveryGroup <> '000' then 'A'
else ''
end as abap.char(1)) as Group_Type, -- no longer used
cast(case when sched._SalesDocument.CompleteDeliveryIsDefined = ''
and sched._SalesDocumentItem.QuantityIsFixed = '' then sched._SalesDocumentItem.BillOfMaterial
else ''
end as stnum preserving type) as bill_of_material,
sched._SalesDocument.CompleteDeliveryIsDefined as complete_delivery,
sched._SalesDocumentItem.DeliveryDateQuantityIsFixed as fixmg,
vbap.uepvw as uepvw,
sched._SalesDocumentItem.HigherLevelItem as uepos,
sched._SalesDocumentItem.ProdAvailabilityCheckGroup as mtvfp,
sched._SalesDocumentItem.SalesDocumentRjcnReason as abgru,
sched._SalesDocumentItem.DeliveryStatus as lfsta,
sched._SalesDocumentItem.BatchManagementIsSalesInternal as xchar,
sched._SalesDocumentItem.TransitPlant as transit_plant,
sched._SalesDocumentItem.DeliveryPriority as lprio,
sched._SalesDocumentItem.PartialDeliveryIsAllowed as kztlf,
sched._SalesDocumentItem.MaxNmbrOfPartialDelivery as antlf,
cast(case -- RESMD computed from VBAP-REVFP (fashion override)
when vbap.revfp = 'A' then '' -- One-time delivery
when vbap.revfp = 'B' then 'B' -- Full delivery
when vbap.revfp = 'C' then 'X' -- Delivery proposal
when vbap.revfp = 'D' then '' -- Dialog box in the case of shrtages (batch/BAPI one-time dlv)
when vbap.revfp = 'E' then 'X' -- Dialog box in the case of shortages (batch/BAPI dlv. prpsl)
when vbap.revfp = 'F' then 'B' -- Dialog box (Batch/BAPI Full Delivery) as Item Overrride
when vbap.revfp = '1' then 'X' -- Delivery proposal for product selection
when vbap.revfp = '' then
(case -- RESMD computed from TVTA-REVFP as in include LV03VFA7
when sched._SalesDocument._SalesArea.ATPResultModeControl = '' then 'B' -- Dialog box in the case of shortages (batch/BAPI full dlv.)
when sched._SalesDocument._SalesArea.ATPResultModeControl = 'A' then '' -- One-time delivery
when sched._SalesDocument._SalesArea.ATPResultModeControl = 'B' then 'B' -- Full delivery
when sched._SalesDocument._SalesArea.ATPResultModeControl = 'C' then 'X' -- Delivery proposal
when sched._SalesDocument._SalesArea.ATPResultModeControl = 'D' then '' -- Dialog box in the case of shrtages (batch/BAPI one-time dlv)
when sched._SalesDocument._SalesArea.ATPResultModeControl = 'E' then 'X' -- Dialog box in the case of shortages (batch/BAPI dlv. prpsl)
when sched._SalesDocument._SalesArea.ATPResultModeControl = '1' then 'X' -- Delivery proposal for product selection
else 'X'
end)
else 'X'
end as abap.char(1)) as resmd, --TODO: global field name
sched.RequirementsClass as req_class,
sched._SalesDocumentItem.SalesDocumentItemCategory as pstyv,
sched.ScheduleLineCategory as sline_category,
-- PAC DATA
sched.ProductAvailabilityDate as mat_avail_date,
sched.ProductAvailabilityTime as mat_avail_time,
-- following case statements can be removed for 1808/1809, instead rely on new fields
@Semantics.quantity.unitOfMeasure: 'base_uom'
case when sched.RequestedRqmtQtyInBaseUnit > 0
then sched.RequestedRqmtQtyInBaseUnit
else sched.OpenReqdDelivQtyInBaseUnit
end as open_reqqty, -- RRQQTY_BU if filled, else ordqty_bu
@Semantics.quantity.unitOfMeasure: 'base_uom'
case when sched.ConfirmedRqmtQtyInBaseUnit > 0
then sched.ConfirmedRqmtQtyInBaseUnit
else sched.OpenConfdDelivQtyInBaseUnit
end as open_cnfqty, -- CRQQTY_BU if filled, else ocdqty_bu
sched.BaseUnit as base_uom, -- meins
-- Scheduling DATA
sched._SalesDocument.SalesOrganization as vkorg,
sched._SalesDocument.DistributionChannel as vtweg,
sched._SalesDocument.OrganizationDivision as spart,
sched._SalesDocument.SalesDocumentType as auart,
sched._SalesDocument.ShippingCondition as vsbed,
sched._SalesDocumentItem.ShippingPoint as vstel,
sched._SalesDocumentItem.Route as route,
'' as aulwe,
sched.TransportationPlanningDate as tddat,
sched.TransportationPlanningTime as tduhr,
sched.GoodsIssueDate as wadat,
sched.GoodsIssueTime as wauhr,
sched.LoadingDate as lddat,
sched.LoadingTime as lduhr,
-- PAL DATA
@Semantics.quantity.unitOfMeasure: 'delivered_qty_uom'
sched.DeliveredQuantityInBaseUnit as delivered_qty, -- dlvqty_su
sched.BaseUnit as delivered_qty_uom, -- vrkme = sales_uom
sched.ProdAvailyCheckPlanningType as planning_type, -- plart
sched.ProdAvailabilityCheckRqmtType as req_type, -- bdart
case when sched.RequestedDeliveryDate <> '' then sched.RequestedDeliveryDate
else sched.ConfirmedDeliveryDate
end as sline_date, -- edatu
case when sched.RequestedDeliveryTime <> '' then sched.RequestedDeliveryTime
else sched.ConfirmedDeliveryTime
end as sline_time, -- ezeit
@Semantics.quantity.unitOfMeasure: 'order_qty_uom'
case when sched.OrderToBaseQuantityDnmntr = 0
then sched.CorrectedQtyInOrderQtyUnit
else division(sched.CorrectedQtyInOrderQtyUnit * sched.OrderToBaseQuantityNmrtr, sched.OrderToBaseQuantityDnmntr, 3 )
end as order_qty, -- wmeng
sched.BaseUnit as order_qty_uom, -- vrkme
@Semantics.quantity.unitOfMeasure: 'gewei'
sched._SalesDocumentItem.ItemGrossWeight as brgew,
sched._SalesDocumentItem.ItemWeightUnit as gewei,
@Semantics.quantity.unitOfMeasure: 'vrkme'
sched._SalesDocumentItem.OrderQuantity as kwmeng,
sched._SalesDocumentItem.OrderQuantityUnit as vrkme,
sched._SalesDocumentItem.ItemDeliveryIncompletionStatus as uvvlk,
sched._SalesDocumentItem.FashionCancelDate as fsh_candate,
sched._SalesDocumentItem.CreationDate,
sched._SalesDocumentItem.LastChangeDate,
-- ABC DATA
sched._SalesDocumentItem.AltvBsdConfSubstitutionStatus as substitution_status,
sched._SalesDocumentItem.OriginalPlant as original_plant,
sched._SalesDocumentItem.MDSubstnConversionNumerator as Substn_Numerator,
sched._SalesDocumentItem.MDSubstnConversionDenominator as Substn_Denominator,
sched._SalesDocumentItem.ProductConfiguration as cuobj,
vbap.cuobj_ch as cuobj_ch,
vbap.rfsta as rfsta,
sched.GoodsMovementType as bwart,
sched._SalesDocumentItem.IsReturnsItem as shkzg,
vbap.awahr as awahr,
_SalesDocumentItem._SDDocumentCategory.SDDocumentCategory as vbtyp, -- BPS TM Use case
_BaseUnit
}
where
sched.RequirementsClass <> ''
or sched._SalesDocumentItem.AltvBsdConfSubstitutionStatus = 'A';
/*+[internal] {
"BASEINFO":
{
"FROM":
[
"I_SALESAREA",
"I_SALESDOCUMENT",
"I_SALESDOCUMENTITEM",
"I_SALESDOCUMENTSCHEDULELINE",
"I_SDDOCUMENTCATEGORY",
"VBAP"
],
"ASSOCIATED":
[
"I_UNITOFMEASURE"
],
"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