[go: up one dir, main page]

0% found this document useful (0 votes)
247 views17 pages

SAP RAP Purchase Order Management Guide

Uploaded by

ADITYA GUPTA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
247 views17 pages

SAP RAP Purchase Order Management Guide

Uploaded by

ADITYA GUPTA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

UNVEILING THE SAP RAP-BASED PURCHASE ORDER MANAGEMENT APPLICATION .....................

1
DAY 2: CREATE PURCHASE ORDER COMPOSITE CDS VIEW ................................................................................ 1
DATA FLOW DIAGRAM .......................................................................................................................... 1
ZI_ZEKKO_01 ............................................................................................................................... 3
ZI_ZEKPO_01 ............................................................................................................................... 5
ZI_LFA1_01 ................................................................................................................................... 6
ZI_LOGISTICSOVERVIEW .......................................................................................................... 6
ZI_ZBKPF_01 ............................................................................................................................... 6
ZI_ZKONP_01 ............................................................................................................................... 7
ZI_ZKONV_01 ............................................................................................................................... 7
ZI_ZLFM2_01 ................................................................................................................................ 8
ZI_ZMAKT_01 ............................................................................................................................... 8
ZI_ZMARA_01 .............................................................................................................................. 8
ZI_ZSHIPINFO_01 ........................................................................................................................ 9
ZI_ZSTXL_01 ................................................................................................................................ 9
ZI_ZT052_01 ............................................................................................................................... 10
ZI_ZTRANSCHED_01 ................................................................................................................ 10
ZI_ZVBRK_01 ............................................................................................................................. 11
ZI_ZVBRP_01 ............................................................................................................................. 11
ZI_ZWFAPPROVAL_01 ............................................................................................................. 11
ZI_ZEKKONTRACR_01 ............................................................................................................. 12
ZI_ZEKET_01 ............................................................................................................................. 12
ZI_ZBUT000_01.......................................................................................................................... 13
ZI_ZBSET_01 ............................................................................................................................. 13
KEY COMPONENTS: ...................................................................................................................... 14
COMPOSITE VIEW FOR FULL PURCHASE ORDER .......................................................................... 14

Unveiling the SAP RAP-Based Purchase Order Management Application

Day 2: Create Purchase Order Composite CDS View

Part 2 of our SAP RAP saga takes us into the realm of composite CDS views. We're stitching together
the facets of Purchase Order Management—from inception to shipping. With each CDS view, we're
not just building blocks but constructing the backbone for a robust RAP model. Stay tuned as we piece
together the full picture in our upcoming deep dives!

Data Flow Diagram

Prepared by [Link]@[Link]
Table for CDS View and Custom Tables

Prepared by [Link]@[Link]
Node
Level CDS View Relationship Custom Table Description
Type
Purcchase Order
0 Parent ZI_PurchaseOrder 0 ZEKKO_01
Header
1 Child ZI_PurchaseOrderCondition 1:n ZKONV_01 Po Conditions
1 Child ZI_TaxdetailsPo 1:n ZBSET_01 Tax Details for PO
Represents the buyer
1 Child ZI_BusinessPartner 1:1 ZBUT000_01
master data
1 Child ZI_WFApproval 1:1 ZWFApproval_01 Po Approval Status
1 Parent ZI_PurchaseOrderItem 1:n ZEKPO_01 Purchase Order Item
2 Grandchild ZI_Material 1:1 ZMARA_01 -
Purchase Order
2 Grandchild ZI_PODeliverySchedule 1:n ZEKET_01
Schedule Lines
2 Grandchild ZI_POItemText 1:n ZSTXL_01 Po Item Text
3 Leaf ZI_MaterialPricing 1:1 KONP Leaf Node
3 Leaf ZI_MaterialDescription 1:1 MAKT Leaf Node
1 Parent ZI_Supplier - LFA1 Supplier(Buyer)
2 Child ZI_SupplierEvaluation 1:n ZLFM2_01 Supplier Evaluation
2 Child ZI_SupplierContract 1:n ZEKKONTRACT_01 Supplier Contracts
Representing logistics
1 Parent ZI_LogisticsOverview - Custom CDS View
processing
2 Child ZI_ShippingInformation 1:n Standard tables Related to shipping

Related to
2 Child ZI_TransportationScheduling 1:n Standard tables
transportation

