I_COMMODITYSUBACCOUNTTP
Commodity Subaccount Transactional View
I_COMMODITYSUBACCOUNTTP is a CDS View in S/4HANA. Commodity Subaccount Transactional View. 1 CDS views read from this table.
CDS Views using this table (1)
| View | Type | Join | VDM | Description |
|---|---|---|---|---|
| C_CommoditySubAccountTP | view | from | CONSUMPTION | Commodity Subaccount |
@AbapCatalog.sqlViewName : 'ICMMDTYSUBACCTTP'
@AbapCatalog.compiler.compareFilter : true
@AbapCatalog.preserveKey : true
@AccessControl.authorizationCheck : #CHECK
@EndUserText.label : 'Commodity Subaccount Transactional View'
@VDM.viewType : #TRANSACTIONAL
-- Business Object Model for Commodity Subaccount
@ObjectModel: {
transactionalProcessingEnabled : true,
compositionRoot : true,
writeActivePersistence : 'CMMFSA_D_SUBACCT',
createEnabled : true,
updateEnabled : 'EXTERNAL_CALCULATION',
deleteEnabled : 'EXTERNAL_CALCULATION',
usageType: {
serviceQuality : #B,
sizeCategory : #M,
dataClass : #MIXED
},
modelCategory : #BUSINESS_OBJECT,
semanticKey : ['COMMODITYSUBACCOUNT'],
alternativeKey: [{
id : 'COMMODITYSUBACCOUNT',
uniqueness : #UNIQUE_IF_NOT_INITIAL,
element : ['COMMODITYSUBACCOUNT']
}]
}
-- Transactional view for Commodity Subaccount
define view I_CommoditySubAccountTP
as select from I_CommoditySubAccount
-- To get Recent Change Time Interval
left outer join I_CmmdtyDrvtvOrdTrdExecRecent as ExecRecent on ExecRecent.SemanticObjectName = 'CommoditySubAccount'
-- Extension View for Free Characteristics
association [1..1] to E_CommoditySubAccount as _Extension on $projection.CommoditySubAccountUUID = _Extension.CommoditySubAccountUUID
{
key I_CommoditySubAccount.CommoditySubAccountUUID,
@ObjectModel.readOnly: true
I_CommoditySubAccount.CommoditySubAccount,
@ObjectModel.mandatory: true
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
I_CommoditySubAccount.CommoditySubAccountName,
@ObjectModel.readOnly: true
I_CommoditySubAccount.CmmdtySubAccountStatus,
@ObjectModel.readOnly: true
I_CommoditySubAccount.CmmdtySubAccountStatusReason,
@ObjectModel.mandatory: true
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
I_CommoditySubAccount.CompanyCode,
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
I_CommoditySubAccount.FuturesAccount,
@ObjectModel.mandatory: true
I_CommoditySubAccount.Commodity,
@ObjectModel.mandatory: true
I_CommoditySubAccount.MarketIdentifierCode,
@ObjectModel.mandatory: true
I_CommoditySubAccount.DerivativeContrSpecification,
I_CommoditySubAccount.ReferenceBrokerAccount,
@ObjectModel.readOnly: true
I_CommoditySubAccount.Portfolio,
I_CommoditySubAccount.ProfitCenter,
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
I_CommoditySubAccount.Counterparty,
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
I_CommoditySubAccount.CommodityDerivativeBroker,
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
I_CommoditySubAccount.CmmdtySubAcctClearingAccount,
@ObjectModel.readOnly: 'EXTERNAL_CALCULATION'
I_CommoditySubAccount.CommoditySubAccountClearingKey,
I_CommoditySubAccount.CmmdtySubAccountIsBlocked,
@ObjectModel.readOnly: true
I_CommoditySubAccount.CreatedByUser,
@ObjectModel.readOnly: true
I_CommoditySubAccount.CreationDateTime,
@ObjectModel.readOnly: true
I_CommoditySubAccount.LastChangedByUser,
@ObjectModel.readOnly: true
I_CommoditySubAccount.LastChangeDateTime,
@ObjectModel.readOnly: true
case
when ExecRecent.CmmdtyDrvtvOrdTrdExecRecentTme >=
tstmp_seconds_between( I_CommoditySubAccount.LastChangeDateTime,
// Current System Time Stamp
dats_tims_to_tstmp(
// Current System Date
tstmp_to_dats( tstmp_current_utctimestamp(),
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL' ),
// Current System Time
tstmp_to_tims( tstmp_current_utctimestamp(),
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL' ),
abap_system_timezone( $session.client,'NULL' ),
$session.client,
'NULL' ) ,
'NULL' )
then '3' // Default Color
else '0' // Higlighted green
end as CmmdtyDrvtvOrdTrdExecIsRecent
}