Re: conversion of time

Hi gurus,
I want to print time in hrs:min AM or PM. is there any function module which tells about the AM or PM.
For example i have time as 7:15 (SY-UZEIT) now i also want to add AM with the same.
thanks in advance

DATA: ULTIMO TYPE D.
ULTIMO = SY-DATUM.
ULTIMO+6(2) = '01'.          " = first day of this month
ULTIMO = ULTIMO - 1. " = last day of last month
Here, the last day of the previous month is assigned to the date field ULTIMO.
1. ULTIMO is filled with the present date.
2. Using an offset specification, the day is changed to the first day of the current month.
3. 1 is subtracted from ULTIMO. Its contents are changed to the last day of the previous month. Before performing the subtraction, the system converts ULTIMO to the number of days since 01.01.0001 and converts the result back to a date.
Example of a time calculation:
DATA: DIFF TYPE I,
SECONDS TYPE I,
HOURS TYPE I.
DATA: T1 TYPE T VALUE '200000',
T2 TYPE T VALUE '020000'.
DIFF = T2 - T1.
SECONDS = DIFF MOD 86400.
HOURS = SECONDS / 3600.
The number of hours between 02:00:00 and 20:00:00 is calculated.
1. First, the difference between the time fields is calculated. This is -64800, since T1 and T2 are converted internally into 72000 and 7200 respectively.
2. Second, with the operation MOD, this negative difference is converted to the total number of seconds. A positive difference would be unaffected by this calculation.
3. Third, the number of hours is calculated by dividing the number of seconds by 3600.
The last three lines can be replaced by the following line
HOURS = ( ( T2 - T1 ) MOD 86400 ) / 3600.
Inverted Dates
In some cases (for example, when sorting dates in descending order), it is useful to convert a date from format D to an inverted date by using the keyword CONVERT.
CONVERT DATE <d1> INTO INVERTED-DATE <d2>.
Afterwards, you can convert the inverted data back into a normal date using the statement
CONVERT INVERTED-DATE <d1> INTO DATE <d2>.
These statements convert the field <d1> from the formats DATE or INVERTED-DATE to the formats INVERTED-DATE or DATE and assign it to the field <d2>.
For the conversion, ABAP forms the nine's complement.
DATA: ODATE TYPE D VALUE '19955011',
IDATE LIKE ODATE.
DATA FIELD(8).
FIELD = ODATE.   WRITE / FIELD.
CONVERT DATE ODATE INTO INVERTED-DATE IDATE.
FIELD = IDATE.   WRITE / FIELD.
CONVERT INVERTED-DATE IDATE INTO DATE ODATE.
FIELD = ODATE.   WRITE / FIELD.
Output:
80049488
19955011
19955011

