Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

In Webi there are multiple way in which you can change the format of the displayed date and time field according to requirement .

There are some date format which are available in Webi . Please note that it is case sensitive so it will make a difference if you write Ddd and DDD.

Please see the below usage of Format for more understanding :

Input dateString date formatformulaoutput
25/09/2013dFormatDate(datefield(); "d" )25
25/09/2014ddFormatDate(datefield(); "dd" )25
25/09/2015DddFormatDate(datefield(); "Ddd" )Wed
25/09/2016DDDFormatDate(datefield(); "DDD" )WED
25/09/2017DdddFormatDate(datefield(); "Dddd" )Wednesday
25/09/2018DDDDFormatDate(datefield(); "DDDD" )WEDNESDAY
25/09/2019Dddd ddFormatDate(datefield(); "Dddd dd" )Wednesday 25
25/09/2020MFormatDate(datefield(); "M" )9
25/09/2021MMFormatDate(datefield(); "MM" )09
25/09/2022MmmFormatDate(datefield(); "Mmm" )Sep
25/09/2023MmmmFormatDate(datefield(); "Mmmm" )September
25/09/2024yyFormatDate(datefield(); "yy" )13
25/09/2025yyyyFormatDate(datefield(); "yyyy" )2013
25/09/2026Dddd dd Mmmm yyyyFormatDate(datefield(); "Dddd dd Mmmm yyyy" )Wednesday 25 september 2013
25/09/2027h:mm:ssFormatDate(datefield(); "h:mm:ss" )11:09:08
25/09/2028hh:mmFormatDate(datefield(); "hh:mm" )11:09
25/09/2029hh:mm:ssFormatDate(datefield(); "hh:mm:ss" )11:09:08
25/09/2030dd/MM/yyyy hh:mm:ssFormatDate(datefield(); "dd/MM/yyyy hh:mm:ss" )25/09/2013 11:09:08
25/09/2030dd/MM/yyyy hh:mm:ss AM (or PM)FormatDate(datefield(); "dd/MM/yyyy hh:mm:ss a" )25/09/2013 11:09:08 PM
25/09/2030dd/MM/yyyy HH:mm:ssFormatDate(datefield(); "dd/MM/yyyy HH:mm:ss")25/09/2013 23:09:08

These are some standard formula which we can use to get the desire format. Apart form this we may have date and time functions in formula editor which we can use according to usage to achieve desire format.

like in formula editor you will find in "Year" which will return year in a Date , "MonthNumberOfYear" it will return the number in a date , "DayNumberOfYear" returns the day number in a year etc.

Problem statement :

I have requirement to provide the report in up-loadable date and time format . That means, date in yyyymmdd format and time in hhmmss format.

To achieve the requirement of date format we can use the following formula in Webi :

FormatNumber(Year(Date field()); "0000")+FormatNumber(MonthNumberOfYear([Planned Call Date]);"00" )+FormatNumber(DayNumberOfYear([Planned Call Date]); "00") .

So, for the input date for eg :"25/09/2013" the formula gives the output as "20130925".

Now to for the time format i went on the logic to convert it to date using function "ToDate" and then use "FormatDate" function.

Below is the output which i got : 1st field is the time field, 2nd is after applying formula to convert to date field and the 3rd one is after formatting of date field :

So formula will throw error for the time 15:25:23 , because it is unable to convert it to date format. For the other time its working fine and formatting is done accordingly.

Now, if you see the time filed format (HH:MM:SS) and require format of time (HHMMSS) , we can achieve this by removing the colon(:) from the time field.

There is function in BO formula editor called "Replace" which replaces the part of string with another string.

so formula = Replace([Time field] ; ":";"" ) will replace the ":" with blank .

There are so many functions in the formula editor to make the job easy, we have to be aware of working and functionality of formula.

66 Comments
Labels in this area