You are on page 1of 14

06/05/2021 Search for DDL sources with name and/or template 1

ZVCC_SALESORDER A DASC2 05/18/2021 21:30:35


//---------------------------------------------------------------------*
// Object Id : SDD0017 / ECR202000010 *
// Author : Jay Malla *
// Creation Date : 01-Feb-2020 *
// Description : Sales Order Consumption View - This is the main view*
// that is called by the Sales Order Fiori App. This *
// view ties into all of the other views through joins *
// and associations. *
// *
// Transport No. : DR1K9B6438 *
//---------------------------------------------------------------------*
// Object Id : SDD0017 /ECR202001277 *
// Author : Manoj Kumar *
// Creation Date : 21-May-2020 *
// Description 1 : Add Delivery and Invoice in search fields *
// 2 : Added Sales Rep Name as tooltip for sales rep number*
// 3 : Shipping point & ShippingPointDescription as tooltip*
// 4 : Customer expected price at line level *
// 5 : Preceeding document number on order detail *
// Transport No. : DR1K9B69OH *
// Change Tag : Begin ADD:KUMARM3:21-May-2020:ECR202001277 *
// End ADD:KUMARM3:21-May-2020:ECR202001277 *
//---------------------------------------------------------------------*
// Object Id : SDD0017 /ECR202100394 *
// Author : Chinmaya Das (DASC2) *
// Creation Date : 16-Apr-2021 *
// Description : Add Batch # (VBAP-CHARG) *
// Transport No. : DR1K9B6O14 *
// Change Tag : Begin ADD:DASC2:16-Apr-2021:ECR202100394 *
// End ADD:DASC2:16-Apr-2021:ECR202100394 *
// ++ ADD:DASC2:16-Apr-2021:ECR202100394 *
//---------------------------------------------------------------------*
@AbapCatalog.sqlViewName: 'ZVDC_SALESORDER'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck:#NOT_REQUIRED
@EndUserText.label: 'Sales Order Search'
@OData.publish: false
define view ZVCC_SALESORDER as select from ZVC_SALESORDER
// Items
association [1..*] to ZVCC_SALESORDERITEM as _items on $projection.orderNumber = _items.orderNum
ber
// Partners
//association [1..*] to ZVCC_SO_PARTNER as _partners on $projection.orderNumber = _partners.orde
rNumber
// Business Partners
association [1..1] to ZVCC_SO_PARTNER as _partnersSP on $projection.orderNumber = _partnersSP.or
derNumber
and _partnersSP.partnerFunction = 'AG'
association [1..1] to ZVCC_SO_PARTNER as _partnersBP on $projection.orderNumber = _partnersBP.or
derNumber
and _partnersBP.partnerFunction = 'RE'
association [1..1] to ZVCC_SO_PARTNER as _partnersPY on $projection.orderNumber = _partnersPY.or
derNumber
and _partnersPY.partnerFunction = 'RG'
association [1..1] to ZVCC_SO_PARTNER as _partnersSH on $projection.orderNumber = _partnersSH.or
derNumber
and _partnersSH.partnerFunction = 'WE'
association [1..1] to ZVCC_SO_PARTNER as _partnersZE on $projection.orderNumber = _partnersZE.or
derNumber
and _partnersZE.partnerFunction = 'ZE'
// Customer search value help
association[1..*] to ZVC_CUSTOMER_VH as _CustomerVH on _CustomerVH.kunnr = $projection.customer
06/05/2021 Search for DDL sources with name and/or template 1

