
SAP Online Help 07.09.2004
SAP NetWeaver Visual Composer: User Guide 153
Frequently-Used Dynamic Expressions
The following tables list some of the most frequently-used functions that you may create in the
Expressions Editor. Mathematical and trigonometric functions – such as COS and SIN – are
available in the list of functions (Expression Editor Assistant) as well.
Date and Time Functions
Func-
tion
Descrip-
tion
Syntax Examples
DADD/
TADD
Increases/
decreases
a date/time
value by
the
specified
number of
date units.
DADD(dt,n,uni
t)
TADD
(t,n,unit)
where unit is
one of the
enumerations
listed in Table A
(following)
TADD(@CREATE_TIME,13,’H’)
Adds 13 hours to the value returned. For
example, 10:17:22 would be converted to
23:17:22 (default HH:NN:SS format).
DSTR/
TSTR
Converts a
date or
time object
format to a
defined text
string.
DSTR
(dt,mask)
DSTR (t,mask)
where mask is
one of the
devised from the
set of special
characters listed
in Table B
(following)
DSTR(@DATE_FIELD,’MON DD, YYYY’)
Converts the date value returned to
a string date format. for example,
30.05.2002 would be converted to
May 30, 2002.
DSTR(DADD(@CREATE_DATE,13,’D’),’XML
_DATE
Using the DADD function, this
expression adds 13 days to the
returned date, and then converts
the date format to the XML standard
format. For example, 30.05.2002
would be converted to: 2002-06-12.
DGET
TGET
Returns the
numeric
value of the
selected
part of a
date or
time.
DGET(dt,part)
TGET(t,part)
where part is
one of the
enumerations
listed in Table C
(following)
DGET(@CREATE_DATE,’M’)
Returns only the value of the
specified time unit from within the
date value. For example, 30.05.2002
would return 5, while 27.02.2004
would return 2.
NOW/
TNOW
Returns the
current
date or
time.
NOW()
NOW()
See example in DSUB following.
DSUB/
TSUB
Returns the
difference
between
two dates,
in the
specified
date unit.
DSUB(dt1,dt2,
unit)
TSUB
(t1,t2,unit)
where unit is
one of the
enumerations
listed in Table A
(following)
DSUB(NOW(),@CREATE_DATE,’D’)
Calculates the difference in the
two dates, specified here, in days.
For example, values of 16.09.2004
(today) and 05.8.2004 for these two
fields would return 39.