Conversion from date to number & display a date in a textfield

I Have 2 issues
The first one:
I need to extract the hour from a date variable.
This is the code I already have:
NUM_TOT := NUM_TEL + to_number('PROGRAMMINGS1.PRG_START','hh24');
NUM_TOT & NUM_TEL are number variables,
PROGRAMMINGS1.PRG_START is a Textfiel with a dateformat. There can only be an houre like 24:59:00 entered.
So in this example I just want the houre and convert it to a number.
The second:
I want to make a date from a few numbers & then display it in a texfield.
This is the code I already have:
VAR_DATE := NUM_TEL || ':' || NUM_LENGTH || ':00';
:PROGRAMMINGS.PRG_END := to_date(VAR_DATE,'hh24:mi:ss');
Between the 2 lines of code i places a message(VAR_DATE) for testing.
When the program display VAR_DATE then i can see the good date at the bottom of the screen.
But when I place my variable in the textfield it looks like: 00:00:00. What am I doing wrong?
Who can help me.
With regards
Stefanie

Verdi wrote:
Problem: During the conversion (both implicit and explicit conversion with a format mask) I lose the "00" hours and "00" minutes and receive something like this: "10-JAN-13 *12*.00.00.000000000 AM".I don't think you are necessarily losing any information whatsoever. It's probably more of a function of your NLS_TIMESTAMP_FORMAT and NLS_DATE_FORMAT. For example your NLS_DATE_FORMAT could be setup by default for a HH24 (24 hour time) which would report midnight as "00" hours. However, it looks like your NLS_TIMESTAMP_FORMAT is setup with a "HH" format with a meridian indicator which means 12 hours time.
Your comparisons should be using date/timestamp data types anyways so as long as the input value is converted properly into a date type this shouldn't matter anyways.
You can see what is actually stored by using the DUMP function:
SQL> SELECT  DUMP(TO_TIMESTAMP(TO_CHAR(TRUNC(SYSDATE,'DD'),'MM/DD/YYYY HH:MI:SS AM'))) AS TSTAMP
  2  ,       DUMP(TRUNC(SYSDATE,'DD')) AS DT
  3  FROM DUAL
  4  /
TSTAMP                                                                      DT
Typ=187 Len=20: 218,7,1,13,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0                  Typ=13 Len=8: 218,7,1,13,0,0,0,0As you can see the TSTAMP and DT store nearly the same values (218,7,1,13), but the TSTAMP has more precision because of fractional seconds.
HTH!
Edited by: Centinul on Jan 13, 2010 7:23 AM

