15 lines
606 B
Plaintext
15 lines
606 B
Plaintext
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
|
@EndUserText.label: 'Order totals'
|
|
define view entity {{P}}I_ORDER_TOTAL
|
|
as select from {{p}}ord as head
|
|
inner join {{p}}itm as item on item.order_id = head.order_id
|
|
{
|
|
key head.order_id as order_id,
|
|
head.customer as customer,
|
|
count( * ) as item_count,
|
|
sum( cast( item.quantity as abap.dec( 10, 0 ) ) * item.price ) as total_amount
|
|
}
|
|
group by
|
|
head.order_id,
|
|
head.customer
|