Similar Messages

  • What are the special conversions for time in update rules?

    What are the special conversions for time in update rules?

    Hello,
    Special conversions for time in update rules are automatically conversion rules.
    Example: If the cube contains calendar month and your transfer structure contains date, the date to month is converted automatically.
    Assign points if this helps,
    Regards,
    Jorge Diogo

  • PTO Conversion in Time management

    Hi All,
    I'm trying to convert PTO(Paid Time Off) from Legacy to SAP .
    My question is that in which infotype I should run the conversion program
    is that in 2006(Abscence Quotas) or 2013(Quota Correction).
    Could any body help me on this.
    Thanks,
    Raji

    Hai
    If its a separate quota in ur system, u can give directly in 2006. If u want to update a quota which is already generated then u can go for 2013.
    Manohar

  • Conversion of time format

    conversion of string indicators containing 12Hour -time format into 24hour-time format
    ie  1:35:00 pm(12hour time-format)  to  13:35:00(24-hour format)
    Attachments:
    Doc1.docx ‏46 KB

    priya2207 wrote:
    actually i have taken a numeric control of time- date format in which display format of time is 24-hour type but the requirement is that the numeric control should be converted into string type in which display format is 24-hour type.
    You have two options: Format Date/Time String or Format String.  I prefer Format String since I am usually combining other things.  For the format string, follow formats given in the LabVIEW Help (follow the links I already gave you).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Anyone have rough metrics re. Extended WH Tax conversion run-time?

    Does anyone have any rough statistics regarding re. performance/run-time of the data conversion program that is run when activating extended WH tax in a live company code? Of greatest interest would be some rough numbers for a system with as high a record count as is available.
    Thanks.

    Chris,
    I wanted to reply here on your original thread .  I appreciate your  noting your prior case 10140045 - this appears not to have been routed correctly and was closed out.   We will escalate this situation and ensure follow up.
    I appreciate your speaking up, and your patience.   I really hope we can restore your confidence in Lenovo.
    Mark
    ThinkPads: S30, T43, X60t, X1, W700ds, IdeaPad Y710, IdeaCentre: A300, IdeaPad K1
    Mark Hopkins
    Program Manager, Lenovo Social Media (Services)
    twitter @lenovoforums
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

  • String conversion of time to Java.Sql.Time

    Hello,
    Im developing a servlet based application where I need to take the time from the user in the hh:mm format and then add it to the database ( MS SQL Server 2000) . I do so via a HTML page.
    Now in my servlet I retrieve the value using request.getParameter which gets retrieved as String.So now I need to convert it to the Time format so that I can add it to the DB.
    Can someone please guide me as to how this is done, Ive tried SimpleDateFormat but Im not quite clear with that concept and so I think Ive messed it up. Hence Im not posting anything here.
    Please help me out.
    Thanks in advance.
    null

    String dateStr = "15:00";
    SimpleDateFormat format = new SimpleDateFormat("HH:mm");
    try {
                Date date = format.parse(dateStr);
                System.out.println("date: " + date);
                Time t = new Time(date.getTime());
                System.out.println("date: " + date);
    } catch (ParseException e) {
    }

  • In the mail list pane, 'From' column shows the first sender in a conversation? How to make that the sender of the last mail in the conversation (by time)?

    The first sender in a conversation can be irrelevant after a conversation grows long and I'm more interested in who's active more recently than whoever started the conversation/thread.

    @duggabe, Not actually. That would just sort "threads/conversations" by date. The From column would continue to show the first sender for each thread/conversation.

  • HT201401 When I am having a text conversation some times my bubbles are blue and sometimes they are green-why is that

    When I am having a text conversation sometimes my bubbles are blue and sometimes they are green -why is that

    blue colored bubbles are imessages(ios device to ios device), uses data
    green colored are SMS's(charged by carrier, if you have free SMS's, it should be free too)
    learn more about imessages
    http://www.apple.com/ios/messages/

  • Power Spectrum Density conversion to Time Series Data

    Hi,
    This may seem an odd request but is there a way to convert power spectrum density data back to the time series data that generated it in the first place. I have lost the original time series data but still have the PSD and need the time series to do other analysis.
    Thanks,
    Rhys Williams

    Hate to be the bearer of bad news, but there are an infinite number of time series that will generate a given PSD.  You lose all phase information upon taking the PSD.  For this reason I almost always save time domain data, or at least complex FFT values.  

  • Conversion from Excel time to labview time

    Hello all,
                                       I want to convert the excel time stamp to labview time stamp. Can you all please help me how to do this ?
    In my application labview time is 05-11-12 14:56:00 and its equivalent excel time representation is 41218.6222222222.
    I tried this formula,
    Labview time =  24*3600*(Excel time - 1460) but anwer is wrong.
    Thanks.
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet

    Ok, here's what I found.  The conversion is:  Time Stamp = 86400*(Excel Time - 1462).  But here's the kicker: the timestamp is GMT.  You have to add your time zone offset as well.  I'm in the Eastern Time Zone, so I had to add 5 hours.  I'm not sure what DST will do to this.  I'm sure there's ways around it, I just don't have time to look into it more right now.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Excel Time.png ‏10 KB

  • Function module for Time zone conversion.

    Hi SDN,
    Can any one tell is there any FM for conversion of time from GMT to CET or any other time zone
    Regards,
    Rahul

    Try these function modules
    STU3_ALERTS_CONV_LOCAL_2_UTC   Converts local time to a given timezone
    STU3_ALERTS_CONV_UTC_2_LOCAL   Converts local time to a given timezone
    TZ_LOCATION_TIMEZONE                     Time zones: Determine time zone for a location                                                                          (land, region)

  • My texts aren't working-can't delete old ones, sometimes can open new ones (mostly can't even see them), and unable to open or respond to new conversations

    I have an Iphone 4s with a carrier who doesn't have good signal where I like, and I'm switching over to another carrier this week. My Iphone has been having trouble receiving or sending texts for awhile because of the service provider, but I think this current problem is Apple. I had this issue when I first bought the phone less than a year ago, and it lessened (almost going away completely) for several months after exchanging it for a new phone.
    New messages will still make an alert, but most of the time, I can't see who it's from or what it says-the message screen comes up blank, sometimes with the lines that are normally between texts but still blank. If I can see who it's from, sometimes I can click the new text and it will take me to the "compose new message" screen instead of to the conversation. My new texts will disappear for hours or days at a time and then magically reappear, and I haven't been able to determine a pattern. I don't believe it is from signal strength or Wi-FI issues, because sometimes texts and imessage work perfectly when the phone says I have bad signal and there is no available wi-fi, other times not going through when I have full signal strength and connected to full speed wi-fi.
    Only texts from before the update remain on my phone, even after deleting the same conversations multiple times. I can't read or respond to my new messages.
    Any advice/fixes would be welcome!
    Thanks!

    Are you still dealing with this?
    On number 1, do you mean backup rather than sync?
    I have had times where backup completed but did not backup some databases. Running backup again was the solution. If this is what is happening, reboot the BlackBerry and reboot the computer and try again. If backup actually fails to complete and throws an error, what is the error?
    2. The reboot may resolve the text issue. If not, do a soft reset and try again. http://www.blackberry.com/btsc/KB02141
    - Ira

  • FCP QT Conversion, Why result in wider aspect ratio ??

    When I export "selfcontained" QT from FCP, it is in the same aspect ratio as I see in canvas (4:3), however when I export the same project "using QT conversion", the exported movie file is saved and plays in wider ratio.
    Please help, how could I keep it 4:3?
    Also, I have my frame size set for NTSC DV (3:2), is this correct? I find myself still confused with a question that I posted previously: http://discussions.apple.com/message.jspa?messageID=12554373#12554373
    Any advice, clarification would be appreciated!

    Hi Joe,
    this is helpful, thank you!
    when I exported with "QT conversion", this time I went into "option">"size" and corrected into 720x480 4:3, before it was set as "compressor native" (640x480)and it exported the same ratio file as "selfcontained".
    yes, I am using the old fashion 4:3, imported files are still images shot with a digital camera. unfortunately this camera doesn't record HD....
    what I don't understand is the difference between NTSC DV 3:2 and NTSC 4:3. Even though my materials are in 4:3 ratio, if I choose NTSC 4:3 it gets distorted from the original image so I choose 3:2 in FCP.
    Is this the distortion that you mentioned which happens only on computer screen? I would like to know which setting is true to the original materials not for playing back on computer but for creating DVD....?

  • My Messages always show me the same conversation when opens

    Hi,
    I have a MacBook Air running OS X Mountain Lion 10.8.3. A few weeks ago I did something in Messages (unfortunately I don't remember what), and since then, every time I open Messages I can only see one conversation on the whole screen (there is no side bar with the full conversations list). It's the same conversation every time, and the only way I found to see the entire list of conversations is to choose "New Message" from the top bar. What can I do so that every time I'll open Messages I'll see the entire list of messages on the side?
    Thanks in advance!

    Hi,
    This may be to do with how Messages remembers which windows were open at the close of Play as it were.
    It may also be remembering things badly.
    In default mode Messages displays one window called Messages (See Window Menu > Messages (CMD + 0) )
    This is the combined interface and Chat window.
    You can open older Chats if you have them on this Mac.
    These will not display in the Main Chat window but as a separate window with no side bar and no other icons either ("To" spot or the Add Buddy/Contact button or Video Button). It should be dated asn list the Buddy you were chatting to.
    Example
    The Red Button (Traffic Light type icons top left) should close this window and on restart the Window should not be visible as you have closed the chat.
    Obviously you can close the whole Messages window with the same Red Button on it's window.
    It will not show up on restart if it was Closed/Hidden on Quitting the App.
    Example Screen Shot with Buddy lists only (Yes, there are 10 of them)
    Any Open chat in a separate window shoudl appear in the Window Menu at the bottom.
    That maybe enough for you to figure out what is being displayed.
    IT is also possible that Messages is not remembering when you have dismissed a window before Qutting the app.
    If this is happening post back with that info as well.
    9:32 PM      Monday; March 25, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Currency Conversion for historical Amount

    Hello Experts,
    Can some one help me to find a solution for my reporting requirement.
    As part of GL reporting, I have a report which shows accumulated balance for given fiscal year/period. If the currency is in USD,I have no issues. When the currency is in non USD(Ex: EUR) I need to convert it into USD at BW side.
    Here is the example:
    User Enters: Fiscal Year/Period : 2007003
    Accumulated Balance for particular GL account might be 300 EUR.
    But actual posting might be happened in 2006012.
    While converting it to USD it should take the 2006012 exchage rate from TCURR and convert it.
    I have created a RRC1 object and used it in Query but it is using 2007003 exchange rate.
    Please help me to solve this problem.
    Thanks,
    Bobby

    Hi,
    make your currency conversion type time dependent that is the the exchange rates should be picked based on the date when the G/L account was posted.
    Go to transaction RRC1 chose your exchange rate type and in the time ref. tab give key date as the posting date it will pick the exchange rate as the date when the doc was posted.
    Hope it clears
    Thanks

Maybe you are looking for