P_ProcMonPeriodMonthStart
Process Observer: Month Period Start Date
P_ProcMonPeriodMonthStart is a Composite CDS View that provides data about "Process Observer: Month Period Start Date" in SAP S/4HANA. It reads from 1 data source (I_SAPClient) and exposes 2 fields with key field DummyKey. Part of development package BS_POC_CDS.
Data Sources (1)
| Source | Alias | Join Type |
|---|---|---|
| I_SAPClient | I_SAPClient | from |
Parameters (1)
| Name | Type | Default |
|---|---|---|
| P_MonthsAgo | abap.int4 |
Annotations (7)
| Name | Value | Level | Field |
|---|---|---|---|
| AbapCatalog.sqlViewName | PPOCPERIDMST | view | |
| AbapCatalog.compiler.compareFilter | true | view | |
| AbapCatalog.preserveKey | true | view | |
| AccessControl.authorizationCheck | #NOT_REQUIRED | view | |
| VDM.private | true | view | |
| VDM.viewType | #COMPOSITE | view | |
| ClientHandling.algorithm | #SESSION_VARIABLE | view |
Fields (2)
| Key | Field | Source Table | Source Field | Description |
|---|---|---|---|---|
| KEY | DummyKey | |||
| PeriodStartTimeStamp |
@AbapCatalog.sqlViewName: 'PPOCPERIDMST'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey:true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
@VDM.viewType: #COMPOSITE
@ClientHandling.algorithm: #SESSION_VARIABLE
// calculate a timestamp of now - P_DaysAgo
define view P_ProcMonPeriodMonthStart
with parameters
P_MonthsAgo : abap.int4
as select from I_SAPClient
{
key '1' as DummyKey, //dummy key
// TSTMP_ADD_SECONDS( TSTMP_CURRENT_UTCTIMESTAMP() , $parameters.P_DaysAgo * -86400, 'FAIL') as PeriodStartTimeStamp, //86400 = seconds/day
cast(cast(concat(left(cast(TSTMP_ADD_SECONDS( TSTMP_CURRENT_UTCTIMESTAMP() , cast($parameters.P_MonthsAgo as abap.dec(17,4)) * 30 * -86400, 'FAIL') as abap.char(17) ),6), '01000000') as abap.numc(14)) as abap.dec(15,0) ) as PeriodStartTimeStamp
// CONCAT(LEFT(DATS_ADD_MONTHS( TSTMP_TO_DATS(TSTMP_CURRENT_UTCTIMESTAMP(),abap_system_timezone( $session.client,'NULL' ), $session.client, 'FAIL' ), -$parameters.P_MonthsAgo , 'FAIL') , 6), '01') as PeriodStartDate,
//
// DATS_TIMS_TO_TSTMP(
// cast(
// CONCAT(
// LEFT(
// DATS_ADD_MONTHS(
// TSTMP_TO_DATS(
// TSTMP_CURRENT_UTCTIMESTAMP(), abap_system_timezone(
// $session.client, 'NULL'
// ), $session.client, 'FAIL'
// ), -$parameters.P_MonthsAgo, 'FAIL'
// ), 6
// ), '01'
// ) as abap.dats
// ), cast(
// '000000' as abap.tims
// ), abap_system_timezone(
// $session.client, 'NULL'
// ), $session.client, 'NULL'
// ) as PeriodStartDateTime
}
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