Need you help !!! -- Convertion from Char to Date

Dear experts:
I am new to abap and here is one thing need your help:
Currently I have a char type field defined in the source table, after I retrive this field into my work area, I need to convert it to Date type and then calculate the last day of this date.
for example: WA_TEST-CHAR = '20100801'. This value in orignal ECC table is char type.
Then How can I convert this value to a date type, and calculate its last day?
My expected result is "20100731".
BTW, does anybody know how to convert a date type field to a number type field like To_number() or something?. If I need to get the period between 2 different date, how can I get this?
Any post will be appreciate and thank you all in advance!
Best Regards
Tim
Moderator message: sorry, date conversion and date calculation are very basic and FAQs, please search for available answers, also read ABAP online documentation.
locked by: Thomas Zloch on Aug 23, 2010 9:56 AM

Hi,
For your question:
BTW, does anybody know how to convert a date type field to a number type field like To_number() or something?. If I need to get the period between 2 different date, how can I get this?
use this FM FIMA_DAYS_AND_MONTHS_AND_YEARS.
regards,

Similar Messages

  • How to get app.processId from Guided Procedures? Please I need You help

    Hi everyone, I need your help, I need to recover the processId once time the Procees was started in Guided Procedures
    I found this link from maintenance process in Guided Porcedures administration
    http://host:port/webdynpro/dispatcher/sap.com/cafeugpui~rt/Runtime?app.processId=IDnumber
    the parameter I need is IDnumber, I dont know if it is possible with web dynpros or with web services please I need you help
    How Can I do this?
    Thank you very much my friends
    Regards from Mexico
    Atte Israel

    Hi,
    I am not sure about the version. But you can follow the steps below.
    1. Create a Web Dynpro Poroject (Ideally create a DC , but if you don't have NWDI setup a project will do).
    2. Add reference to com.sap.security.api.jar and sap.comcafeugpapi.jar
    3. Under WebDynpro References -> Library References add sap.com/cafeugp~api
    4. Put following code in wdDoInit()
    public void wdDoInit()
        //@@begin wdDoInit()
         IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
         IWDMessageManager msgMgr= wdComponentAPI.getMessageManager();
         try{
         IWDClientUser wdUser = WDClientUser.getCurrentUser();
         IUser user = wdUser.getSAPUser();
         IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user);
         Date startDate = new Date(110,1,1); // Start date as 01-Jan-2010
         Date endDate= new Date(111,12,31); // End date as 31-Dec-2011
         IGPProcessInstanceInfo[] array = rtm.getRunningInstances(GPSearchRole.SEARCH_ROLE_OWNER, startDate, endDate, userContext);
         for (int i=0; i<array.length; i++){
         String instanceId = array<i>.getProcessInstanceID();
    //        Write logic to pass the instance ID to the RFC
    msgMgr.reportSuccess("Instance id =" + instanceId);
         catch(Exception ex)
         msgMgr.reportException(ex.getLocalizedMessage(),false);     
        //@@end
    Let me know if you face any issues.
    Thanks
    Prashant

  • Cannot convert from java.util.Date to java.sql.Date

    In the below code am trying to get the current date and 60 days prior date:
    Date  todayDate;
              Date  Sixtydaysprior;
              String DATE_FORMAT = "MM/dd/yy";
              DateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
             Calendar cal = Calendar.getInstance();
              todayDate = sdf.parse(sdf.format(cal.getTime()));
              cal.add(Calendar.DATE, -60);
             Sixtydaysprior = sdf.parse(sdf.format(cal.getTime()));I have imported following files:
    <%@page
         import="java.util.Calendar,
                   java.text.SimpleDateFormat,
                   java.text.ParseException,
                            java.util.*"
    %>Shows up following error msg:
    Type mismatch: cannot convert from java.util.Date to java.sql.Date
    Thanks.
    Edited by: MiltonDetroja on May 22, 2009 11:03 AM

    Shows up following error msg:
    Type mismatch: cannot convert from java.util.Date to java.sql.Date
    I don't think this exception is thrown from the portion of code you have shown. As clearly specified in exception message, you cannot cast an instance of java.util.Date to java.sql.Date. you will need to do something like this
    java.util.Date today = new java.util.Date();
    long t = today.getTime();
    java.sql.Date dt = new java.sql.Date(t);

  • How can I convert from Modbus raw data to engineering units using a formula?

    Within Lookout, I have several Modbus numerical input types that do not have a linear corespondence to the Engineering values they represent.  How can I display these values accurately using a formula to convert from the raw data to an engineering value?

    I don't quite understand your reply.  I'm using Lookout 6.0.2, logged in as Administrator, in Edit Mode.  The Modbus object is named RTU06_SAV.  The Active member is 30002 with an alias of SAVfmSMT_RSL.
    Following your instructions, I opened Object Explorer and right-clicked on RTU06_SAV. 
    This opened a menu containing:  Refresh, Cut, Copy, Rename, Delete, Edit connections..., Edit Data Member Configuration, Configure Network Security and Properties.
    I assumed that I should select Edit Data Member Configuration, but maybe I'm wrong. 
    Within Data Member Configuration I can set up Linear Scaling between Raw data and Engineering data.  I know how to do that, but what I need to know is how to convert Raw data to Engineering data using a formula representing a non-linear transformation (such as a converion to a logarithmic value or perhaps a formula derived by fitting the formula to a curve on a calibration chart).
    Once I have this my Engineering data can be represented on a control panel as both a numeric value AND as a correctly reading Gauge.  It can also be properly represented on a HyperTrend graph.
    What do you suggest?

  • I need you help urgently my job is on the line

    I really need you help it is very urgent as my job is in trouble! In may my I phone got lost I had all back up on my me account and Managed to save my contact list on my I pad however the next day after my I phone got stolen , the mobile me was closed and when I started using I cloud I could not find my list.
    I never update my I pad to I tunes but recently when I got my I phone 5 and my mini I pad by mistake when I was synchronizing all the list got deleted ! Please help me I need to get it bk! If you can manage to find it somewhere please help me find the contact list.
    Thank you

    If you were syncing your contacts with your computer via MobileMe then your contacts should be in the contact manager you sync with on your computer.
    If not, and you haven't maintained offline backups of your contacts, or didn't move your account to iCloud before last June, and haven't ever synced your devices to your computer then your data is gone. It can't be retrieved because it doesn't exist anywhere else, as you haven't followed Apple's directions for backing up and syncing.

  • Please help me... I reset the setting of my ipadmini then it turned black for 4hours now and it never came back to the way it was before. i need you help quick. thanks in advance.

    Please help me... I reset the setting of my ipadmini then it turned black for 4hours now and it never came back to the way it was before. i need you help quick. thanks in advance.

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.
    Message was edited by: Diavonex

  • Ipad is disabled, connect to itunes. know the passcode but ipad is not synced so i lose data if restore it. can you help me to save the data. thanks

    ipad is disabled, connect to itunes. know the passcode but ipad is not synced so i lose data if restore it. can you help me to save the data. thanks

    You're going to have to get that info about his iTunes account if it's on iOS 7. Does it at least show the username it needs?

  • HT1937 my apple iphone 3g.unlock iphone,i need you help me how to back normal ios

    my apple iphone 3g.unlock iphone,i need you help me how to back normal ios...pls answer me urgent.thank you

    Sorry, but your post is unclear. I don't know what you mean by "back to normal iOS". Do you mean that you jailbroke your iPhone? If that's what you mean and you now wish to remove the jailbreak, you can try putting the iPhone into DFU mode and see if that will let you restore and remove the jailbreak:
    http://osxdaily.com/2010/06/24/iphone-dfu-mode-explained-and-how-to-enter-dfu-mo de-on-your-iphone/
    Some jailbreaks cannot be removed and in some cases will permanently disable your iPhone. If that happens to you, then you will have to buy a new iPhone; Apple will provide no support, warranty or out-of-warranty, for a jailbroken iPhone. You're on your own from here. We can provide no further help with a jailbroken iPhone in these forums.
    If that's not what you mean, please post back and clarify. You may wish to try posting in your native language so that your question is more clear.
    Regards.

  • Since the iOS 7.0.2 update, my iPad retina display is now experiencing white blurred screen, can you help me from this?

    Since the iOS 7.0.2 update, my iPad retina display is now experiencing white blurred screen, can you help me from this?

    Restore the device via iTunes on the computer.

  • JAXB  I realy need you help

    JAXB I realy need you help
    Dear friend
    We have next structure of XML file
    <order>
    <entities>
    <entity>1</entity>
    <entity>2</entity>
    <entity>3</entity>
    </entities>
    </order>
    according to xml we generate XSD
    after that use xjc.exe for generate JAXB Objects
    Class Order
    Entities entities
    Class Entities
    List<Entity> entity
    but I would like to be like that
    Class Order
    List<Entity> entity
    Class Entities make transient or use JAXB Custome mapping or other decision
    Thanks

    that is the standard way jaxb generates the model classes. i believe there is some sort of experimental "use simple mappings" switch (probably a vendor extension) which makes the xml files cleaner (similar to your desired implementation), but i don't have much experience with it.

  • My ipad says : this ipad cannot be backed up because there is not enough icloud storage available . you can manage your storage in sttings ..... i dont understand .. i need you help me please

    my ipad says : this ipad cannot be backed up because there is not enough icloud storage available . you can manage your storage in sttings ..... i dont understand .. i need you help me please

    Hi jasmin,
    Did you read what Demo wrote? He wasn't saying he had a problem. He was responding to the OP who had a problem, and was providing a solution. Follow what Demo said to do....
    Cheers,
    GB

  • Can date search help start from a particular date?

    Hi All.
    We have an application where there are 4 date fields.
    These dates can range in past as well as future.
    After selecting one date, others should start from that date.
    But by default, it always takes the system date as starting point.
    Can the date search help start from a particular date?
    Thanks in adv.

    Hi ,
    u can set the initial dates u want by setting the attributes values to which it is bind  . for eg in WDDOINIT of the view..
    hope this will help u ..
    Regards
    Yash

  • Hi i need you help, I have lost my iphone yesterday . Still my mobile is ringing. I want to know the location of my phone.

    Hi i need you help,
    I have lost my iphone yesterday .
    Still my mobile is ringing. I want to know the location of my phone.
    I did't installed the Findmyiphone App.
    I have purcheased last month only.
    Please Please Please help me.

    Hi I have't sync my device with Icloud till now.
    so I am not able to login with Apple id.
    Any other posibilities?

  • Need help converting from 4.0 to 2011

    hello,
    Need help converting files from 4.0 to 2011.
    thank you
    Solved!
    Go to Solution.
    Attachments:
    noise source.vi ‏73 KB
    8673D.vi ‏30 KB
    8970 FREQ.vi ‏26 KB

    attached as 8.2, which you can open
    missing some subVIs - not sure if you already have them
    Attachments:
    8673D.vi ‏13 KB
    8970 FREQ.vi ‏11 KB
    noise source.vi ‏24 KB

  • How to convert from line chart data to CSV format

    Hi ,
    I am using Flex 3 and AS.
    I am getting data from MS SQL and display the data as line
    chart this is ok.
    But i want to convert this line chart data to CSV or .xsl
    format.I find one example in fourms the from data grid to CSV
    For this URL is
    http://www.abdulqabiz.com/blog/archives/flash_and_actionscript/datagriddataexporter.php
    But i want Line chart to CSV.Please help me.

    Line chart is a just a visual representation of some data
    that's sitting in your database. Isn't it? You load this in Flex,
    probably using HTTPService class, and pass it to some chart object.
    Now when use says that she needs it in CSV format, you're
    gonna have to send another request to the server to produce the
    same data, convert into CSV or XLS format and let user download it.
    Of course, if use doesn't want to download, you don't have to
    go to the server, at least for CSV format. You can convert the same
    data that used plot the chart to convert to CSV.
    Am I missing something here?
    ATTA

Maybe you are looking for

  • HT5900 Help "Detect Display" wirelessly with Apple TV,Macbook Pro,Samsung LED

    I have Apple TV, 15" Macbook Pro 10.7.5 (Software  Mac OS X Lion 10.7.5 (11G63) and want to use Samsung Smart TV LED Series 6,  for display wirelessly. In System Preferences it has tab for "Detect Displays" but nothing happens. Is there something els

  • Error handling in the InDesign SDK

    I've almost reached the first milestone on my InDesign project and before I move on I decided to do a code review. One thing that caught my attention are the InDesign smart pointers and how they are used in the SDK samples and some of the open source

  • Crash during sync, now all my apps are gone.

    My laptop and iphone crashed during a sync. Laptop would lock up as soon as the phone was plugged in, and the phone started random reboots and freezes. I reinstalled WinXP and itunes on the laptop, but still could not sync. The phone would come up "s

  • MacBook Pro - what's best option for university Windows apps?

    My son is starting university and considering buying a MacBook Pro (we are a Mac family). However, his math textbooks (calculus and linear algebra) come with bundled software, or keys to downloadable software, that only runs on Windows. I haven't bee

  • LV 2010 Crash on property read

    The attached VI causes LV 2010 SP1 to crash. Attachments: crash.vi ‏10 KB