P_EBWIP_PRODUCTIONCOST1
Event-Based Work In Process Production Cost layer 1
P_EBWIP_PRODUCTIONCOST1 is a CDS View in S/4HANA. Event-Based Work In Process Production Cost layer 1. 1 CDS views read from this table.
CDS Views using this table (1)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| P_EBWIP_ProductionCost2 | view | from | COMPOSITE | Event-Based Work In Process Production Cost layer 2 |
@AbapCatalog.sqlViewName: 'PEBWIPPRODC1'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@ClientHandling.algorithm: #SESSION_VARIABLE
@VDM.viewType: #COMPOSITE
@VDM.private: true
define view P_EBWIP_ProductionCost1
with parameters
@Environment.systemField: #SYSTEM_DATE
P_KeyDate : datum,
P_Ledger : fins_ledger
as select from R_ControllingActualLineItem
{
key CompanyCode,
key OrderID,
key OrderItem,
sum( case when PostingDate <= :P_KeyDate then AmountInCompanyCodeCurrency else 0 end ) as AmountInCompanyCodeCurrency,
sum( case when PostingDate <= :P_KeyDate then AmountInGlobalCurrency else 0 end ) as AmountInGlobalCurrency,
sum( case when PostingDate <= :P_KeyDate then AmountInFreeDefinedCurrency1 else 0 end ) as AmountInFreeDefinedCurrency1,
sum( case when PostingDate <= :P_KeyDate then AmountInFreeDefinedCurrency2 else 0 end ) as AmountInFreeDefinedCurrency2,
sum( case when PostingDate <= :P_KeyDate then AmountInFreeDefinedCurrency3 else 0 end ) as AmountInFreeDefinedCurrency3,
sum( case when PostingDate <= :P_KeyDate then AmountInFreeDefinedCurrency4 else 0 end ) as AmountInFreeDefinedCurrency4,
sum( case when PostingDate <= :P_KeyDate then AmountInFreeDefinedCurrency5 else 0 end ) as AmountInFreeDefinedCurrency5,
sum( case when PostingDate <= :P_KeyDate then AmountInFreeDefinedCurrency6 else 0 end ) as AmountInFreeDefinedCurrency6,
sum( case when PostingDate <= :P_KeyDate then AmountInFreeDefinedCurrency7 else 0 end ) as AmountInFreeDefinedCurrency7,
sum( case when PostingDate <= :P_KeyDate then AmountInFreeDefinedCurrency8 else 0 end ) as AmountInFreeDefinedCurrency8,
sum(
case when OriginCtrlgDebitCreditCode = 'L' and TotalQuantity is not initial and
( OrderItem = '0000' or OrderItem = '0001') and TransactionTypeDetermination = 'GBB'
then - TotalQuantity
when OriginCtrlgDebitCreditCode = 'L' and TotalQuantity is initial and
( OrderItem = '0000'or OrderItem = '0001' ) and TransactionTypeDetermination = 'GBB'
then - Quantity
else 0
end ) as ActualOutputQuantity,
sum(
case when OriginCtrlgDebitCreditCode = 'L' and TotalQuantity is not initial and TransactionTypeDetermination = 'GBB' and
( OrderItem = '0000' or OrderItem = '0001') and PostingDate <= :P_KeyDate
then - TotalQuantity
when OriginCtrlgDebitCreditCode = 'L' and TotalQuantity is initial and TransactionTypeDetermination = 'GBB' and
( OrderItem = '0000'or OrderItem = '0001' ) and PostingDate <= :P_KeyDate
then - Quantity
else 0
end ) as CompletedQuantityToDate
}
where
(
AccountAssignmentType = 'OR'
or AccountAssignmentType = 'OP'
)
and(
OrderCategory = '10'
or OrderCategory = '40'
or(
OrderCategory = '05'
and BusinessTransactionCategory <> 'TBCS' // Transaction-Based Split
and BusinessTransactionCategory <> 'EBWP' // WIP
and BusinessTransactionCategory <> 'EBVP' // Variance
and BusinessTransactionCategory <> 'KOAE'
)
)
and ControllingDocument <> ''
and(
OriginCtrlgDebitCreditCode = 'L'
or OriginCtrlgDebitCreditCode = 'A'
)
and SubLedgerAcctLineItemType <> '09101'
and SubLedgerAcctLineItemType <> '09111'
// and PostingDate <= :P_KeyDate
and Ledger = :P_Ledger
group by
CompanyCode,
OrderID,
OrderItem