{
@ObjectModel.readOnly: true
key ZVC_SALESORDER.vbeln as orderNumber,
@ObjectModel.readOnly: true
ZVC_SALESORDER.auart as orderType,
@ObjectModel.readOnly: true
ZVC_SALESORDER.bezei as orderTypeDescription,
@ObjectModel.readOnly: true
concat_with_space( concat_with_space( ZVC_SALESORDER.auart, ZVC_SALESORDER.bezei , 2) , ZVC_SAL
ESORDER.vbeln, 3)
as formattedOrderNumber,
@ObjectModel.readOnly: true
cast( concat_with_space( concat_with_space( ZVC_SALESORDER.auart, ZVC_SALESORDER.bezei , 6) ,
ZVC_SALESORDER.vbeln, 6) as char200 )
as nonformattedOrderNumber,
@ObjectModel.readOnly: true
@Consumption.valueHelp: '_CustomerVH'
@Consumption.filter.selectionType: #SINGLE @UI.selectionField: [{position: 1 }]
@EndUserText.label: 'Customer'
ZVC_SALESORDER.kunnr as customer, //sold-To Party
@ObjectModel.readOnly: true
@EndUserText.label: 'Purchase Order Type'
ZVC_SALESORDER.bsark as poType,
@ObjectModel.readOnly: true
ZVC_SALESORDER.poTypeDescription as poTypeDescription,
@ObjectModel.readOnly: true
@EndUserText.label: 'Delivery Block'
ZVC_SALESORDER.lifsk as deliveryBlock,
@ObjectModel.readOnly: true
ZVC_SALESORDER.deliveryBlockDescription,
@ObjectModel.readOnly: true
@EndUserText.label: 'Billing Block'
ZVC_SALESORDER.faksk as billingBlock,
@ObjectModel.readOnly: true
ZVC_SALESORDER.billingBlockDescription,
@ObjectModel.readOnly: true
ZVC_SALESORDER.uvall as headerData,
@ObjectModel.readOnly: true
ZVC_SALESORDER.uvall as orderStatus,
//This is the Order header status - this is for the search order status screen
@EndUserText:{label: 'Order Status' , quickInfo: 'Order Status'}
@ObjectModel.readOnly: true
case
when ZVC_SALESORDER.abstk = 'C' then 'Fully Rejected'
when ( ZVC_SALESORDER.uvall <> 'C' or ZVC_SALESORDER.uvals <> 'C' ) then 'Incomplete'
else '' end
as headerOrderStatus,
@ObjectModel.readOnly: true
ZVC_SALESORDER.gbstk as overallStatus, //
@ObjectModel.readOnly: true
case ( ZVC_SALESORDER.gbstk )
when 'A' then 'Open'
when 'B' then 'Being processed'
when 'C' then 'Completed'
else 'May not occur'
end as overallStatusDescription,
@ObjectModel.readOnly: true
ZVC_SALESORDER.abstk as rejectionStatus,
@ObjectModel.readOnly: true
case ( ZVC_SALESORDER.abstk )
when 'A' then 'Nothing rejected'
when 'B' then 'Partially rejected'
when 'C' then 'Everything rejected'
06/05/2021 Search for DDL sources with name and/or template 1

else 'Nothing rejected'


end as rejectionStatusDescription,
@ObjectModel.readOnly: true
ZVC_SALESORDER.lfstk as deliveryStatus,
@ObjectModel.readOnly: true
case ( ZVC_SALESORDER.lfstk )
when 'A' then 'Not delivered'
when 'B' then 'Partially completed'
when 'C' then 'Completed'
else 'Not relev for deliv'
end as deliveryStatusDescription,
@ObjectModel.readOnly: true
ZVC_SALESORDER.lfgsk as overallDeliveryStatus,
@ObjectModel.readOnly: true
case ( ZVC_SALESORDER.lfgsk )
when 'A' then 'Not delivered'
when 'B' then 'Partially completed'
when 'C' then 'Completed'
else 'Not relev for deliv'
end as overallDeliveryStatusDesc,
@ObjectModel.readOnly: true
ZVC_SALESORDER.cmgst as creditStatus, //
@ObjectModel.readOnly: true
case ( ZVC_SALESORDER.cmgst )
when 'A' then 'Transaction is OK'
when 'B' then 'Transaction Not OK'
when 'C' then 'Approved, part relsd'
when 'D' then 'Released'
else 'Not performed'
end as creditStatusDescription,
@ObjectModel.readOnly: true
ZVC_SALESORDER.spstg as overallBlockStatus, //
@ObjectModel.readOnly: true
case ( ZVC_SALESORDER.spstg )
when 'A' then 'Not blocked'
when 'B' then 'Partially blocked'
when 'C' then 'Blocked'
else 'Not Blocked'
end as overallBlockStatusDesc,
@ObjectModel.readOnly: true
ZVC_SALESORDER.uvall as headerIncompletionStatus, //
@ObjectModel.readOnly: true
case ( ZVC_SALESORDER.uvall )
when 'A' then 'Incomplete'
when 'B' then 'Incomplete'
when 'C' then 'Complete'
else ''
end as headerIncompletionStatusDesc,
@ObjectModel.readOnly: true
ZVC_SALESORDER.uvals as lineIncompletionStatus, //
@ObjectModel.readOnly: true
case ( ZVC_SALESORDER.uvals )
when 'A' then 'All items incomplete'
when 'B' then 'Incomplete'
when 'C' then 'All items complete'
else ''
end as lineIncompletionStatusDesc,
@ObjectModel.readOnly: true
@EndUserText.label: 'Purchase Order'
// ZVC_SALESORDER.bstnk as purchaseOrder, --DELL:KUMARM3:21-May-2020:ECR202001277
ZVC_SALESORDER.bstkd as purchaseOrder, // ++ADD:KUMARM3:21-May-2020:ECR202001277
@ObjectModel.readOnly: true
@EndUserText.label: 'Sales Organization'
06/05/2021 Search for DDL sources with name and/or template 1

ZVC_SALESORDER.vkorg as salesOrganization,
@ObjectModel.readOnly: true
ZVC_SALESORDER.salesOrganizationDescription as salesOrganizationDescription,
@ObjectModel.readOnly: true
@EndUserText.label: 'Distribution Channel'
ZVC_SALESORDER.vtweg as distributionChannel,
@ObjectModel.readOnly: true
ZVC_SALESORDER.distributionChannelDescription as distributionChannelDescription,
@ObjectModel.readOnly: true
ZVC_SALESORDER.vkbur as salesOffice,
@ObjectModel.readOnly: true
ZVC_SALESORDER.vkgrp as salesGroup,
@EndUserText.label: 'E-Reference'
@ObjectModel.readOnly: true
ZVC_SALESORDER.ihrez as reference,
@ObjectModel.readOnly: true
@EndUserText.label: 'Net Value'
ZVC_SALESORDER.netwr as netValue,
@ObjectModel.readOnly: true
@EndUserText: { label: 'Currency',
quickInfo: 'Currency' }
ZVC_SALESORDER.waerk as documentCurrency,
@EndUserText: { label: 'Created By', quickInfo: 'Created By' }
@ObjectModel.readOnly: true
ZVC_SALESORDER.ernam as createdBy,
@ObjectModel.readOnly: true
@Consumption.filter.selectionType: #INTERVAL @UI.selectionField: [{position: 10 }]
@Consumption.filter.defaultValue:'@Environment.systemField: #SYSTEM_DATE'
ZVC_SALESORDER.erdat as createdDate,
@ObjectModel.readOnly: true
cast(
concat(
concat(
concat(substring(ZVC_SALESORDER.erdat, 5, 2), '/' ),
concat(substring(ZVC_SALESORDER.erdat, 7, 2), '/' )
),
substring(ZVC_SALESORDER.erdat, 1, 4)
)
as char10 ) as formattedCreatedDate,
@Consumption.filter.selectionType: #INTERVAL @UI.selectionField: [{position: 11 }]
ZVC_SALESORDER._soldTo as soldTo,
@ObjectModel.readOnly: true
ZVC_SALESORDER.erzet as createdTime,
@ObjectModel.readOnly: true
ZVC_SALESORDER.aedat as changedDate,
@EndUserText: { label: 'SoldTo CustomerName',
quickInfo: 'SoldTo CustomerName' }
@ObjectModel.readOnly: true
ZVC_SALESORDER.name1 as customerName, // sold-To Party Name
@EndUserText: { label: 'SoldToParty Customer', quickInfo: 'SoldToParty Customer' }
_partnersSP.Customer as spCustomer,
@EndUserText: { label: 'SoldToParty CustomerName', quickInfo: 'SoldToParty CustomerName' }
_partnersSP.name1 as spCutomerName,
@EndUserText: { label: 'SoldToParty Street', quickInfo: 'SoldToParty Street' }
_partnersSP.street as spStreet,
@EndUserText: { label: 'SoldToParty City', quickInfo: 'SoldToParty City' }
_partnersSP.city as spCity,
@EndUserText: { label: 'SoldToParty Region', quickInfo: 'SoldToParty Region' }
_partnersSP.region as spRegion,
@EndUserText: { label: 'SoldToParty Zip', quickInfo: 'SoldToParty Zip' }
_partnersSP.postalCode as spPostalCode,
concat_with_space( concat_with_space( concat_with_space( ltrim(_partnersSP.Customer, '0'), _part
nersSP.name1 , 10 ) ,_partnersSP.city , 3 ),
06/05/2021 Search for DDL sources with name and/or template 1

_partnersSP.region , 1 ) as PartnerSP,
@EndUserText: { label: 'BillToParty Customer', quickInfo: 'BillToParty Customer' }
_partnersBP.Customer as bpCustomer,
@EndUserText: { label: 'BillToParty CustomerName', quickInfo: 'BillToParty City' }
_partnersBP.name1 as bpCustomerName,
@EndUserText: { label: 'BillToParty Street', quickInfo: 'BillToParty Street' }
_partnersBP.street as bpStreet,
@EndUserText: { label: 'BillToParty City', quickInfo: 'BillToParty City' }
_partnersBP.city as bpCity,
@EndUserText: { label: 'BillToParty Region', quickInfo: 'BillToParty Region' }
_partnersBP.region as bpRegion,
@EndUserText: { label: 'BillToParty Zip', quickInfo: 'BillToParty Zip' }
_partnersBP.postalCode as bpPostalCode,
concat_with_space( concat_with_space( concat_with_space(ltrim( _partnersBP.Customer, '0') ,
_partnersBP.name1 , 4 ) ,_partnersBP.city , 1 ),
_partnersBP.region , 1 ) as PartnerBP,
@EndUserText: { label: 'PayTo Customer', quickInfo: 'Payer Customer' }
_partnersPY.Customer as pyCustomer,
@EndUserText: { label: 'PayTo CustomerName', quickInfo: 'Payer CutomerName' }
_partnersPY.name1 as pyCustomerName,
@EndUserText: { label: 'PayTo City', quickInfo: 'Payer City' }
_partnersPY.city as pyCity,
@EndUserText: { label: 'PayTo Region', quickInfo: 'Payer Region' }
_partnersPY.region as pyRegion,
concat_with_space( concat_with_space( concat_with_space(ltrim( _partnersPY.Customer, '0') ,
_partnersPY.name1 , 1 ) ,_partnersPY.city , 1 ),
_partnersPY.region , 1 ) as PartnerPY,
@EndUserText: { label: 'ShipTo Customer', quickInfo: 'ShipTo Customer' }
_partnersSH.Customer as shCustomer,
@EndUserText: { label: 'ShipTo CustomerName', quickInfo: 'ShipTo CustomerName' }
_partnersSH.name1 as shCustomerName,
@EndUserText: { label: 'ShipToParty Street', quickInfo: 'ShipToParty Street' }
_partnersSH.street as shStreet,
@EndUserText: { label: 'ShipTo City', quickInfo: 'ShipTo City' }
_partnersSH.city as shCity,
@EndUserText: { label: 'ShipTo Attn', quickInfo: 'ShipTo Attn' }
_partnersSH.street3 as shAttn,
@EndUserText: { label: 'ShipTo Region', quickInfo: 'ShipTo Region' }
_partnersSH.region as shRegion,
@EndUserText: { label: 'ShipToParty Zip', quickInfo: 'ShipToParty Zip' }
_partnersSH.postalCode as shPostalCode,
concat_with_space( concat_with_space( concat_with_space(ltrim( _partnersSH.Customer, '0') ,
_partnersSH.name1 , 1 ) ,_partnersSH.city , 1 ),
_partnersSH.region , 1 ) as PartnerSH,
@EndUserText: { label: 'Trained Physician', quickInfo: 'Trained Physician' }
_partnersZE.Customer as zeCustomer,
@EndUserText: { label: 'Trained Physician Name', quickInfo: 'Trained Physician Name' }
_partnersZE.name1 as zeCustomerName,
@EndUserText: { label: 'Trained Physician Street', quickInfo: 'Trained Physician Street' }
_partnersZE.street as zeStreet,
@EndUserText: { label: 'Trained Physician City', quickInfo: 'Trained Physician City' }
_partnersZE.city as zeCity,
@EndUserText: { label: 'Trained Physician Attn', quickInfo: 'Trained Physician Attn' }
_partnersZE.street3 as zeAttn,
@EndUserText: { label: 'Trained Physician Region', quickInfo: 'Trained Physician Region' }
_partnersZE.region as zeRegion,
@EndUserText: { label: 'Trained Physician Zip', quickInfo: 'Trained Physician Zip' }
_partnersZE.postalCode as zePostalCode,
concat_with_space( concat_with_space( concat_with_space(ltrim( _partnersZE.Customer, '0') ,
_partnersZE.name1 , 1 ) ,_partnersZE.city , 1 ),
_partnersZE.region , 1 ) as PartnerZE,
@ObjectModel.readOnly: true
ZVC_SALESORDER.kdgrp as customerGroup, // customer Groupe
06/05/2021 Search for DDL sources with name and/or template 1

@ObjectModel.readOnly: true
ZVC_SALESORDER.inco1 as incoterms1, // Incoterms1
@ObjectModel.readOnly: true
ZVC_SALESORDER.inco2 as incoterms2, // Incoterms2
@ObjectModel.readOnly: true
ZVC_SALESORDER.zterm as paymentTerms, //Payment terms and description
@ObjectModel.readOnly: true
ZVC_SALESORDER.prsdt as pricingDate, //Pricing date
@ObjectModel.readOnly: true
@EndUserText: { label: 'CFN', quickInfo: 'CFN' }
' ' as cfn, /// this is a placeholder field to pass in the cfn for searches w
hich are at the sales order line item level
@ObjectModel.readOnly: true
ZVC_SALESORDER.zzsm_alt_ref as alternateReferenceNumber, //Pricing date
@ObjectModel.readOnly: true
ZVC_SALESORDER.kostl as costCenter, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.kvgr1 as customerGroup1, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.customerGroup1Description as customerGroup1Description, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.kvgr2 as customerGroup2, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.kvgr3 as customerGroup3, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.kvgr4 as customerGroup4, //
@ObjectModel.readOnly: true
@EndUserText:{label: 'Implant Date', quickInfo: 'Implant Date'}
ZVC_SALESORDER.zotc_impdate as implantDate, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.zotc_impphy as implantingPhysician, //
@ObjectModel.readOnly: true
@UI.hidden: true
@Consumption.filter.hidden: true
ZVC_SALESORDER.zotc_patname as patientName, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.zotc_patrefno as patientReferenceNumber, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.zotc_rescoll as reasonForCollection, //
@ObjectModel.readOnly: true
@EndUserText:{label: 'Name of the Orderer', quickInfo: 'Name of the Orderer'}
ZVC_SALESORDER.bname as nameOfOrderer, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.zorf_recv_date as orderReceivedDate , //
@ObjectModel.readOnly: true
ZVC_SALESORDER.zorf_recv_time as orderReceivedTime, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.knumv as documentConditionNumber, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.zzsm_xps_vsbed as shippingConditionRateShopping, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.vsbed as shippingConditions, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.shippingConditionDesc as shippingConditionDesc, //
@ObjectModel.readOnly: true
@EndUserText:{label: 'Sub Order Reason' , quickInfo: 'Sub Order Reason'}
ZVC_SALESORDER.zzsm_subordreson as subOrderReason, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.telf1 as telephone, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.sbgrp as creditRepresentativeGroup, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.creditRepresentativeGroupDesc as creditRepresentativeGroupDesc, //
06/05/2021 Search for DDL sources with name and/or template 1

@ObjectModel.readOnly: true
@EndUserText:{label: 'Order Reason', quickInfo: 'Order Reason'}
ZVC_SALESORDER.augru as orderReason, //
@ObjectModel.readOnly: true
@UI.hidden: true
@Consumption.filter.hidden: true
ZVC_SALESORDER.orderReasonDescription as orderReasonDescription, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.ihrez_e as shipToReference, //
@ObjectModel.readOnly: true
ZVC_SALESORDER.vdatu as requestedDeliveryDate, //
//Divisions
@ObjectModel.readOnly: true
' ' as divisions, //
// Begin ADD:KUMARM3:21-May-2020:ECR202001277
//Delivery
@ObjectModel.readOnly: true
@EndUserText.label: 'Delivery'
' ' as delivery, //
//Invoice
@ObjectModel.readOnly: true
@EndUserText.label: 'Invoice'
' ' as invoice, //
@ObjectModel.readOnly: true
' ' as preceedingDoc,
@ObjectModel.readOnly: true
' ' as preceedingDocType,
@ObjectModel.readOnly: true
' ' as preceedingDocTypeDesc,
// End ADD:KUMARM3:21-May-2020:ECR202001277
// Begin ADD:DASC2:16-Apr-2021:ECR202100394
@ObjectModel.readOnly: true
@EndUserText.label: 'Batch Number'
' ' as batchNumber,
// End ADD:DASC2:16-Apr-2021:ECR202100394
/* Associations */
_items,
// _partners,
// @Consumption.hidden: true
// @Consumption.filter.hidden: true
// @UI.hidden: true
// _partnersSP,
// @Consumption.hidden: true
// @Consumption.filter.hidden: true
// _partnersBP,
// @Consumption.hidden: true
// @Consumption.filter.hidden: true
// @UI.hidden: true
// _partnersPY,
// @Consumption.filter.hidden: true
// @Consumption.hidden: true
// @UI.hidden: true
// _partnersSH,
_CustomerVH
}
Created DB view
ZVDC_SALESORDER
Referenced DDL Sources [entity] [view]
ZVCC_SALESORDERITEM ZVCC_SALESORDERITEM ZVDC_SOITEM
ZVCC_SO_PARTNER ZVCC_SO_PARTNER ZVDC_SO_PARTMER
ZVC_CUSTOMER_VH ZVC_CUSTOMER_VH ZVCUSTVH
ZVC_SALESORDER ZVC_SALESORDER ZVD_SALESORDER
Referenced tables or non-CDS views
06/05/2021 Search for DDL sources with name and/or template 1

