Skip to Content
0
Former Member
Jun 09, 2011 at 11:35 PM

Date Formula Functions

57 Views

Hello,

I am trying to use a couple of Date Functions in a formula that deals with dates. However, I keep getting a fatal error during the simulated run of the function. I have three date related questions:

1. The first formula function that I want to use is DT_ROUND_TO_LAST in the formula as listed below:

END_OF_CURR_MONTH = DT_ROUND_TO_LAST ( DT_GET_CURRENT_DT () , MON )

The element END_OF_CURR_MONTH is of type "Timepoint" with Timepoint Type = "Date"

In the documentation for the function, MON is a valid unit, however, the system appears to complain about that. I tried entering the unit MON by entering a Unit and a String, but neither worked. The error I get reads:

Fatal error in formula expression: ID (UUID); token FU DT_ROUND_TO_LAST

2. The other date function that I'm having trouble with is DT_ADD_MONTHS in a formula like this:

NEW_DATE = DT_ADD_MONTHS ( DT_GET_CURRENT_DT , 1 )

The error I'm getting reads: Fatal error in formula expression: ID (the UUID); token FU DT_ADD_MONTHS

3. How can I enter a particular date in the formula? Is there a way to enter a date by giving the elements separated by commas where I could enter formulas with one of them? I'm thinking of something like this (Date would be the "function")

New_date = Date (2011, month + 3, 1 )

this formula would represent 5/1/2011 where in this case, the variable month = 2

I am working with SAPKB70207. Any suggestions?