How to convert DATE variable to CHAR variable
dear all,
How to convert DATE variable to CHAR variable
thanq
Depending on your final goal here are 2 options.
DATA: datein TYPE d.
DATA: dateout(10) TYPE c.
DATA: dateout2(8) TYPE c.
datein = sy-datum.
WRITE datein TO dateout MM/DD/YYYY.
dateout2 = datein.
WRITE:/ datein, dateout, dateout2.
and the output
05022008 05/02/2008 20080502
Similar Messages
-
How to convert data type while using @variable function
Hi Gurus,
I have a query.
i have created a Derived Table and the statement is given below.
select 1 as SENSITIVITY_LEVEL,1 as SUBSENSITIVITY,@variable('US_T') as NITEMS, ...........
here in @variable('US_T') "US_T" is hard coded value. I want to change to data type of hard coded value as numeric or integer
i am using sap BI 4.0 universe design tool.
Thanks in Advance.
Regards,
JeetHi Jeet,
Since it is text you can't convert into number.
Can you please let mw know the exact requriement of yours?
why you need this
Thanks,
Swapnil -
How to use data function using characterstics variable for calculation on
how to use data function using characterstics variable for calculation on attribute as key figure
Hi Gayatri
Did you not see my answer for CASE because CASE does indeed offer the use of the BETWEEN clause, but DECODE does not. Let me give you a little synopsis of DECODE.
In its most simple form it takes 4 values and looks like this: DECODE(A, B, C, D)
This essentially means, IF A = B THEN C ELSE D
The trick to solving BETWEEN in a DECODE is to work out algoriths where A = B. Because we don't know how many values are between 00 and 99, although I could guess there were 100 we could of course have 100 parts in the DECODE but that would be awful. How about if we look at it another way and say this:
IF PART_NUMBER < 'SDK00' THEN pay_amount
ELSE IF PART_NUMBER > 'SDK99' THEN pay_AMOUNT
ELSE pay_amount + 100
This statement only had 2 hard coded values, but how to make DECODE work with less than? Easy, we use the LEAST function. The LEAST function takes 2 values and returns the one with the lowest value. So I use LEAST(PART_NUMBER, 'SDK00') then whenever the PART_NUMBER is lower than SDK00 it will be true. A similar situation exists for the opposite function GREATEST. Putting all of this together then, you can do this:
DECODE(PART_NUMBER, GREATEST(PART_NUMBER, 'SDK00'), DECODE(PART_NUMBER, LEAST(PART_NUMBER, 'SDK99'), PAY_AMOUNT * 100, PAY_AMOUNT), PAY_AMOUNT)
In English this can be read as follows:
IF the PART_NUMBER is greater than or equal to SDK00 and the PART_NUMBER is less than or equal to SDK99 THEN PAY_AMOUNT x 100 ELSE 0
Best wishes
Michael -
How to convert date dd.mm.yyyy TO Month ddth YYYY?
hi friends,
how to convert date into this format.
ex:
date : 04.11.2008
has to convert as
October 04th, 2008
th has to be set SUPERSCRIPT.
Plz any helps....
Regards,
Shankar.check this..FM
CONVERT_DATE_TO_EXTERNAL
or we can do this using split or concatenate functions like below
*CALCULATING THE MONTH FOR THE BODY OF THE EMAIL MSG
IF GD_EBODY_BB = '01' .
GD_EBODY_BB = 'January' .
ELSEIF GD_EBODY_BB = '02' .
GD_EBODY_BB = 'February' .
ELSEIF GD_EBODY_BB = '03' .
GD_EBODY_BB = 'March' .
ELSEIF GD_EBODY_BB = '04' .
GD_EBODY_BB = 'April' .
ELSEIF GD_EBODY_BB = '05' .
GD_EBODY_BB = 'May' .
ELSEIF GD_EBODY_BB = '06' .
GD_EBODY_BB = 'June' .
ELSEIF GD_EBODY_BB = '07' .
GD_EBODY_BB = 'July' .
ELSEIF GD_EBODY_BB = '08' .
GD_EBODY_BB = 'August' .
ELSEIF GD_EBODY_BB = '09' .
GD_EBODY_BB = 'September' .
ELSEIF GD_EBODY_BB = '10' .
GD_EBODY_BB = 'October' .
ELSEIF GD_EBODY_BB = '11' .
GD_EBODY_BB = 'November' .
ELSEIF GD_EBODY_BB = '12' .
GD_EBODY_BB = 'December' .
ENDIF .
*ATTACHMENT SUBJECT LINE MODIFICATION
IF GD_EBODY_CC = '01'.
CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
ELSEIF GD_EBODY_CC = '02' .
CONCATENATE GD_EBODY_CC 'nd' INTO GD_EBODY_CC .
ELSEIF GD_EBODY_CC = '03' .
CONCATENATE GD_EBODY_CC 'rd' INTO GD_EBODY_CC .
ELSEIF GD_EBODY_CC = '31'.
CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
ELSEIF GD_EBODY_CC = '21'.
CONCATENATE GD_EBODY_CC 'st' INTO GD_EBODY_CC .
ELSE .
CONCATENATE GD_EBODY_CC 'th' INTO GD_EBODY_CC .
ENDIF .
regards
ansumesh
Edited by: Ansumesh Kumar Samal on Nov 4, 2008 9:02 AM -
How to Convert Date (DD.MM.YYYY) to be just DD
Hi experts,
I have no idea how to convert Date format (DDMMYYYY) to be just DD.
Example:
I have date: 31.10.2009
now i just want to show in report as 31.
I just known if we just want to show month only, we could use the 0CALMONTH2. but how if i need the day only?
Are there any way, either in query (BEx) or modeling (Routine/Formula in Update Rules or Transfer Rules) which could fulfill the requirement?
Many thanks..
Warm Regards,
TikaHi,
go through the link below and modify according to your requirement
Date conversion from YYYYMMDD to DD.MM.YYYY
Regards,
Marasa. -
How to convert date format dd.mm.yy into yyyymmdd?
Hello experts,
how to convert date format dd.mm.yy into yyyymmdd?
Thanx
AxelHi
go through these previous threads on similar question
https://forums.sdn.sap.com/click.jspa?searchID=673529&messageID=1763194
Date Conversion in Flat File
converting the DATE(yyyymmdd) into MONTH(yyyymm) format
Date Format Conversion from MM.DD.YYYY to YYYYMMDD
gives clear idea
Reagrds
Kiran
Message was edited by:
ravi kiran naalla -
How to convert Date format into day in ssrs reports?
Hi
How to convert date format into day?
10/01/2010 as like Monday like that?=weekdayname(datepart("w",Fields!mydate.Value))
-Vaibhav Chaudhari -
How to Convert Date to Month in Database which is pointing to EBS, Not DWH.
Hi Friends,
We are planning to create reports in OBIEE and the Source is EBS. That means, we don’t want to depends on Datawarehouse and Informatica and OBIApps. We just create some reports and they are pointing to EBS database.
For testing purpose, we have taken one HR Report and it containsthe below columns:
Month (Dim)
Revenue Per Employee Headcount (Fact)
Average Cost per Active Workforce Headcount (Fact)
In my little investigation, we found that Revenue column is coming from EBS: GL_BALANCES. And we configured W_Day_D base table in DAC as there is no Month column in EBS (Not sure).
*** Coming to my problem, how can I call Month column in my database pointed to EBS. How to convert Date to Month in my database.
I could be wrong but anyone please look into this issue.. How can I create columns for that exact OBI report in EBS database instead of DwH.
Thanks in Advance..
Raghu NagadasariHi Veeresh,
You are right. Here, no need of using W_DAY_D table, but, we need all the stuff from the table and to explain my problem i have taken that table as an example. Now, we ran scripts for W_MONTH_D and W_DAY_D tables with EBS columns. So, we are getting data for the tables. In the same manner we have to create scripts for the below tables.
W_GL_ACCOUNT_D
W_GL_OTHER_F
W_STATUS_D
W_MCAL_DAY_D
W_EMPLOYMENT_STAT_CAT_D
W_WRKFC_BAL_A
W_DAY_D (Completed)
W_MONTH_D (Completed)
But, we are not aware of EBS Tables and their columns much. So, we are back tracing from RpD --> DAC --> Info --> EBS for each and every column and its taking much time.
So, if anyone of you facing the same issue, please share the EBS tables for the corresponding OBI tables, which are mentioned above. -
How to convert date (dd/mm/yyyy) to week no. calendar?
hi all,
I have a question about if user enters 12/12/2004(dd/mm/yyyy), which week is that? I just know week no. should from 01 to no more than 53. How to convert date to week no.?
Thanksselect to_char(sysdate,'IW'),to_char(sysdate,'wW') from dual;
for IW, the week 2 starts on the first monday after 1.Jan, for WW, the week 2 starts on 8. Jan.
HTH
Laurent Schneider
OCM DBA -
How to convert date format to MM/DD/YYYY
Hi,
How to convert date format to MM/DD/YYYY.
Thanks,
Senthilhi,
tri with this function module
data :l_date(10) type c
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
DATE_INTERNAL = SY-DATUM
IMPORTING
DATE_EXTERNAL = l_date.
this function module converts date from 20050601 to external format which is specified in user profile
cheers,
sasi -
How to convert date from ccyymm format to mmddyy
hi,
How to convert date from ccyymm format to mmddyyPlease don't multipost. This question has been answered in your first post.
How to convert date to ccyymm format
Regards,
Jo -
How to convert date to ccyymm format
Hi,
How to convert date to ccyymm format.
Thanksdadivela wrote:
Re: How to convert date from ccyymm format to mmddyyI didn't inderstand. Date doesn't have any format. If you have a string in CCYYMM format, you would have to extract the YYMM from the string.
SQL> SELECT SYSDATE,
2 TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
3 SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM
4 FROM DUAL
5 /
SYSDATE DATE_F YYMM
08-JUN-09 210906 0906You can use this string to convert it to date. Note that since DD part of your date was not their in the resultan string, the converted date will fall back to first of the month specified.
SQL> SELECT SYSDATE,
2 TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
3 SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM,
4 TO_DATE (SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3), 'YYMM') conv_Dat
e
5 FROM DUAL
6 /
SYSDATE DATE_F YYMM CONV_DATE
08-JUN-09 210906 0906 01-JUN-09
SQL>Then convert the date into the required format using TO_CHAR Function
SQL> SELECT SYSDATE,
2 TO_CHAR (SYSDATE, 'ccyymm') Date_Fm,
3 SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3) YYMM,
4 TO_DATE (SUBSTR (TO_CHAR (SYSDATE, 'ccyymm'), 3),
5 'YYMM') conv_Date,
6 TO_CHAR(TO_DATE(SUBSTR(TO_CHAR (SYSDATE, 'ccyymm'),3),
7 'YYMM'), 'MMDDYY') New_Format
8 FROM DUAL
9 /
SYSDATE DATE_F YYMM CONV_DATE NEW_FO
08-JUN-09 210906 0906 01-JUN-09 060109
SQL>Hope this helps.
Regarads,
Jo -
How to convert date to milliseconds?
hi,
can anybody tell me how to convert date to milliseconds.
thanks,
ayathasSee milliseconds and time properties:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Date.html -
How to change date format for prentation variable in Formula
Hi experts.._
I need to change date format for presentation variable in formula..
my dashbord date prompt format: mm/dd/yyyy(i have created one presentation variable for this prompt: pv_date)
now i need to show it as : month-dd-yyyy
Thanks in advance
Regards
FrndsHi Kishor...Thanks for reply...
But i need to change my precentation variable date formt...
i need to write one text like: 'Year to dd/month/yy' in one column formula..
So how can i achieve it.. -
How to select data into multiple bind variables
Hi,
I need to load data into multiple bind variable how to do that
As of now i am using this
select a , b into :a, :b from dual
But i want even a to be loaded into both :a and :c also b to be loaded into :b and :d Please suggest
Thanks
Sudhir.Thanks much it worked
Thanks
Sudhir
Maybe you are looking for
-
Drop down list in Table Control - Value disappeared after pressing ENTER
Dear Gurus, I have a problem in one of my development where I used a table control in which one field is a drop down list. I used VRM_SET_VALUES and VRM_GET_VALUES for populating the values from the programand not use any domain level value table for
-
How do I keep my images from moving in browser ?
Can anyone tell me if there is a solution to keeping multiple images from moving as the size of the browser is made larger or smaller. I am in the jewelry business and when I have multiple images, and a customer makes the browser window larger or sm
-
What do I do when I get my iPhone back from the repair center?
What do I do when I get my iPhone back from the repair center?
-
Help with Sony ACDVHD importing
Hi - I'm sure someone's figured this out but....imovie 09 doesn't allow import of my video from my Sony HDR CX500v - I can see the video in the .mts files in the stream folder, but they're grayed out. And when I try to import using the camera, all I
-
Execute Process Task - Error :The process exit code was "2" while the expected was "0".
I am designing a utility which will keep two similar databases in sync. In other words, copying the new data from db1 to db2 and updating the old data from db1 to db2. For this I am making use of the 'Tablediff' utility which when provided with serv