Similar Messages

  • Date and number display format

    Hello all,
    I am new to Adobe Form, and I am quite unimpressed with how difficult it is to do the most simple things.
    I have managed one way or another to solve all my problems until now, but this one got me stuck.
    I have date and number fields in my form, and here is what I want to do but cannot:
    - I need these fields to be displayed using the defaults date and number settings of the SAP user who is generating the form. This one is really hard for me to figure out.
    - I need some other fields to be displayed in a specific format depending on a variable in the context of my form. I imagine this could be done using scripting, but how to change the display format of a field via scripting?
    Anyone has an idea of how that can be achieved?
    Thank you.

    Hi Thomas,
    For these kind of issues you will get many answers if you search the forum.
    If your requirement is to display the current date in the form, just drag and drop the "Current date" UI element from the Library palette -> Custom.
    If it is to get the date from SAP and display, pass date to the context node and just drag and drop the field into the form from the data view.
    Check the following wiki by Chintan. It explains some common scenarios in javascript.
    [JavaScript Part 1|http://wiki.sdn.sap.com/wiki/display/ABAP/JavaScriptforCommonScenarios-PartI]
    [JavaScript Part 2|http://wiki.sdn.sap.com/wiki/display/ABAP/JavaScriptforCommonScenarios-PartII]
    Use an 'if' condition, check the value and based on the value you can make the field hide/visible in the form.
    Hope this will help.
    Thanks & Regards,
    Sanoosh

  • Adobe Forms: date and number display format

    Hello all,
    I am new to Adobe Form, and I am quite unimpressed with how difficult it is to do the most simple things.
    I have managed one way or another to solve all my problems until now, but this one got me stuck.
    I have date and number fields in my form, and here is what I want to do but cannot (beware, it is impressive): I need these fields to be displayed using the defaults date and number settings of the SAP user who is generating the form.
    Anyone has an idea of how that can be achieved?
    Thank you.
    Moderator message: please post again in the dedicated forum for "Adobe Interactive Forms".
    Edited by: Thomas Zloch on Feb 24, 2011 1:53 PM

    Hi Thomas,
    For these kind of issues you will get many answers if you search the forum.
    If your requirement is to display the current date in the form, just drag and drop the "Current date" UI element from the Library palette -> Custom.
    If it is to get the date from SAP and display, pass date to the context node and just drag and drop the field into the form from the data view.
    Check the following wiki by Chintan. It explains some common scenarios in javascript.
    [JavaScript Part 1|http://wiki.sdn.sap.com/wiki/display/ABAP/JavaScriptforCommonScenarios-PartI]
    [JavaScript Part 2|http://wiki.sdn.sap.com/wiki/display/ABAP/JavaScriptforCommonScenarios-PartII]
    Use an 'if' condition, check the value and based on the value you can make the field hide/visible in the form.
    Hope this will help.
    Thanks & Regards,
    Sanoosh

  • Conversion from ABC to 123 format causes data loss

    Hi,
    I have imported Excel data onto Lumira. The data set contains a "Net Price" column which is detected as ABC. Whenever I convert it to numerical format, I lose some data. Please see the snapshots. What can be the issue? Any background information about conversions?

    Hi,
    I too faced the same issues, but may be we can try this one.
    Split the data with currency using format option to just data(number) and then convert that particular data(only numeric) part to measure.
    I don't think we have any option to append currency and make it as a measure.
    May be in the further releases
    Thanks,
    Varsha

  • How to count occurences of a certain string in incoming real-time data? Also displaying RTC data. Current VI included

    I use LabView student Express 7 on a Windows XP system.
    Time-frame: we are doing final integrations for our balloon experiment today. We just got told that the press wants to view real-time data, which we haven't programmed for. I need help to get a working VI at the latest by 25.02.2004 before 0800(morning) (GMT+1).
    Note on license
    It is a student balloon flight, and the data will not be used in scientific work, so the I am not breaking any license agreements (I hope).
    Problem synopsis:
    The balloon continually transmits data at 9600baud. The data is a semi-repeating header followed by a constant lenght data-package arranged like this:
    BEXUS[h][m][s]BEXUS[h][m][s]
    [Raw binary data, 7channels*8sub-channels*8bits]
    What the groundstation is doing right now:
    Take all incomming data and save (append) the data to a file without any data-handling. (We figured we would go post-processing).
    What I need to change in less than 24 hours:
    - Add a "package" counter
    - Add a display of the clock data (RTC)
    How I planned to implement the changes:
    -RTC display:
    The RTC data is in BCD format, since that means that if you look at the data as hex numbers, you get the hours and minutes and seconds out in "clear text". That is 12 hours is 0x12hex. I figured that I can do a match pattern BEXUS and pass the "after substring" to another match pattern BEXUS from which I feed the "before substring" to a type-cast VI (casting string to u8) and displaying that, which should give me a display of "123000" for the time 12:30:00... I couldn't get it to work at all when I tried out the supplied "beta" vi.
    - Package counter:
    Counting how many BEXUS that gets detected and dividing by 2. I don't know how to do this. I've looked on the forum (a good thread on the problem: "how do I count the number of *'s in a string") but these use either loops or arrays... and I'm not sure how this works when I'm getting the data in at realtime. I cant make an array and then count it, since then the array would grow fast and possibly interfere with saving of the data??? Saving the data is critical.. without that file we cant do post-processing.
    Since my time is so limited (I'm not even supposed to do the groundstation software but they called on me in the last minute because no-one else had time/wanted too/could do it) I hope that you could make an exception and provide me with working VI's (based on the one I have attached) so that I can show something to the press! (Free comercial for NI!! Since the student version shows the National Instruments water-mark on all VI's!!! Possible TV time!!)
    Thanks!
    PS: even if you are to late (after 25) post anyway!
    Why:
    -I can learn from it
    -the launch might be delayed due to weather conditions
    -others might find it amusing!
    Thanks again!
    Attachments:
    BexusII_groundstation.vi ‏46 KB

    I have a valid example data file attached to this thread.
    If you open BEXTEST.bin in a hex-editor of your choice, you'll see the BEXUS as 42 45 58 55 53 and then the time as 00 28 09 etc.
    I couldn't get Joe Guo's VI to work. It doesn't count packages correctly, and the time is not displayed correctly either.
    The file was saved using a straight save to file VI.
    The data is from actual launching area tests performed a few mintues ago. The time displayed is "On time" e.g. how long the gondola has been powered up.
    I have a spare T-junction, so I can hook into the balloon real-time data as we fly, in case anyone care to see if they can figure out why the latest version of Joe Guo's program is not displaying correctly.
    I will monitor this
    thread during and after flight to see if anyone can make it in time!
    Thanks for the great effort!!
    Attachments:
    bextest.bin ‏53 KB

  • How to obtain data from a device and display that data in an infinite loop

    I'm trying to run an infinite loop where I'm testing a robot for thermal insulation.
    I send the robot a command to run infinitely (using VISA communication)..., the robot starts running.
    At the same time I obtain the temperature data from its motors (through sensors) and want to display it. The data should be refreshed at regular itervals but I only get broken display of the data at various instances of time during the robot's test-run.
    I fear that there is a problem with the time synchronization. But having tried many permutations of time delays at various points in the program, I can not find the fault.
    Any help is much appreciated.
    Cheers
    Rajat

    We really need screen shots (*png format/NOT .bmp!) or attached code to see what might be the problem. There are an infinite number of mistakes that can be made (or nearly so), depending on how a program is written.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Calling a procedure from java, conversion from bigdecimal to number(13,3)

    Hello
    i have a procedure that i call from a java api
    among the parameter that i give to the procedure there is a bigdecimal parameter
    then i have to insert this value in a table
    the colum concerned has number(13.3) as a type
    here is the java call :
    ps.setBigDecimal(5,value );
    so what type should i declare for the procedure parameter for the bigdecimal parameter
    and is there a conversion to do
    Regards
    Sallemel

    Data types are defined by the data not a column definition. What are the range of values possible in the data that must be manipulated. Give examples.

  • SNP Planned order START date should be displayed in DATA VIEW

    Hello Guru's
    I have a very complex requirement. It is as follows
    We are using heuristics and capacity leveling for our requirement. We generally see the planned orders in the SNP view but here additional requirement is that we have to see the start date of the production planned in the date view, ie the client would like to know when the actual production starts and wants to see the quantity produced on the first day in the date view.
    In capacity view,we can observe the resource load which is the start date of the production planned, this load is in percentage now do i related that into quanitity and even if we do related that percentage in quantity then how do i see it the SNP data view plan.

    Hi Sriuppa,
    you can use receipts view /sapapo/rrp4 transaction where you can see receipts. This transactions offers you the selection based on  product,source,target,dates,resource and you will get the list of orders.
    Secondly ,if you right click in the receipts cell,select display details,it will show you order details at the bottom of the data view.
    Please let me know if it helps
    Thanks
    Amit

  • Spry data region to display multiple data sources

    I'm developing an interactive menu using the Spry and Ajax framework that lists the menu items on the left (in a Spry accordion) to a corresponding image and description on the right. I have the basic functionality working, however, my menu items are broken into sub categories, and I can't seem to get my detail region to display attributes for more than 1 ds.
    My current status is here: http://bit.ly/PUG1y
    As you can see, my menu is broken into sections; i.e. Tapas, Pizzas, Entrees...etc. The Tapas secion works perfectly, and the Pizza section appears correctly on the left. However, I cannot get the detail region on the right to link to both Tapas and Pizzas. Right now I am trying to use separate XML files for each category, but could see my XML looking like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <menu>
      <tapas>
           <item>
              <name>Fresh Tilapia Dip</name>
              <title>Fresh Tilapia Dip</title>
              <image>../one0one/images/food/crab_cakes.jpg</image>
              <desc>Mesquite Smoked Fresh Fish w/ Tortilla Chips and Pickled Jalapenos $6.99</desc>
           </item>
           <item>
                <name>Jamaican Jerk Chicken Satay</name>
              <title>Jamaican Jerk Chicken Satay</title>
              <image>../one0one/images/food/satay.jpg</image>
              <desc>Served with Pineapple Chutney w/ 101’s Spicy Tartar. $9.99</desc>
           </item>
        </tapas>
        <pizzas>
           <item>
                   <name>Pizza1</name>
                   <title>Pizza1</title>
                   <image>img.jpg</image>
                   <desc>description</desc>
           </item>                     
        </pizzas>
    </menu>
    I do not know how to set up the Spry regions to get this to work.  This seems like it should be pretty straightforward, but I have not had a lot of experience using Spry. What is the easiest/best practice method to get this to work correctly? Thanks for your help.

    I feel your pain... I was JUST running into the same issue and debated on using a similar menu for the restaurant site I did.
    Anyhow, here's how you do it. I solved it with this answer here: SOLVED: Multiple Data Sets (renamed)
    You can reference the source code here. Data Set Shell with Accordion
    The skinny version goes like this: You take your multiple data sets and combine them into one "Shell" using SpryDataSetShell.js
    Copy that to your Spry Assets folder and link to it alnog with your Accordian JS files.
    <script src="../../includes/SpryDataSetShell.js" type="text/javascript"></script>
    create a shell of all your datasets.
    var DATASET_2 = new Spry.Data.HTMLDataSet("../link_to_dataset", "Event_Table");
    var NEW_DATASET_SHELL = new Spry.Data.DataSetShell(dataMay);
    Then substitute your NEW_DATASET_SHELL in your code for the detail on the right
    <div spry:detailregion="NEW_DATASET_SHELL" class="YourContainer">
    Create an OnClick call in your accordian menu on the left...
    <div class="AccordionPanelContent" spry:region="DATASET_1"><p spry:repeat="DATASET_1" spry:setrow="DATASET_1" onclick="NEW_DATASET_SHELL.setInternalDataSet(DATASET_1, true);">{item} {item}</p></div>
    Do that for each of your accordian panels... Good Luck. Let me know if you need anything else.

  • I got a new phone and phone number two weeks ago, I like to iMessage on my macbook pro but none of my new conversations show up, I went into the preferences to change the settings so only conversations from my new number show up, but there is no change.

    If anyone can please help me, I would like to continue using iMessage on my laptop, but none of my new conversations exist only the older ones. I went into the iMessage preferences to delete my old number off the iMessage account and added my new number and email but I still don't get any new messages. Can somebody please tell me what I am doing wrong or how to change it further?
    Please and thanks.

    If the modem is also a router, either use the modem in bridge and run pppoe client on the TC.. that is assuming ADSL or similar eg vdsl. If it is cable service.. and the modem is a router, then bridge the TC.. go to internet page and select connect by ethernet and below that set connection sharing to bridge.
    Please tell us more about the modem if the above gives you issues.

  • How to add new data entry and display old data in the same screen in SM30?

    Hi, Experts:
    We need to use SM30 to maintain a table entry. When I click the button of "New Entries", the table screen becomes blank. I can only add new data but not be able to see the old data existing in the table.
    How can I have the new line available for me to add new data at the same time see the data currently existing in the table?
    Thanks,
    Jenny

    Hi, thanks for the reply!
    Just to follow up for what we did to disable the delete function for maintaining table records. We hided the Delete button by adding a "MODULE disable_delete" code in Screen Painter. So now only adding records to the table is allowed.
    Thanks,
    Jenny

  • Display of data from DB table to screen

    i have added two date fields to the table MBEW by including a structure with 2 date fields. i want the data to displayed on the screen when the user retrives data.
    when i enter any data it gets saved in the DB table but when i try to read it from screen fields the date fields dont display any date they remain blank. i have set the attributes as input and output for the screen fields .
    please tell wats the problem.
    regards,
    Archana

    Hi archana,
              You have extended the standard table rt?
    So when you added these fields to the screen what is the reference structure you have taken to point to the screen fields.
    And does ur work area SAP contains ur custom fields?
    and also there is a standard procedure to extend the SAP screen.
    You better go through this link to understand it clearly
    Link: [Re: SCREEN EXITS]
    Reward points
    Thanks,
    Prasanna

  • Display master data without data in the fact table

    Characteristic 0PROJECT
    Attribute Price
    I want to show in the query all the prices including the projects that don't have registers in the fact table.
    How do I do this?
    Tnks.

    I believe you are describing what SAP referes to as the Slow Moving Item scenario.  Search SDN using that phrase and you'll get hits on documents and  Notes that talk more about this.  Here's something from an old How To
    Slow Moving Item Scenario
    You want to define a query that displays all products that have been purchased only
    infrequently or not at all. In other words, the query is also display characteristic values for
    which no transaction data or only low values exist for the selected period.
    Procedure
    In the Administrator Workbench;
    1. Create a MultiProvider consisting of a revenue InfoCube, containing the InfoObject
    Material (0MATERIAL), and the InfoObject 0MATERIAL. The InfoObject must be set as
    an InfoProvider in InfoObject maintenance. In other words, you need to have assigned
    the InfoObject to an InfoArea. (also refer to Tab Page: Master Data/texts [Ext.]).
    In the BEx Analyzer:
    2. Select your MultiProvider in the Query Designer.
    3. Define a query that contains the InfoObject 1ROWCOUNT in the columns.
    The InfoObject 1ROWCOUNT is contained in all “flat” InfoProviders, that is, in all
    InfoObjects and ODS objects. It counts the number of records in the InfoProvider.
    In this scenario, you can see from the row number display whether or nor values
    from the InfoProvider InfoObject are really displayed.
    4. Save the query and execute it. All values are now displayed, including those for materials
    that were not purchased.
    If you filter by time (0CALYEAR, for example), values from the InfoProvider
    InfoObjects are not displayed since 0CALYEAR is not an attribute of
    0MATERIAL. You can see this from the absence of values in the 1ROWCOUNT
    column in the query. If you want to restrict by time, you need to proceed as
    follows:
    Constant Selection for the InfoObject
    You need to set the constant selection for the 1ROWCOUNT key figure in order to be able to
    set a filter by time in this query.
    1. In the Query Designer, via the context menu for 1ROWCOUNT, choose Edit.
    2. On the left hand half of the screen, under the data package dimension, select the
    characteristic InfoProvider (0INFOPROV) and drag it into the right-hand screen area.
    3. From the context menu for the InfoProvider, choose Restrict, and restrict across the
    InfoProvider InfoObject.
    4. Also from the context menu for the InfoProvider, choose the function Constant Selection.
    5. Save the query and execute it. You can now also set a filter for a time characteristic, the
    materials display remains as it was.
    Displaying Slow Moving Items
    SAP Online Help 05.11.02
    MultiProviders 3.0B, Support Package 07 10
    If you want to display a list of slow moving items, excluding products that are selling well, you
    need to proceed as follows:
    1. In the Query Designer, via the context menu for 1ROWCOUNT, choose Edit.
    2. Via the context menu for InfoProvider, choose the function Display Empty Values. Also
    select Constant Selection.
    3. Save the query and execute it. The result is that the system displays the materials for
    which there was no revenue.
    Displaying Products with Small Revenues
    If you want to display a list of products that have not been sold or have only been selling
    badly, you need to proceed as follows:
    1. Set constant selection as described above, but do not select the display empty values
    function.
    2. In the Query Designer, define a condition for the 0MATERIAL InfoObject. Specify a value
    that is to be the upper limit for a bad sale.
    3. Save the query and execute it. The result is that the system displays all materials that
    have not been sold or have been selling badly.

  • How to display client date in oracle

    Hi All,
    How to display client system date in oracle. When I try to display date & time oracle displays server date and time but I need to display client date & time. How can I achieve that?
    Thank you

    user536769 wrote:
    How to display client system date in oracle. When I try to display date & time oracle displays server date and time but I need to display client date & time. How can I achieve that?As Nicolas says, you can't easily do this.
    The reason is that the SQL engine (and the PL/SQL engine) are processes running on the database server and so they pick up the server date/time. Those processes, running on that server have no knowledge of "client" machines and no way to connect to them. Network security ensures that one machine can't just get onto another machine and access it's operating system without any form of authorisation, hence the only way to achieve this is to have some way for the server to serve a java applet or some such thing to the client and the client user accept that applet to run on their machine and then that applet obtains the relevant details and passes it back to the server.
    Imagine if you wanted to write code on your client machine to go to you colleagues client machine and get the date/time from it, how easy would that be to do without your colleague authorising some part of your software to run on his machine?
    ;)

  • Is it possible to display a date as (DD-MON-YYYY) in excel output using excel template in xml publisher

    Is it possible to display a date as (DD-MON-YYYY) in excel output using excel template in xml publisher where date should be displayed as date only not string.

    I've tried to use hierarchy node variables, but it seems like you can't specify a attribute of the hierarchy such as level.  So with the WBS hierarchy, if you create a hierarchy node variable, you specify the WBS value to select (If I understand this correctly).  I wish I could instead specify "give me all the WBS nodes that happen to have the value of the level attribute greater or equal to 3.  If I understand Juergens post, he is saying make security access so that only certain WBS levels can be returned in the query.  I suppose we can try that, but that would then preclude getting the level 1 and 2 in the future if the authorization is global.

Maybe you are looking for