Problems date

I hava a field that contain a string taht representa Date in this format (dd/mm/yyyy) and I must trasform this string in a Date in this format dd/mm/yy because I execute a query SQL on the Data Base Oracle where the dates are in this format (dd/mm/yy). I try with this code but the date format is not correct:
String str_ReqDate="28/10/01";
int int_d = Integer.parseInt(str_ReqDate.substring(0,2));
int int_m = Integer.parseInt(str_ReqDate.substring(3,5));
int int_yy3 = Integer.parseInt(str_ReqDate.substring(6,8));
int int_date1 = int_yy3-1900 ;
java.sql.Date date = new java.sql.Date(int_date1, int_m-2, int_d);
OUTPUT 1-09-28 where 1 is year 09 is month and 28 is day and the - is not correct for my format date.
Help me It is very important.
Thanks .

hey this is very simple!!
just try this
import java.util and java.text
SimpleDateFormat sdf_2dyear = new SimpleDateFormat("MM/dd/yy");
SimpleDateFormat sdf_4dyear = new SimpleDateFormat("MM/dd/yyyy");
String test1 = "3/21/00";
System.out.println("test1: " + test1 + " to : " +sdf_4dyear.format(sdf_2dyear.parse(test1)));                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • BO 6.5 : save as excel (problem date)

    hi,
    i've a query result in BO with a date "31/12/2099". This date come from an oracle db file.
    I save it into xls (save as) but the result in xls give me "30/12/1900".
    It is the same for date greater than 31/12/2099.
    for date < 1900 the result is 01/01/1900 !!!!
    I think the problem is to resolve the date in two positions (YY) to four positions (YYYY)
    is it possible to bypass de transformation ?
    an idea to correct this ?
    thanks
    Edited by: dlbank on Jun 22, 2009 1:43 PM
    Edited by: dlbank on Jun 22, 2009 1:45 PM
    Edited by: dlbank on Jun 22, 2009 1:47 PM

    Hi,
    Following solution might be helpful in resolving the issue.
    A workaround for this issue is to select the entire document, go to Edit > Copy All, and then paste it into an Excel spreadsheet. You will get the correct dates and the table will remain in the same format as the original *.rep document. You can then do further calculations in the Excel spreadsheet.
    Note: If the *.rep document contains gaps, then they will not be pasted into the Excel spreadsheet unless you use "Paste Special". If you do this, then you will be able to view the data but you will not be able to do further calculations in the Excel spreadsheet.
    Regards,
    Sarbhjeet Kaur

  • BO 6.5 - save as excel 2003 (problem date 31/12/2099)

    hi,
    i've a query result  in BO with a date "31/12/2099". This date come from an oracle db file.
    I save it into xls (save as) but the result in xls give me "30/12/1900".
    With other date, there is no problem.
    an idea to correct this ?
    thanks

    A workaround for this issue is to select the entire document, go to Edit > Copy All, and then paste it into an Excel spreadsheet. You will get the correct dates and the table will remain in the same format as the original *.rep document. You can then do further calculations in the Excel spreadsheet.
    Note: If the *.rep document contains gaps, then they will not be pasted into the Excel spreadsheet unless you use "Paste Special". If you do this, then you will be able to view the data but you will not be able to do further calculations in the Excel spreadsheet.
    Regards,
    Sarbhjeet Kaur

  • Importing Non-SAP WebService - Problem: Data Transfer

    Hi all,
    I need to integrate a non-sap Web Service into Dynpro.
    I generated a client-proxy and a logical port.
    The Web Service needs one object (the structure from the object was generated correctly)
    In the next step I was programming the following code.
    *        Reference variables for proxy and exception class
             DATA:
             lo_clientproxy TYPE REF TO zrhco_testrules_services,
             lo_sys_fault TYPE REF TO cx_ai_system_fault,
             lo_app_fault TYPE REF TO cx_ai_application_fault,
    *        Structures to set and get message content
             ls_request TYPE zrhexecute_rules,
             ls_person TYPE zrhperson,
             ls_response TYPE zrhexecute_rules_response.
      ls_person-geschlecht = 'weiblich'.
      ls_person-age = 18.
      ls_person-name = 'Petra'.
      ls_person-icon1 = 0.
      ls_person-icon2 = 0.
      ls_request-person = ls_person.
      TRY.
    *    create proxy client
          CREATE OBJECT lo_clientproxy.
       CATCH cx_ai_system_fault.
      ENDTRY.
      TRY.
          CALL METHOD lo_clientproxy->execute_rules
            EXPORTING
              input = ls_request.
        CATCH cx_ai_system_fault INTO lo_sys_fault.
          WRITE: / 'Code:', lo_sys_fault->code.
          WRITE: / 'Text:', lo_sys_fault->errortext.
        CATCH cx_ai_application_fault INTO lo_app_fault.
      ENDTRY.
    The input is correctly filled with the required data but every time i executed the program an error occurred.
    SoapFaultCode:5
    I think that the real problem could be parsing abap into xml.
    SERIALIZE_APPLICATION_DATA
    I tested the Web Service in Web Services Navigator without any errors.
    The object is written in Java and the class implement Serializable, but i think the failure is on the abap site.
    Does anyone has a solution for my issue?
    Thanks a lot in advance!
    Regards,
    Robert

    Hello Leo,
    There are a number of options to do this. You can use the standard SAP tool named LSMW - Legacy System Migration Workbench (transaction LSMW) as a starting point.
    Also please read this [Documentation|http://help.sap.com/saphelp_47x200/helpdata/en/0d/414538bc0fe927e10000009b38f8cf/frameset.htm] before undertaking the data migration activity via LSMW.
    Additionally, there is also a Direct Input program available named RMDATIND - please go through the program documentation before you use it. You can use this program to transfer material master data to SAP but
    make sure you assign this program through LSMW for mapping structures etc. The internet link above will give
    more details and step-by-step instructions to follow.
    Hope this helps,
    Cheers,
    Sougata.
    p.s. It is sad to see useful answers remain unrewarded such as this one!
    Edited by: Sougata Chatterjee on May 9, 2008 10:13 PM

  • Lost Data Minor problem data 3 ?

    I Have acidently erased and installed osx 10.4 on myt audio hardisk !
    I have tried nerly every type of data rescuing program on osx and p.c but the files have come back as .mpg and when I change the extentions and try to open then up in logic 7.1.1 it just doest make it ! Does any one have any experience with this type of situation as such ? And if so what can be or not be done . I have about 3 months of very hard work into the disk And going crazy to fix this up but not getting anywhere:(
    And I always get this mesage minor problem in data 3?
    What is this ?

    Hi Prakash,
    When you load data from R/3 through any infopackage the Job name is automatically taken starting with "BI". This means this a BI job running in R/3 for the ease of the understanding the processes for ourselves.
    But when the Job which has been in scheduled status, which you have started, it has taken this as per the R/3 job as you have released the Job from R/3.
    This might be the reasons where your Job description or name is different.
    It's not the issue or problem with system. If you are getting a wrong data or not loading the data then you have to check the Job log for that particular job.
    Or the another chance of the wrong job name, may be, you have released another job which is not related to BI.
    Please check whether you have released the Right Job pertaining to BI.
    Regards,
    Ravi Kanth

  • APD problem - data type & currency translation

    Hi,
    I am using APD to get hung number of records from mulitprovider. I use a query to as a source of APD.
    In the query, there is an option to select currency translation in variable screen.
    But I encounter the following problems:
    1. key figures in the output file are in floating point. is it possible to change data type in APD?
    2. when I select currency translation in this query, does APD support currency translation?
    Thanks a lot.
    Regards,
    Helen

    Hi Helen,
    You can use an routine ABAP to change the format of your data type & currency transation.
    Regards
    Romain

  • Date problems, dates stored as 00-00-00

    Hello all,
    Not a question this time sort of a problem with the data itself in our database.
    I recently successfully recovered the oracle database that I was having problems with, this database is for one of our clients and we we're given a faulty cold backup and a import dmp file from the company that used to support their Oracle environment.
    Now we have to migrate this to an SQL Server 2008, for this I've been using the SQL SERVER Migration Assistant for Oracle.
    There is no problem migrating over the structure but when trying to migrate the data we get 'Year, Month, and Day parameters describe an un-representable DateTime.' errors.
    I quickly looked into the database to some of the affected table and found that most of the date columns have the value 00-00-00.
    My latest thought was to perform an update on the tables themselves before migrating them but apparently you can't perform a select statement where the a data = 00-00-00.
    Anyone ever had this problems and if so how did you solve it.

    >
    My latest thought was to perform an update on the tables themselves before migrating them but apparently you can't perform a select statement where the a data = 00-00-00.
    >
    Apparently you can't be bothered to post error messages, but your ambition is to remain a 'Resender' of nonsense.
    Any explanation why you prefer to post fairy tales, riddles, and myths, requiring crystal balls?
    I would be happy for you to move over to Sqlserver so you can bother different forums.
    Sybrand Bakker
    Senior Oracle DBA

  • BIA Server problem - Data package not consistent

    Dear All,
    I have a strange issue with my BIA server. When I run the report by selecting top most nodes of the hierarchy.
    Report ends up with message: No applicable data, and below error messages
    Aggregates of ZFICSC22 were compressed. Data package is not consistent
    Error while reading data, navigation is possible
    The report works fine when I select the subsequent nodes (immediate lower nodes) of a hierarchy.
    The report also works when I execute bypassing the BIA
    I have cleaned up all the hierarchy buffer but the problem persists
    As of now I am left out with last option which is rebuilding the indexes unless any one of you comes up with a better solution.
    Thanks & Regards
    Ziya
    Edited by: Ziyauddin Mohammed on Dec 5, 2008 4:02 PM

    Hi,
    Have you implemented OSS Note 1163991?
    There is nothing like data package compression in BIA.
    Regards,
    -Vitaliy
    Edited by: Vitaliy on Dec 5, 2008 9:08 AM

  • Chinese Conversion Problem -Data Transfer

    Dear Guru's
    We are implementing SAP to china Client we are facing problems in following areas please suggest me as of how to go about in these aspects
    1. Base Unit of measurement
    We are using PCS as our unit of measurement. In English Login we are getting PC is same as expected and when we log-in in Chinese we are getting Numeric value '211' at the place of Unit of Measure.
    2. Out Put Conversion
    In Chinese Login When we Create Delivery/Invoice/Packing list Out put The System is not converting the details into Chinese.The Display of Delivery is in English irrespective of Log-in. So kindly Let us know how to Go about it.
    3. Master data F4 Display Screen
    During Master data Access when we go for Search Screen F4 we are getting Question mark Symbols.
    These are Some of the Major issues
    So Kindly Let Us know How to Go about.
    Regards
    Kiran Nazare

    to 1)  the translation of the unit is not done to Chinese language.
    Not everything is SAP delviered if you install a new language.Some customizing has to be translated by yourself.
    goto CUNI and select from menu GOTO > translation..
    2) the form is usually your own form, so you need to translate the form to the new language
    3) about which field are you talking, where do you see the ?????
    Does this only happen for loaded materials or as well for  manually created materials?

  • Synchronisation Problem, data reset in Web AS

    We are within the deployment of MAM 3.0. We had the problem, that after the initial sync we where not able to synchronize a second time.
    This was due to the high data volume we use, and sent to the mobile devices. SAP provide us the solution to use Data Packaging, and  it works.
    For the already deployed mobile devices, we are not able to change the parameter. Packages in Merep_MON remain in O-Waiting, and we are not able to synchronize again.
    Is there any other solution apart from deleting the mobile devices in the Web AS and do a new installation on the client, to reset the data in Web AS for that clients?

    Hi,
    if you reset the data on the client (on the settings screen) and set the data packaging there as well - then it will work.
    This will delete all inbound and outbound queues for that device - so I am pretty sure that even with your setup it should work. I will be surprised if not.....
    Have you tried that?
    Regards,
    Oliver

  • Problem date format

    Hi Guru's
    I have a problem with a field coming from a file upload in my internal table wich should be insert in a system table in date format.
    When i do my test to check if the field has a correct date format I always receive the error: "Valid_to_date is invalid".
    the field in my csv file has this format 02.03.2009.
    I've written this code :
    TYPES: BEGIN OF t_segm2,
       kokrs    TYPE kokrs,
        prctr   TYPE prctr,
        datbi   TYPE datbi,
        datab   TYPE datab,
    END OF t_segm2.
    DATA:
              wa_cepc_segm TYPE t_segm2,
               i_cepc_segm TYPE STANDARD TABLE OF t_segm2,
              it_datatab TYPE STANDARD TABLE OF string,
              wa_datatab TYPE string,
    LOOP AT it_datatab INTO wa_datatab.
        SPLIT wa_datatab at ';' into
                              wa_cepc_segm-kokrs
                              wa_cepc_segm-prctr
                              wa_cepc_segm-datbi
                              wa_cepc_segm-datab.
        CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
          EXPORTING
            date                      = wa_cepc_segm-datbi
          EXCEPTIONS
            plausibility_check_failed = 1
            OTHERS                    = 2.
        IF sy-subrc <> 0.
          WRITE:/ 'Valid To Date invalid'.
        ENDIF.
        append wa_cepc_segm to i_cepc_segm.
        CLEAR wa_cepc_segm.
      endloop.
    Anyone can help me please?
    Regards,
    Mohamed.

    Everything seems fine with the code. I tried it myself and I got strange behaviour.
    I used this code:
    data: datbi TYPE datbi.
    fdate1 = '02.03.2009'.
    concatenate fdate1+6(4) fdate1+3(2) fdate1(2) into datbi.
    CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
          EXPORTING
            date                      = datbi
          EXCEPTIONS
            plausibility_check_failed = 1
            OTHERS                    = 2.
        if sy-subrc ne 0.
          write 'Wrong date'.
    "    else.
    "      write 'Date ok'.
        endif.
    When I leave ELSE block commented, the FM returns sy-subrc = 0 and doesn't display 'Wrong date' message. So this works as we want. But when I debug it, I can clearly see that processing goes inside IF block and tries to write the message out (even thought the condition is not fullfilled). But anyhow the message doens't appear on the screen. Strange.
    Now when I uncomment the ELSE block, the processing seems to work fine. Don't know why it is happening but if we leave entire IF,ELSE it works fine. So try this solution. Everything else works fine.
    Regards
    Marcin
    Right now I tried to see if this IF block really changes some data object using:
    data var type i.
    call fm....
    if sy-subrc ne 0.
       var = 1.
    endif.
    write var.
    And I could see that, thought processing is passed inside the block it doesn't change VAR contents. So it stays 0. But just right after it I run the program again to show it to my collegue and the processsing didn't go inside anymore. It must be something with debugger then. My collegue says once he spent some time investigating the same problem and finally he gave up. What the debugger was showing was different from what it was in fact calculating. Fortunatelly the calculation here doesn't change, just debugger is trying to cheat us showing what he is really NOT doing;)
    Edited by: Marcin Pciak on May 8, 2009 9:31 AM

  • XControl Data wiring problem - Data type is Waveform Graph (Strict)

    Hi,
    I created an Xcontrol for a waveform graph. The datatype (under Data 1.ctl) is a WaveformGraph reference type.
    When I wire a Waveform graph reference to the Xcontrol (as an indicator), there is a wire conflict.
    I checked the strict definition and the reference types are theoretically congruent but I cannot seem to wire it together. Any solutions?
    Please see the attached code.
    Thanks!
    Attachments:
    GraphDisplay XControl.7z ‏1717 KB
    Tester.vi ‏15 KB

    It looks like the XControl data is a waveform reference (strict). I can't open the XControl though, because I don't have a 7z compiler, but the problem is probably that the refnum will only take in a reference to an exact waveform graph because it's strict.
    You can create a non-strict reference and use that for your data by:
    Open your data control FP
    Press Ctrl-Space
    Type "Control Refnum"
    Press Enter and place that on front panel
    Right click it and brows to the correct data type:
    James
    LabVIEW Professional 2014

  • Product change problem dates CRM-ISU

    Hello experts,
    We have a problem here with the producto change functionality. I will try to explain the problem
    As many of you already know, when you execute a product change from CRM, the old position date get expired and the new position start date begins the next day. The data is replicated to ISU and the EVERH is updated (old position date e.g expired 13.08.2009 ). After that, in ISU the information is sent to the distribution company to accept the modification. Once the information is back from the distribution company, the new position is created in the EVERH (e.g start date 23.08.2009) and replicated to CRM.
    The problem is that the distribution company takes, for instace, 10 days to give the information back to ISU and therefore a gap date comes up between the end date of the old position (e.g 13.08.2009)and the date that the new position is activated (e.g 23.08.2009). Many errors occurs in ISU due to this gap date
    We would like to avoid the date update in ISU when the data comes from CRM, to keep the old position date open in ISU until the activation is accepted. Somebody knows how could I manage not to send the old date to ISU in CRM?
    Thanks all in advance. Hope not to be so boring.
    Regards

    How do you do this change in CRM? Do you do a move-out? When the distribution company confirms do you create a move-in?
    Here I´m talking about a product change in CRM. The contract is the same for both positions, only the product is chaged. So there is no move-out for the contract. The flow is as follows:
    CRM Product change - ISU EVERH table update (only old position with expired date) - Distribution company confirs modification - ISU EVERH table update (new position for the same contract) - CRM new position activation update
    Hope this helps
    Thanks in advance

  • Squirrelmail problem - data dir does not exist [solved]

    After install package, configuration (conf.pl) and log in I see error:
    Could not create initial preference file!
    /var/lib/squirrelmail/data/ should be writable by user nobody
    Please contact your system administrator and report this error.
    When I run http://mydomain/squirrelmail/src/configtest.php I see:
    FATAL ERROR: Data dir (/var/lib/squirrelmail/data/) does not exist!
    Of course /var/lib/squirrelmail/data/ exists (created by pacman) and its is owned by nobody.
    Problem is independent of /var/lib/squirrelmail/data/ permission.
    Last edited by qwak (2007-06-18 16:20:50)

    qwak wrote:
    Soved.
    It was php security issue and some changes in http (or php) configuration was required.
    See: http://pl2.php.net/features.safe-mode
    I just set:
    php_admin_value open_basedir /
    in my mail virtual host section.
    I thing that squirrelmail package should include .../extra/http-squirrelmail.conf apache configuration file with required configuration or some info should by typed to user when squirrel package is installed.
    I agree!  I just ran into this same problem!

  • LAN boot problem; Data corruption

    2 Major problems I have found with this board, and need help with immediately.  I've built on MANY of these boards and have seen 1 or both of these 2 problems on about 1 of every 5 MSI K8T boards I build on.  
    1: Lan Boot Problem:  The computer will freeze the majority of the time when it passes through the REALTEK boot agent.  BBS LAN is NOT in the boot devices list, and boot other devices is DISABLED.   I've tried about every setting from within the boot agent with no success.  It freezes somewhere around the 7th or so ".".The computer will boot as normal with the LAN cable unplugged.  Simply unplugging it every time the machine is booted is of course, unacceptable.
    2: In combination with WD hard drives, a certain large percentage of the boards will have CONSISTENT data corruption.. about every 2 weeks XP will be magically missing some files, causing it to not boot.  Sometimes last known good fixes it, sometimes a fixboot/fixmbr will fix it, sometimes a complete reinstall is needed.    
    Does anyone have any information as to the cause or cures of these problems?  They seem to be found only in the K8T board and none of the other boards I work with.

    That's pretty strange.  The power supply causing the hanging with the boot rom, that is.  The ability to not skip the boot agent, even when it is set to a) boot from BIOS devices (which doesn't include the BBS NET or boot other devices) or b) ROM DISABLE in the config utility.  Especially when you consider it's done it on MANY configurations, and your site/box/anywhere has NO MENTION of power supply issues or compatability problems.    The manual says "Power supply of 300 (and up) watt is highly recommended for system stability" - Nothing else.
    Is this is the quality assurance we should expect from a company that offers us, "The extreme chip you ever needed"?
    Why has this issue that rules out using the greater chunk of the market's power supplies not been mentioned, and why is it only a problem with MSI's K8T board?

  • Random reboots, application problems, data hanging

    For about the past two months now, my phone will randomly shutdown/reboot, some applications especially like Pandora will hang/lock up, and my phones data connection at time will "hang" and won't allow me to connect to the internet or any other feature that requires mobile data. I did a factory reset yesterday evening, and am still seeing the same problems. Has anyone else had this problem at all? and if so, what was the fix for it?

    I have locked this thread as it has been dormant for some time.
    If you have a similar issue or a question about this please start a new post
    Steve_T                                                                                                       New to the Community click here  
    Community Moderator

Maybe you are looking for