KNA1

ZVCC_SALESORDERITEM A DASC2 05/18/2021 21:31:38


//---------------------------------------------------------------------*
// Object Id : SDD0017 / ECR202000010 *
// Author : Jay Malla *
// Creation Date : 01-Feb-2020 *
// Description : Sales Order Item Consumption View *
// *
// Transport No. : DR1K9B6438 *
//---------------------------------------------------------------------*
// Object Id : SDD0017 /ECR202001277 *
// Author : Manoj Kumar *
// Creation Date : 21-May-2020 *
// Description 1 : Add Delivery and Invoice in search fields *
// 2 : Added Sales Rep Name as tooltip for sales rep number*
// 3 : Shipping point & ShippingPointDescription as tooltip*
// 4 : Customer expected price at line level *
// 5 : Preceeding document number on order detail *
// Transport No. : DR1K9B69OH *
// Change Tag : Begin ADD:KUMARM3:21-May-2020:ECR202001277 *
// End ADD:KUMARM3:21-May-2020:ECR202001277 *
//---------------------------------------------------------------------*
// Object Id : SDD0017 /ECR202002838 *
// Author : Chinmaya Das (DASC2) *
// Creation Date : 09-March-2021 *
// Description : Add line item special stock partner and it's name1 *
// Transport No. : DR1K9B6MR7 *
// Change Tag : Begin ADD:DASC2:09-March-2021: ECR202002838 *
// End ADD:DASC2:09-March-2021: ECR202002838 *
// ++ ADD:DASC2:09-March-2021: ECR202002838 *
//---------------------------------------------------------------------*
// Object Id : SDD0017 /ECR202100394 *
// Author : Chinmaya Das (DASC2) *
// Creation Date : 16-Apr-2021 *
// Description : Add field Patient Name (VBAK-ZOC_PATNAME) *
// Transport No. : DR1K9B6O14 *
// Change Tag : Begin ADD:DASC2:16-Apr-2021:ECR202100394 *
// End ADD:DASC2:16-Apr-2021:ECR202100394 *
// ++ ADD:DASC2:16-Apr-2021:ECR202100394 *
//---------------------------------------------------------------------*
@AbapCatalog.sqlViewName: 'ZVDC_SOITEM'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Sales Order Item Consumption View'
//@OData.publish: true
define view ZVCC_SALESORDERITEM as select from ZVC_SALESORDERITEM
association [1..1] to ZVCC_SALESORDER as _header on $projection.orderNumber = _header.orderNumbe
r
association [0..1] to tvagt as _rejectReasonDesc on $projection.reasonForRejection = _rejectReas
onDesc.abgru
and _rejectReasonDesc.spras = $session.system_language
association [0..1] to I_DivisionText as _divisionDesc on $projection.division = _divisionDesc.Di
vision
and _divisionDesc.Language = $session.system_language
association [0..1] to I_Plant as plantDesc on $projection.plant = plantDesc.Plant
association [0..1] to vbup as _orderItemStatus on $projection.item = _orderItemStatus.posnr
and _orderItemStatus.vbeln = $projection.orderNumber
association [0..1] to vbap as _linestatus on $projection.orderNumber = _linestatus.vbeln
and _linestatus.posnr = $projection.item
association [0..1] to vbrp as _lineItemInv on $projection.item = _lineItemInv.aupos
and _lineItemInv.vbeln = $projection.orderNumber
06/05/2021 Search for DDL sources with name and/or template 1

