SRF_Helper_Cut_Decimals
Cuts of decimals from an amount field
SRF_Helper_Cut_Decimals is a CDS View that provides data about "Cuts of decimals from an amount field" in SAP S/4HANA. It reads from 1 data source (I_SAPClient) and exposes 2 fields.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_SAPClient | I_SAPClient | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_Amount | abap.curr( 23,2 ) |
Annotations (8)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | SRFCUTDECIMALS | view | |
| AccessControl.authorizationCheck | #NOT_ALLOWED | view | |
| EndUserText.label | Cuts of decimals from an amount field | view | |
| ClientHandling.type | #INHERITED | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view | |
| ObjectModel.usageType.dataClass | #MIXED | view | |
| ObjectModel.usageType.sizeCategory | #S | view | |
| ObjectModel.usageType.serviceQuality | #X | view |
Fields (2)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| dec230endasP_AmountNoDecimals | ||||
| P_AbsoluteAmountNoDecimals |
@AbapCatalog.sqlViewName: 'SRFCUTDECIMALS'
@AccessControl.authorizationCheck: #NOT_ALLOWED
@EndUserText.label: 'Cuts of decimals from an amount field'
@ClientHandling: { type: #INHERITED, algorithm: #SESSION_VARIABLE }
@ObjectModel.usageType: { dataClass: #MIXED, sizeCategory: #S, serviceQuality: #X }
/*******************************************************************************
* Cuts off the decimals from an amount, i.e. positive amounts are rounded *
* down and negative are rounded up *
*******************************************************************************/
define view SRF_Helper_Cut_Decimals
with parameters
P_Amount : abap.curr( 23,2 )
as select from I_SAPClient //dummy select
{
case $parameters.P_Amount
when abs(:P_Amount ) then cast(floor($parameters.P_Amount) as abap.dec( 23, 0)) // positive
else cast(ceil($parameters.P_Amount) as abap.dec( 23, 0)) // negative
end as P_AmountNoDecimals,
cast(floor(abs($parameters.P_Amount)) as abap.dec( 23, 0)) as P_AbsoluteAmountNoDecimals
}
Learn More
- What Is a CDS View in SAP S/4HANA?
- Types of CDS Views: Basic, Composite, Consumption, and Transactional
- SAP Tables vs CDS Views — Key Differences
- Understanding Data Lineage in SAP S/4HANA
- VDM (Virtual Data Model) in SAP S/4HANA Explained
- CDS View Annotations — A Complete Guide
- CDS View Field Mapping and Associations
- Understanding the SAP S/4HANA Data Model
- CDS View Extensions and Custom Fields in SAP S/4HANA
- Released APIs and Stability Contracts in SAP S/4HANA