Financial Document
1 Parent ZI_AccountingDocumentHeader - ZBKPF_01
Header
2 Child ZI_BillingHeader 1:n ZVBRK_01 Billing Header
2 Child ZI_BillingItem 1:n ZVBRP_01 Billing Item
2 Child ZI_PaymentTerms 1:n ZT052_01 Payment Condtions

ZI_ZEKKO_01
Create CDS View by clicking ‘Data Definition’

Prepared by [Link]@[Link]
And Click ‘Finish’ .

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Purchase Order Header'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZEKKO_01 as select from zekko_01
{
key purchase_order_id as PurchaseOrderId,
buyer_id as BuyerId,
order_date as OrderDate,
total_amount as TotalAmount,
status as Status,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

After creating a CDS view, activate it and then data preview it

Prepared by [Link]@[Link]
Output

ZI_ZEKPO_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Purchase Order Item'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZEKPO_01 as select from zekpo_01
{
key item_id as ItemId,
purchase_order_id as PurchaseOrderId,
material_id as MaterialId,
quantity as Quantity,
price as Price,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
Prepared by [Link]@[Link]
}
ZI_LFA1_01
@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Supplier Master Data'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_LFA1_01 as select from zlfa1_01
{
key supplier_id as SupplierId,
name as Name,
address as Address,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}
ZI_LOGISTICSOVERVIEW

@[Link]: #NOT_REQUIRED
@[Link]: 'Logistics Overview'
define view entity ZI_LogisticsOverview
as select from zekko_01
association [0..*] to ZI_ZSHIPINFO_01 as _ShippingDetails on $[Link] =
_ShippingDetails.PurchaseOrderId
association [0..*] to ZI_ZTRNSCHED_01 as _TransportScheduling on $[Link] =
_TransportScheduling.PurchaseOrderId
{
key purchase_order_id as PurchaseOrderId,
buyer_id as BuyerId,
order_date as OrderDate,
total_amount as TotalAmount,
status as Status,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt,
//Fields from the associated shipping scheduling
_ShippingDetails.ShippingInfoId as ShippingInfoId,
_ShippingDetails.ShippingMethod as ShippingMethod,
_ShippingDetails.EstimatedDeliveryDate as EstimatedDeliveryDat,

// Fields from the associated transport scheduling


_TransportScheduling.TransportId,
_TransportScheduling.TransportMode,
_TransportScheduling.ScheduleDate
}

ZI_ZBKPF_01
@[Link]: [#NONE]
Prepared by [Link]@[Link]
@[Link]: #NOT_REQUIRED
@[Link]: 'Financial Document Header'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZBKPF_01 as select from zbkpf_01
{
key financial_doc_id as FinancialDocId,
document_date as DocumentDate,
posting_date as PostingDate,
document_type as DocumentType,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZKONP_01
@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Material Pricing Condtions'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZKONP_01 as select from zkonp_01
{
key pricing_id as PricingId,
material_id as MaterialId,
price as Price,
currency as Currency,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}
ZI_ZKONV_01
@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Conditions (Pricing/Dsicounts) for PO'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZKONV_01 as select from zkonv_01
{
key condition_id as ConditionId,

Prepared by [Link]@[Link]
purchase_order_id as PurchaseOrderId,
condtion_type as CondtionType,
condition_value as ConditionValue,
currency as Currency,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}
ZI_ZLFM2_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Supplier Evaluation Data'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZLFM2_01 as select from zlfm2_01
{
key evaluation_id as EvaluationId,
supplier_id as SupplierId,
evaluation_score as EvaluationScore,
evaluation_date as EvaluationDate,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}
ZI_ZMAKT_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Material Description'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZMAKT_01 as select from zmakt_01
{
key material_id as MaterialId,
key language as Language,
description as Description,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}
ZI_ZMARA_01
@[Link]: [#NONE]
Prepared by [Link]@[Link]
@[Link]: #NOT_REQUIRED
@[Link]: 'Material Information'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZMARA_01 as select from zmara_01
{
key material_id as MaterialId,
description as Description,
material_type as MaterialType,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZSHIPINFO_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Shipping Information'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZSHIPINFO_01 as select from zshipinfo_01
{
key shipping_info_id as ShippingInfoId,
purchase_order_id as PurchaseOrderId,
estimated_delivery_date as EstimatedDeliveryDate,
shipping_method as ShippingMethod,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZSTXL_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Text for Purchase Order Items'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZSTXL_01 as select from zstxl_01

Prepared by [Link]@[Link]
{
key item_id as ItemId,
text as Text,
language as Language,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZT052_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Payment Conditions'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZT052_01 as select from zt052_01
{
key payment_condition_id as PaymentConditionId,
description as Description,
payment_terms as PaymentTerms,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZTRANSCHED_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Transportation Scheduling'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZTRNSCHED_01 as select from ztrnsched_01
{
key transport_id as TransportId,
purchase_order_id as PurchaseOrderId,
schedule_date as ScheduleDate,
transport_mode as TransportMode,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

Prepared by [Link]@[Link]
ZI_ZVBRK_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Billing Document Header'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZVBRK_01 as select from zvbrk_01
{
key billing_document_id as BillingDocumentId,
financial_doc_id as FinancialDocId,
billing_date as BillingDate,
total_amount as TotalAmount,
currency as Currency,
created_by as CreatedBy,
created_at as CreatedAt
}

ZI_ZVBRP_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Billing Document Item'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZVBRP_01 as select from zvbrp_01
{
key billing_document_id as BillingDocumentId,
material_id as MaterialId,
quantity as Quantity,
unit_price as UnitPrice,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZWFAPPROVAL_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Workflow Approval for PO'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,

Prepared by [Link]@[Link]
dataClass: #MIXED
}
define view entity ZI_ZWFAPPROVAL_01 as select from zwfapproval_01
{
key approval_id as ApprovalId,
purchase_order_id as PurchaseOrderId,
approver as Approver,
approval_status as ApprovalStatus,
approval_date as ApprovalDate,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZEKKONTRACR_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Supplier Contracts Data'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZEKKONTRACT_01 as select from zekkontract_01
{
key contract_id as ContractId,
supplier_id as SupplierId,
contract_terms as ContractTerms,
start_date as StartDate,
end_date as EndDate,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZEKET_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Purchase Order Schedule Lines'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZEKET_01 as select from zeket_01
{
key purchase_order_id as PurchaseOrderId,
key schedule_line as ScheduleLine,

Prepared by [Link]@[Link]
delivery_date as DeliveryDate,
quantity as Quantity,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZBUT000_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Business Partner'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZBUT000_01 as select from zbut000_01
{
key partner_id as PartnerId,
name as Name,
address as Address,
contact_details as ContactDetails,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

ZI_ZBSET_01

@[Link]: [#NONE]
@[Link]: #NOT_REQUIRED
@[Link]: 'Tax Details'
@[Link]: true
@[Link]:{
serviceQuality: #X,
sizeCategory: #S,
dataClass: #MIXED
}
define view entity ZI_ZBSET_01 as select from zbset_01
{
key tax_id as TaxId,
purchase_order_id as PurchaseOrderId,
tax_code as TaxCode,
tax_amount as TaxAmount,
created_by as CreatedBy,
created_at as CreatedAt,
last_changed_by as LastChangedBy,
last_changed_at as LastChangedAt
}

Prepared by [Link]@[Link]
Key Components:

Core Entity (ZI_ZEKKO_01): This is the central entity of our application, representing the Purchase
Order Header. It holds essential information about each purchase order, like the order ID, buyer ID,
order date, total amount, etc.

Associations:
item-Level Views (ZI_ZEKPO_01, ZI_ZEKET_01): These associations link the purchase order with
its line items and schedule lines, detailing the materials ordered, quantities, delivery dates, and more.

Supplier-Related Views (ZI_LFA1_01, ZI_ZEKKONTRACT_01, ZI_ZLFM2_01): These provide


insights into supplier details, their contracts, and evaluations, crucial for supplier management.

Logistics and Shipping Views (ZI_ZSHIPINFO_01, ZI_ZTRNSCHED_01): These views manage the
shipping information and transportation scheduling, vital for tracking order fulfillment.

Financial and Billing Views (ZI_ZBKPF_01): This association connects each purchase order with its
related financial documentation for billing and accounting purposes.

Conditional and Approval Views (ZI_ZKONV_01, ZI_ZWFAPPROVAL_01, ZI_ZBSET_01): These


handle various conditions like pricing, discounts, workflow approvals, and tax details associated with
the purchase orders.

Composite View for Full Purchase Order

@[Link]: 'Composite View for Full Purchase Order'


define view entity ZI_POComposite
as select from ZI_ZEKKO_01 as poheader

// Associations to item-level views


association [0..*] to ZI_ZEKPO_01 as _Items on _Items.PurchaseOrderId =
$[Link]
association [0..*] to ZI_ZEKET_01 as _ScheduleLines on _ScheduleLines.PurchaseOrderId =
$[Link]

// Associations to supplier-related views


association [0..1] to ZI_LFA1_01 as _Supplier on _Supplier.SupplierId =
$[Link]
association [0..*] to ZI_ZEKKONTRACT_01 as _SupplierContracts on _SupplierContracts.SupplierId =
$[Link]
association [0..*] to ZI_ZLFM2_01 as _SupplierEvaluations on _SupplierEvaluations.SupplierId =
$[Link]

// Associations to logistics and shipping views


association [0..*] to ZI_ZSHIPINFO_01 as _ShippingInfo on _ShippingInfo.PurchaseOrderId =
$[Link]
association [0..*] to ZI_ZTRNSCHED_01 as _TransportScheduling on
_TransportScheduling.PurchaseOrderId = $[Link]

// Associations to financial and billing views


association [0..1] to ZI_ZBKPF_01 as _FinancialDocument on _FinancialDocument.FinancialDocId
= $[Link]

// Associations to other conditional and approval views

Prepared by [Link]@[Link]
association [0..*] to ZI_ZKONV_01 as _OtherConditions on _OtherConditions.PurchaseOrderId
= $[Link]
association [0..*] to ZI_ZWFAPPROVAL_01 as _Approvals on _Approvals.PurchaseOrderId =
$[Link]
association [0..*] to ZI_ZBSET_01 as _TaxDetails on _TaxDetails.PurchaseOrderId =
$[Link]

{
// Fields from ZI_ZEKKO_01
key PurchaseOrderId,
BuyerId,
OrderDate,
TotalAmount,
Status,
CreatedBy,
CreatedAt,
LastChangedBy,
LastChangedAt,

_Items.ItemId,
_Items.MaterialId,
_Items.Quantity,
// _ItemTexts.Text,
_ScheduleLines.DeliveryDate,
_Supplier.SupplierId,
_Supplier.Name,
_SupplierContracts.ContractId,
_SupplierContracts. ContractTerms,
_SupplierEvaluations.EvaluationId,
_SupplierEvaluations.EvaluationDate,
_SupplierEvaluations.EvaluationScore,
_ShippingInfo.EstimatedDeliveryDate,
_ShippingInfo.ShippingInfoId,
_ShippingInfo.ShippingMethod,
_TransportScheduling.TransportId,
_TransportScheduling.TransportMode,
_TransportScheduling.ScheduleDate,
_FinancialDocument.FinancialDocId,
_FinancialDocument.DocumentDate,
_FinancialDocument.DocumentType,
_FinancialDocument.PostingDate,
_OtherConditions.ConditionId,
_OtherConditions.ConditionValue,
_OtherConditions.CondtionType,
_Approvals.ApprovalDate,
_Approvals.ApprovalId,
_Approvals. Approver,
_Approvals.ApprovalStatus,
_TaxDetails.TaxId,
_TaxDetails.TaxAmount,
_TaxDetails.TaxCode,
_Items,
_ScheduleLines,
_Supplier,

Prepared by [Link]@[Link]
_SupplierContracts,
_SupplierEvaluations,
_ShippingInfo,
_TransportScheduling,
_FinancialDocument,
_OtherConditions,
_Approvals,
_TaxDetails
}

Note:
In this RAP model exercise, I've selectively mapped key tables to demonstrate an example workflow.
As we progress through the exercise, additional tables will be integrated to showcase the full
capabilities of the project.

Output
Run the composite PO

Due to the extensive number of columns in the table, I have provided multiple screenshots to capture
all the output details.

Prepared by [Link]@[Link]
In the first part of our SAP RAP series, we successfully set up our database tables and populated
them with data. In today's installment, we've crafted CDS views for each table and then merged them
into a composite PO CDS view. Stay tuned for our next post, where we'll delve into exposing these
views through the RAP layer. Follow along to see how our Purchase Order Management application
takes shape!!

Prepared by [Link]@[Link]

You might also like