// Begin ADD:KUMARM3:21-May-2020:ECR202001277
association [0..1] to kna1 as _salesRep on $projection.salesRepCode = _salesRep.kunnr
association [0..1] to I_ShippingPointText as _shippingPointDes on $projection.shippingPoint = _s
hippingPointDes.ShippingPoint
and _shippingPointDes.Language = $session.system_language
// End ADD:KUMARM3:21-May-2020:ECR202001277
association [0..1] to kna1 as _specialStockPartner on $projection.specialStockPartner = _special
StockPartner.kunnr // ++ ADD:DASC2:09-March-2021: ECR202002838
// Begin ADD:DASC2:16-Apr-2021:ECR202100394
association [0..1] to cepct as _profitCenterText on _profitCenterText.spras = $session.system
_language and
ZVC_SALESORDERITEM.prctr = _profitCenterTe
xt.prctr and
_profitCenterText.datbi = '99991231'
and // The Date is not passed as a system variable as it is not available in this version
ZVC_SALESORDERITEM.kokrs = _profitCenterTe
xt.kokrs
association [0..1] to t683v as _pricingProcedure on ZVC_SALESORDERITEM.vkorg = _pricing
Procedure.vkorg and
ZVC_SALESORDERITEM.vtweg = _pricing
Procedure.vtweg and
ZVC_SALESORDERITEM.headerDivision = _pricing
Procedure.spart and
ZVC_SALESORDERITEM.kalvg = _pricing
Procedure.kalvg and
_pricingProcedure.kalks = '1' //St
andard Pricing - Constant
// End ADD:DASC2:16-Apr-2021:ECR202100394
{
@ObjectModel.readOnly: true
key ZVC_SALESORDERITEM.vbeln as orderNumber,
@UI.lineItem: [{label: 'Item',position: '10' }]
key ZVC_SALESORDERITEM.posnr as item,
@UI.lineItem: [{label: 'Material',position: '20' }]
@EndUserText:{label: 'Material' , quickInfo: 'Material'}
ZVC_SALESORDERITEM.matnr as material,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.matwa as materialEntered,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Description' , quickInfo: 'Description'}
ZVC_SALESORDERITEM.arktx as description,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Order Qty' , quickInfo: 'Order Quantity'}
ZVC_SALESORDERITEM.kwmeng as orderQuantity,
@ObjectModel.readOnly: true
@EndUserText:{label: 'EDD', quickInfo: 'Estimated Delivery Date'}
ZVC_SALESORDERITEM.deliveryDate as deliveryDate,
@UI.dataPoint.valueFormat.numberOfFractionalDigits: 0
@ObjectModel.readOnly: true
@Semantics.quantity.unitOfMeasure: 'baseUnitOfMeasure'
@EndUserText:{label: 'Open Qty', quickInfo: 'Open Quantity'}
ZVC_SALESORDERITEM.openQty as openQty,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.vrkme as salesUnit,
@ObjectModel.readOnly: true
@EndUserText :{ label: 'Currency' , quickInfo: 'Currency'}
ZVC_SALESORDERITEM.waerk as documentCurrency,
@ObjectModel.readOnly: true
@EndUserText : {label: 'Created By' , quickInfo: 'Created By'}
ZVC_SALESORDERITEM.ernam as createdBy,
@ObjectModel.readOnly: true
@EndUserText : {label: 'Created On', quickInfo: 'Created On'}
ZVC_SALESORDERITEM.erdat as createdOn,
06/05/2021 Search for DDL sources with name and/or template 1

@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.erzet as createdTime,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Changed On' , quickInfo: 'Changed On' }
ZVC_SALESORDERITEM.aedat as changedOn,
@UI.lineItem: [{label: 'UOM',position: '30' }]
@Semantics.unitOfMeasure: true
@EndUserText:{label: 'Base UoM' , quickInfo: 'Base Unit of Measure'}
ZVC_SALESORDERITEM.meins as baseUnitOfMeasure,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Confirmed Qty' , quickInfo: 'Cumulative Confirmed Qty'}
ZVC_SALESORDERITEM.kbmeng as cumulativeConfirmedQtySaleUnit,
@ObjectModel.readOnly: true
@EndUserText.label: 'Target Qty'
ZVC_SALESORDERITEM.zmeng as targetQtySalesUnit,
@ObjectModel.readOnly: true
@EndUserText : {label: 'DP' , quickInfo: 'Delivery Priority' }
ZVC_SALESORDERITEM.lprio as deliveryPriority,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.lfmng as minimumDeliveryQtyInProcessing,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Div' , quickInfo: 'Division'}
ZVC_SALESORDERITEM.spart as division,
@ObjectModel.readOnly: true
@EndUserText : { label: 'ItCa' , quickInfo: 'Item Category'}
ZVC_SALESORDERITEM.pstyv as salesDocumentItemCategory,
@ObjectModel.readOnly: true
@EndUserText : {label: 'MPG' , quickInfo: 'Material Pricing Group'}
ZVC_SALESORDERITEM.kondm as materialPricingGroup,
@ObjectModel.readOnly: true
@EndUserText : { label: 'MG 5' , quickInfo: 'Material Group 5' }
ZVC_SALESORDERITEM.mvgr5 as materialGroup5,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Sales Doc Batch' ,quickInfo: 'Batch in the Sales Document'}
ZVC_SALESORDERITEM.charg as batch,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.zsm_wadat as requestedDeliveryDate,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Unit Price' ,quickInfo: 'Unit Price'}
ZVC_SALESORDERITEM.netpr as netPrice,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Plant' , quickInfo: 'Plant'}
ZVC_SALESORDERITEM.werks as plant,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Ship Pt' ,quickInfo: 'Shipping Point'}
ZVC_SALESORDERITEM.vstel as shippingPoint,
@ObjectModel.readOnly: true
@EndUserText:{label: 'SLOC' , quickInfo: 'Storage Location'}
ZVC_SALESORDERITEM.lgort as storageLocation,
@ObjectModel.readOnly: true
@EndUserText :{label: 'Usage', quickInfo: 'Usage Indicator'}
ZVC_SALESORDERITEM.vkaus as usageIndicator,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.z_orm_unit_delv as unitDeliveryNote,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.z_orm_unit_inv as unitInvoice,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.umvkn as denominatorConversion,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.umvkz as numeratorConversion,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.pmatn as pricingReferenceMaterial,
@ObjectModel.readOnly: true
06/05/2021 Search for DDL sources with name and/or template 1

@EndUserText : {label: 'Pricing Unit' , quickInfo: 'Pricing Unit'}


ZVC_SALESORDERITEM.kpein as conditionPricingUnit,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Rej' , quickInfo: 'Reason for Rejection'}
ZVC_SALESORDERITEM.abgru as reasonForRejection,
@ObjectModel.readOnly: true
_rejectReasonDesc.bezei as rejectReasonDesc,
@ObjectModel.readOnly: true
_divisionDesc.DivisionName as divisionDesc,
@ObjectModel.readOnly: true
plantDesc.PlantName as plantName,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Route' , quickInfo: 'Route' }
ZVC_SALESORDERITEM.route as route,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Sales Rep' , quickInfo: 'Sales Rep Code'}
ZVC_SALESORDERITEM.zotc_srepcode as salesRepCode,
// Begin ADD:KUMARM3:21-May-2020:ECR202001277
@ObjectModel.readOnly: true
@EndUserText:{label: 'Sales RepN' , quickInfo: 'Sales Rep Name'}
_salesRep.name1 as repName,
@ObjectModel.readOnly: true
_shippingPointDes.ShippingPointName as shippingPointDescription,
@ObjectModel.readOnly: true
ZVC_SALESORDERITEM.knumv as knumv,
//Customer expected price
@ObjectModel.readOnly: true
@EndUserText:{label: 'Cust Exp Price' , quickInfo: 'Customer Expected Price'}
' ' as customerExpPrice, //
// End ADD:KUMARM3:21-May-2020:ECR202001277
// Begin ADD:DASC2:16-Apr-2021:ECR202100394
@ObjectModel.readOnly: true
@EndUserText:{label: 'Condition Type List Price' , quickInfo: 'Condition Type List Price'}
_pricingProcedure.kartv as conditionTypeListPrice,
@ObjectModel.readOnly: true
@EndUserText:{label: 'List Price' , quickInfo: 'List Price'}
' ' as listPrice, // List Price
@ObjectModel.readOnly: true
@EndUserText:{label: 'Profit Center' , quickInfo: 'Profit Center'}
ZVC_SALESORDERITEM.prctr as profitCenter, // Profit Center
@ObjectModel.readOnly: true
_profitCenterText.ltext as profitCenterText, //Profit Center Text
// End ADD:DASC2:16-Apr-2021:ECR202100394
// Begin ADD:DASC2:09-March-2021: ECR202002838
@ObjectModel.readOnly: true
@EndUserText:{label: 'Spl St. Part' , quickInfo: 'Special Stock Partner'}
ZVC_SALESORDERITEM.specialStockPartner as specialStockPartner,
@ObjectModel.readOnly: true
@EndUserText:{label: 'Spl St PartN' , quickInfo: 'Special Stock Partner Name'}
_specialStockPartner.name1 as specialStockPartnerName,
// End ADD:DASC2:09-March-2021: ECR202002838
@EndUserText:{label: 'Line Total' , quickInfo: 'Line Total'}
ZVC_SALESORDERITEM.netwr as LineTotal,
@ObjectModel.readOnly: true
@EndUserText : {label: 'Status' , quickInfo: 'Status' }
case
when ZVC_SALESORDERITEM.kwmeng = _lineItemInv.fkimg then 'Fully Invoiced' // checking billed q
ty vs orderqty
when _linestatus.abgru <> '' then 'Rejected' // ELSE IF line is rejected (VBAP-ABGRU is not
null)
//then #Rejected”
when _orderItemStatus.lfgsa = '-' then 'Not Delv Relevant'
when _orderItemStatus.lfgsa = 'A' then 'No Delv Documents'
06/05/2021 Search for DDL sources with name and/or template 1

