CONCATENATE date and time into a text variable
Hi ABAP Gurus,
I would like to retrieve current system date and time and concatenate into a variable. I would really appreciate if someone could help me. I have the following code and i seem to get some kind of error.
I would like my output to be like:
"22.JUN.2006 Some Text 12:30:22"
Code:
data: emtext like TEMSG-EMTEXT.
data: date_output(50) TYPE C.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
INPUT = SY-DATUM
IMPORTING
OUTPUT = date_output.
SHIFT date_output RIGHT DELETING TRAILING SPACE.
CONCATENATE date_output ': Some Custom Message '
INTO emtext.
Also, is there a function to convert time to text or conversion is not necessary?
Thanks.
Regards,
bw_newbie
Here is something a little closer to your requirement.
report zrich_0001 .
data: date(20) type c,
time(10) type c,
str type string.
data: xT247 type T247.
select Single * into xt247 from t247
where MNR = sy-datum+4(2).
concatenate sy-datum+6(2) xt247-ktx sy-datum(4)
INTO date separated by '.'.
write sy-uzeit to time.
concatenate date 'SomeText' time into str separated by space.
write:/ str.
Regards,
Rich Heilman
Similar Messages
-
Inserting Date and Time into a date field
Okay I am a bit of a Oracle newbie. I am trying to insert the following date and time into a date field and I don't know how to format the second part of the to_Date() function.
Date/Time: 5/29/2003 7:58:45 PM
Thanks,
BrandenI believe you would want
to_date( '5/29/2003 7:58:45 PM', 'MM/DD/YYYY HH:MI:SS AM' )
Note that tahiti.oracle.com has all of Oracle's documentation, including the very useful SQL & PL/SQL reference manuals, available for free.
Justin -
Combining Date and Time into 1 Field
Post Author: Marc Vaccarino
CA Forum: Formula
Hi,
I'm trying to write a formula to combine 2 fields (date and time) into one. I would like it to look like this.
2/12/2007 + 12:00pm = 2/12/2007 12:00pm
Thanks,Post Author: Marc Vaccarino
CA Forum: Formula
Thanks that worked but my problem is currently the date field I'm using has a date and time (12/12/2007 12:00am) and the time field has it as well (12/12/2007 1:45am). I've been going into crystal and clicked on format field and just showing the date and in the time field, just showing time. Then I would extract the report to excel then run another formula to get it to work. I'm looking to automate it a little. Any ideas?? -
Insert date and time into write to spreadsheet
Easy question here
I need save 4 arrays of data and insert the date and time that it was taken (LV 8.6)
for example
9/4/09 10:00:01 AM 4 6 7 2
9/4/09 10:00:02 AM 4 6 7 2
9/4/09 10:00:03 AM 4 6 7 2
9/4/09 10:00:04 AM 4 6 7 2
Any ideas, I can't wire the timestamp or date/time string right into the create array
Thanks
Chris
Solved!
Go to Solution.Ok
the basic problem that I see is the the LabVIEW TimeStamp type is a cluster. Converting it to a dbl gives you a value in seconds elapsed since 1904 Jan 1 12:00AM GMT and, your spreadsheet cannot interprate that (or display that) as a "TIME." So, you want to convert it to a string (easy TS->String check the help for format options) BUT, you might want to pass all of your data as numbers into your spreadsheet so you can post-calculate or graph other outputs vs. TIME! This little chunk of code .....
converts a LV Timestamp to a number that Excel interperates as "the amount of days elapsed since 0 Jan 1900 @ 12:00AM LOCAL." You will need to format the cell in Excel to display it as a date-time But it can be operated on and graphed against with only Excel's limitations (Excel followed the Lotus bug of erroneously assuming 1900 was a leap year, and Leap seconds are unrecognized)
Enjoy!
Message Edited by Jeff Bohrer on 08-06-2009 02:28 PM
Jeff -
Insert current date and time into Oracle date type field
I have a JDBC current date and time insert into Oracle 9i that almost works. It submits the current date and a fixed time into the Oracle date type field. I am using Tomcat 6.0.20.
For example if I insert the data at 7:24:04 PM on Feb 16, 2010 it will insert as: 16-Feb-2010 12:00:00 AM
The date part works but the time always shows 12:00:00 AM no matter what date or time the data is inserted.
Here is what I have for my JDBC inserts and I also tried something with DateFormat:
PreparedStatement ps; Date mydate = new Date(new java.util.Date().getTime()); //insert statement here.... stmt.setDate(1,mydate);
I also tried:
PreparedStatement ps; java.sql.Timestamp mydate = new java.sql.Timestamp(new java.util.Date().getTime()); SimpleDateFormat fmt = new SimpleDateFormat(.... //insert statement here.... ps.setTimestamp(1,fmt.format(mydate));
Both keep submitting the date into Oracle as 16-Feb-2010 12:00:00 AM
Anyway to get the current date and time? For example if I insert the data at 7:24.04 pm today it should show as 16-Feb-2010 07:24.04 PM in Oracle.sportsMarkr wrote:
Date mydate = new Date(new java.util.Date().getTime());Please see the javadocs for java.sql.Date and note the part that says "...to zero"
[http://java.sun.com/javase/6/docs/api/java/sql/Date.html]
If you want a date and time then use java.sql.Timestamp. -
Getting user name, date and time into 1 field
Hi All,
I have to add a new field in a customising include of AUFK table. This field should have user name, date and time. How do I store all these values in a single field of the table? Please help.Ok Thanks all. Will try your suggestions. But there is one problem. As i have already mentioned that i will have to display this detail in one field of the table control, The format of display is: user name should be seen above and the date and time separated by space should be displayed below the name. How can i ultimately display this in the table control. Do i have to create 2 different fields (one for name and other for date and time) in the AUFK table or is there any other solution?
Thanks -
How to concatenate date and time after a logical file in application server
Hi Experts ,
I have a requirement that goes like this : I have a job that runs parallelly with 10 different variants at the same time. Each job will write the data into a file in the application server, since the jobs run parallelly there is a chance of the file being over-written and hence we have decided to concatenate time and date at the end of the file so that the file does not get over-written. Can someone please let me know how to incorporate this change.
Thanks & Regards,
Balaji.KHi Balaji.
Use CONCATENATE functionality.
A sample code snippet for your reference :-
CONCATENATE p_path text-202 c_9 p_name c_9 lv_fcount c_9 lv_date
c_9 lv_time INTO gv_file.
Regards
Abhii -
Doubt in inserting Date and time into the table
Hi i have created a table with two columns "Order_ID" and "Order_date" as
create table test
order_id integer,
order_date date default sysdate
Now i insert one row as
insert into test(order_id) values(1);
now i get the output as
ORDER_ID ORDER_DAT
1 05-JUN-12
But i need to insert the current system time also into the Order_date column.
How can i achieve this ???it works OK for me!
bcm@bcm-laptop:~$ sqlplus user2/user2
SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 4 20:19:57 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
20:19:58 SQL> @test1
20:20:01 SQL> create table test1
20:20:01 2 (
20:20:01 3 order_id integer,
20:20:01 4 order_date date default sysdate
20:20:01 5 );
Table created.
20:20:01 SQL>
20:20:01 SQL> insert into test1(order_id) values(1);
1 row created.
20:20:01 SQL> select * from test1;
ORDER_ID ORDER_DATE
1 2012-06-04 20:20:01
20:20:01 SQL> -
Seperate field containing date and time into two seperate columns
Hi
I have a column which contains entries which are in the format date time i.e. 27/10/2005 07:06:09
however i would like to have these as two seperate columns so the date is in one and the time in another.
how would i go about doing this in pl/sql?im running a query in excel to graph a variable against time, however excel is not storing it correctly so when i try to use string manipulation to put the time on the x axis it's producing a long decimal number instead of the actual time.
i want to keep it in that format but also have it in two seperate columns. when excel makes the graph it will only read the same date over and over it won't get past the date to see the time changes. -
How do I enter in a Date and Time into the InputDate tag
Using the default DataEditComponent.jsp page, I have an entity object with a Date in it. However, when you click on the calendar icon and populate the field with the date you can not add a time. How do you add a time to this field.
Create Date : 2002-08-23 and I would like to input 2002-08-23 16:30
Thanks,Change your domain type for your entity object to Timestamp. You also need to edit your control hints to use a format that includes the time portion. Once this is done, you will be able to edit\update\display the time portion.
-
Convert Local Date and Time into GMT
In Oracle how to convert date & time in GMT. Suppose the input will be local date & time e.g. ‘IN’, ‘15/11/2010 15:20:30’ ( country Code, DD/MM/YYYY Hr:Min:Sec in 24hr format) output should be in GMT format.
I don't think this should be in the OLAP subforum. At least try to look for the correct section before posting next time.
Apart from that, you can try a combination of the From_Tz and Tz_Offset functions.
http://www.techonthenet.com/oracle/functions/from_tz.php
http://www.techonthenet.com/oracle/functions/tz_offset.php
I hope it helps.
Joan -
Getting Date and Time into a single field
Hi,
I am loading from a flat file which has field Start time which comes in the format of MM/DD/YYYY HH:MM:SS ( Hour: Minute: Second). How can i bring this and store this in BW as one single field. Even in the source it is a single field.
I would also need to use this info object as a key in my ODS
Please advise,
Thanks
Rashmi.
Edited by: Rashmi Vellampalli on Oct 8, 2008 7:32 PM>
Rashmi Vellampalli wrote:
> Hi,
>
> I am loading from a flat file which has field Start time which comes in the format of MM/DD/YYYY HH:MM:SS ( Hour: Minute: Second). How can i bring this and store this in BW as one single field. Even in the source it is a single field.
> I would also need to use this info object as a key in my ODS
>
> Please advise,
>
> Thanks
>
> Rashmi.
>
> Edited by: Rashmi Vellampalli on Oct 8, 2008 7:32 PM
You should user an infoObject/field for tyoe CHAR, length 24. Once you read this, in transfer rules, write an ABAP Code to seperate Data, time and AM, PM. Once you read all the characters from your source, its very simple ABAP to seperate them in Transfer Rules.
Uday-Ram Chamarthy -
As of four days ago, the date and time of my text messages does not appear. I don' t know what hapened. I have reset the network settings, but it didn't fix the problem.
Hello andyb4u8,
Thanks for using Apple Support Communities.
For more information on this, take a look at:
iOS: Troubleshooting Messages
http://support.apple.com/kb/TS2755
http://www.apple.com/support/iphone/assistant/calls/
Best of luck,
Mario -
Formatting Date and Time in Smartforms.
Hello,
I'm a newbie and I'm working with smartforms.
My requirement is to get the following format of date and time in a text within a template.
'MMM DD HH:MM'
Like : Jan 01 12:45
I have tried SAPScript Commands like 'SET DATE MASK' but that doesn't appear to work.
Do I have to use a Function Module?
Please help out. A sample code will be appreciated!
Regards & Thanks,
Arun G NairHi,
please see this code
DATA: V_DATE1 TYPE STRING
SELECT SINGLE LTX FROM T247
INTO MONTH_NAME
WHERE SPRAS = SY-LANGU
AND MNR = SY-DATUM+4(2).
CONCATENATE MONTH_NAME SY-DATUM+6(2) DATE1(4)
INTO V_DATE1 SEPARATED BY SPACE. -
How to enter a new Date and Time each day in a Numbers Spreadsheet...
Hi... I have finally decided to move away from Excel and really give Numbers a shot... I have an application where each day I first enter the current date and time into a particular cell of a new row and then I enter some data in cells adjacent (in the same row) as that entered date-time. Then the next day I want to again enter the (new) current date and time and add more data next to that new date-time and so forth day after day... You can't use something as simple as =NOW() because then everyday, ALL of the date-times would change to the current time... Nope, now what I want... I just want to be able to EASILY and QUICKLY enter the current date-time value in one call and then have that specific value stay there forever... In Excel, this is accomplished with the keyboard shortcuts of
<cntl> followed by a semicolon (;) for the date
then enter a single space (for separation of date versus time) followed last by
<command> followed again by a semicolon...
So all together that is,
<cntl><;><sp><command><;>
and that puts something like
4/10/2010 9:49:00 AM
in a single cell...
That's what I now want to be able to do in Numbers...
How do I do that??? Do I use the menubar item "Insert Date and Time" and if so, how exactly do I get the current time to show up in the chosen cell??? With formatting??? Is there a keyboard shortcut method like the one I mentioned that works for Excel?? I've perused the manual and though I found lots on date-time, I didn't see how to do specifically what I want to do... I likely just missed it as surely it must be easy to do...
Any feedback would be much appreciated... thanks... bob...Badunit wrote:
The result of running that script is "UI Enabled = TRUE".
I have cells named by the header values.
This may be the problem.
The script is an old one which deciphered only the letter+digit cell references.
Here is a new version which works with every kind of cell reference.
--[SCRIPT insertDateTime]
Enregistrer le script en tant que Script : insertDateTime.scpt
déplacer l'application créée dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
Placez le curseur dans la cellule qui doit recevoir la date_heure
menu Scripts > Numbers > insertDateTime
La cellule pointée reçoit la date_heure.
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
+++++++
Save the script as a Script : insertDateTime.scpt
Move the newly created application into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
Put the cursor in the cell which must receive the date_time.
menu Scripts > Numbers > insertDateTime
The pointed cell receives the current date_time.
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
Yvan KOENIG (VALLAURIS, France)
2009/03/01
2010/04/11 is now able to treat every kind of cell references
property theApp : "Numbers"
--=====
on run
set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
my doYourDuty(colNum1, rowNum1, tName, sName, dName)
end run
--=====
on doYourDuty(c, r, t, s, d) (*
c = columnIndex
r = rowIndex
t = table's name
s = sheet's name
d = document's name *)
local cdt
set cdt to my cleanThisDate(current date) (* the new date_time as a clean date_time *)
tell application "Numbers" to tell document d to tell sheet s to tell table t
set value of cell r of column c to cdt as text
end tell -- application …
end doYourDuty
--=====
on cleanThisDate(dt)
(* ugly code but once I got date_time with milliseconds so if necessary, I drop them *)
local l
set l to my decoupe(dt as text, ":")
if (count of l) > 3 then set dt to date (my recolle(items 1 thru 3 of l, ":"))
return dt
end cleanThisDate
--=====
on getSelParams()
local r_Name, t_Name, s_Name, d_Name, col_Num1, row_Num1, col_Num2, row_Num2
set {d_Name, s_Name, t_Name, r_Name} to my getSelection()
if r_Name is missing value then
if my parleAnglais() then
error "No selected cells"
else
error "Il n'y a pas de cellule sélectionnée !"
end if
end if
set two_Names to my decoupe(r_Name, ":")
set {row_Num1, col_Num1} to my decipher(item 1 of two_Names, d_Name, s_Name, t_Name)
if item 2 of two_Names = item 1 of two_Names then
set {row_Num2, col_Num2} to {row_Num1, col_Num1}
else
set {row_Num2, col_Num2} to my decipher(item 2 of two_Names, d_Name, s_Name, t_Name)
end if
return {d_Name, s_Name, t_Name, r_Name, row_Num1, col_Num1, row_Num2, col_Num2}
end getSelParams
--=====
set {rowNumber, columnNumber} to my decipher(cellRef,docName,sheetName,tableName)
apply to named row or named column !
on decipher(n, d, s, t)
tell application "Numbers" to tell document d to tell sheet s to tell table t to return {address of row of cell n, address of column of cell n}
end decipher
--=====
set { d_Name, s_Name, t_Name, r_Name} to my getSelection()
on getSelection()
local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
tell application "Numbers" to tell document 1
repeat with i from 1 to the count of sheets
tell sheet i
set x to the count of tables
if x > 0 then
repeat with y from 1 to x
try
(selection range of table y) as text
on error errMsg number errNum
set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
return {theDoc, theSheet, theTable, theRange}
end try
end repeat -- y
end if -- x>0
end tell -- sheet
end repeat -- i
end tell -- document
return {missing value, missing value, missing value, missing value}
end getSelection
--=====
on decoupe(t, d)
local l
set AppleScript's text item delimiters to d
set l to text items of t
set AppleScript's text item delimiters to ""
return l
end decoupe
--=====
on parleAnglais()
local z
try
tell application theApp to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
--[/SCRIPT]
It's available on my idisk :
<http://public.me.com/koenigyvan>
Download :
For_iWork:iWork '09:for_Numbers09:insertDateTime.zip
Yvan KOENIG (VALLAURIS, France) dimanche 11 avril 2010 14:16:41
Maybe you are looking for
-
Overclocking and the MSI K7N2 Delta ILSR
Hi everyone, I wanna overclock my system. But, I've experienced several problems. Problem one: When i try to set my memory timings manual (3-3-3-8) in the BIOS, CPU-Z, Everest etc shows CL2.5.... instead of the CL3.0 that I've selected in the BIOS. T
-
Does Apple Canada have the worst customer support ever?
Yes! Ask me why... I'm posting here a) to warn other Mac users what to expect if you ever need customer support and b) because there's no where you can actually e-mail comments to Apple, and trying to contact customer support has been fruitless (see
-
Using Skype via WiFi in Europe
The Skype app on my Verizon (Droidx) phone will not allow me to access wifi networks. It forces me to use the Verizon network. I understand that. My question, however, is what happens when I take the phone to Europe and try to use Skype via wifi t
-
Video podcast shows up as music podcast
when i downloaded the video podcast off itunes music store,on the itune it shows up as video but in my ipod it wont show up as a video but shows up as musics as in i cant see anything but i can still hear sounds.Does anyone knwo how i can get the pod
-
Help Needed with storing IOS5.0.1 on MacBook???
Can anyone help??? Due to poor WiFi connection an elderly person cannot update their iPad software. I have downloaded IOS 5.0.1 onto my Macbook but need to know where the file is to be stored so that at the weekend when I connect this persons iPad to