P_USERCREATIONTIMESTAMPS

DDL: P_USERCREATIONTIMESTAMPS Type: view_entity Package: SUSR_CONFIG_TOOLS

Retrieve user creation timestamps from change documents

P_USERCREATIONTIMESTAMPS is a CDS View that provides data about "Retrieve user creation timestamps from change documents" in SAP S/4HANA. It reads from 2 data sources (SUIM_CHDOC_USR_HEAD_01, usr02) and exposes 3 fields with key field bname. Part of development package SUSR_CONFIG_TOOLS.

Data Sources (2)

SourceAliasJoin Type
SUIM_CHDOC_USR_HEAD_01 suim_view from
usr02 user_exists inner

Annotations (7)

NameValueLevelField
AbapCatalog.extensibility.extensible false view
AccessControl.authorizationCheck #NOT_REQUIRED view
VDM.private true view
Metadata.ignorePropagatedAnnotations false view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #L view
ObjectModel.usageType.dataClass #MIXED view

Fields (3)

KeyFieldSource TableSource FieldDescription
KEY bname SUIM_CHDOC_USR_HEAD_01 bname
class usr02 class
clientINITIALasTimestampUserCreation
@AbapCatalog:   { viewEnhancementCategory: [ #NONE ]
                , extensibility: { extensible: false  } }
@AccessControl.authorizationCheck: #NOT_REQUIRED
@VDM.private: true
//@EndUserText.label: 'Retrieve user creation timestamps from change documents'

@Metadata.ignorePropagatedAnnotations: false
@ObjectModel.usageType:{
  serviceQuality: #X,
  sizeCategory: #L,
  dataClass: #MIXED
}
//---------------------------------------------------------------------------------

// retrieve user creation date and time from change documents

// convert creation date and time into timestamps

//---------------------------------------------------------------------------------

define view entity P_USERCREATIONTIMESTAMPS
  as select from SUIM_CHDOC_USR_HEAD_01 as suim_view
    inner join   usr02                  as user_exists on  user_exists.bname = suim_view.bname
                                                       and user_exists.erdat = suim_view.chg_date
{
  key suim_view.bname   as bname,
      user_exists.class as class,
      dats_tims_to_tstmp( suim_view.chg_date,          //date

                          max( suim_view.chg_time ),   //time

                          cast('UTC' as abap.char(6)), //no timezoneshift

                          $session.client,             //client

                          'INITIAL' )                  //error returns initial value

                        as TimestampUserCreation
}
where
      suim_view.action                    = 'I'      //created

  and user_exists.usr_created_on_datetime is initial //ignore users where field is already filled

group by
  suim_view.bname,
  user_exists.class,
  suim_view.chg_date