when _orderItemStatus.lfgsa = 'B' then 'Partially Delv to DC'


when _orderItemStatus.lfgsa = 'C' then 'Fully Delv to DC'
else '' end
as lineStatus,
/* Associations */
_header
}
Created DB view
ZVDC_SOITEM
Referenced DDL Sources [entity] [view]
I_DIVISIONTEXT I_DIVISIONTEXT ISDDIVISIONTEXT
I_PLANT I_PLANT IPLANT
I_SHIPPINGPOINTTEXT I_SHIPPINGPOINTTEXT ISDSHIPPINGPNTT
ZVCC_SALESORDER ZVCC_SALESORDER ZVDC_SALESORDER
ZVC_SALESORDERITEM ZVC_SALESORDERITEM ZVD_SOITEM
Referenced tables or non-CDS views
CEPCT
KNA1
T683V
TVAGT
VBAP
VBRP
VBUP

ZVCC_SO_PARTNER A MALLAJ8 03/10/2020 21:36:56


//---------------------------------------------------------------------*
// Object Id : SDD0017 / ECR202000010 *
// Author : Jay Malla *
// Creation Date : 01-Feb-2020 *
// Description : Sales Order Partner Consumption View *
// *
// Transport No. : DR1K9B6438 *
//---------------------------------------------------------------------*
@AbapCatalog.sqlViewName: 'ZVDC_SO_PARTMER'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales Order Partner Consumption View'
//@OData.publish: true
define view ZVCC_SO_PARTNER as select from ZVC_SO_PARTNER
{
key ZVC_SO_PARTNER.vbeln as orderNumber,
key ZVC_SO_PARTNER.posnr as itemNumber,
key ZVC_SO_PARTNER.parvw as partnerFunction,
Customer,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.title as title,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.partnerFunctionDescription as partnerFunctionDescription,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.name1 as name1,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.name2 as name2,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.name3 as name3,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.name4 as name4,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.street as street,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.str_suppl1 as street2,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.str_suppl2 as street3,
06/05/2021 Search for DDL sources with name and/or template 1

@ObjectModel.readOnly: true
ZVC_SO_PARTNER.city1 as city,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.region as region,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.post_code1 as postalCode,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.country as country,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.time_zone as time_zone,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.tel_number as telephoneNumber,
@ObjectModel.readOnly: true
ZVC_SO_PARTNER.tel_extens as telephoneExtension
}
Created DB view
ZVDC_SO_PARTMER
Referenced DDL Sources [entity] [view]
ZVC_SO_PARTNER ZVC_SO_PARTNER ZVD_SO_PARTNER

ZVC_CUSTOMER_VH A MALLAJ8 03/29/2020 15:51:33


//---------------------------------------------------------------------*
// Object Id : SDD0017 / ECR202000010 *
// Author : Jay Malla *
// Creation Date : 01-Feb-2020 *
// Description : Customer Value Help CDS View *
// *
// Transport No. : DR1K9B6438 *
//---------------------------------------------------------------------*
@AbapCatalog.sqlViewName: 'ZVCustVH'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Cutomer value help'
@Search.searchable: true
define view ZVC_CUSTOMER_VH as select from kna1
inner join knvv on kna1.kunnr = knvv.kunnr
inner join t077x
on kna1.ktokd = t077x.ktokd
and t077x.spras = 'E'
{
@Search.defaultSearchElement: true
@Search.fuzzinessThreshold: 0.8
key kna1.kunnr ,
@EndUserText.label: 'SOrg'
key knvv.vkorg,
@EndUserText.label: 'DC'
key knvv.vtweg,
kna1.sortl,
kna1.name1,
kna1.ktokd,
@EndUserText.label: 'Acct grp name'
@Consumption.filter.hidden: true
t077x.txt30,
kna1.stras,
kna1.ort01,
kna1.regio,
kna1.pstlz,
kna1.land1
}
Created DB view
ZVCUSTVH
Referenced tables or non-CDS views
06/05/2021 Search for DDL sources with name and/or template 1

KNA1
KNVV
T077X

Number of sources found: 4

R3TR DDLS ZVCC_SALESORDER


R3TR DDLS ZVCC_SALESORDERITEM
R3TR DDLS ZVCC_SO_PARTNER
R3TR DDLS ZVC_CUSTOMER_VH

You might also like