Error in the Dates in java.util.Calendar/java.util.SimpleDateFormat

I specifies the year(1999) and the week of that year(1).
Then I want an existing date like 1999-01-01.
But I get 1998-12-31. This date is WEEK 53 of year 1998.
So what I found was that every week in a year (Ex. 1999),
that have a previous year with 53 weeks (Ex. 1998), have
their dates dislocated one week. This means that
all dates I receive is from the previous week instead for
the correct one.
Code ex.
Calendar aCalendar=Calendar.getInstance();
aCalendar.set(Calendar.YEAR, aIntYear);
aCalendar.set(Calendar.WEEK_OF_YEAR, aIntWeek);
SimpleDateFormat aDateFormatter=new SimpleDateFormat ("yyyy-MM-dd");
aDateFormatter.setCalendar(aCalendar);
String aParsedDate=aDateFormatter.format(aCalendar.getTime());
Have anyone a good solution for this, (without a check if the previous year
has 53 weeks and then adding 1 to all weeks in the next year)?

After reading the API I see that their implementation is correct. If the first day of the year doesn't begin on the first day of the week, then the first day of that week is in the previous year.
For example if New Year's day is on Wednesday and the first day of that week is Sunday then the date of the first day of the week (Sunday) is in the previous year.
I'm not sure how you would like to alter this, if you change it so that it ignores that the first week was not 7 days long then your program will return incorrect values. In the previous example, your proposed alteration would return January 5 as the first day of the first week of the year, which doesn't make any sense.
One thing you could do is check to see that after you set the week, check to see whether the date returned is less than the first day of the year you set. If so return the first day of the year.

Similar Messages

  • Printing the datas through Crystal Report from Java

    How can I Print the datas through Crystal Report from java?

    How can I Print the datas through Crystal Report from
    java?
    What the hell are "the datas"?
    Jesus, I can understand this is a shrinking planet, Global community, and all that happy horse pucky. Typos or small grammar errors are no big deal, I make them all the time. But when I have to spend more time interpretting the question than figuring out the answer, it drives me crazy.

  • Error reading the data from the remote cube

    Hi all,
    When we try to get the data for remote cube from LISTCUBE, we are getting the following msg.
    1) Messages for DataSource 9AUPA_DP_HK_01 from source system AD1CLNT100
    2) 224(/SAPAPO/TSM): No planning version selected
    3) Errors have occurred while extracting data from DataSource 9AUPA_DP_HK_01
    4) Error reading the data of InfoProvider UICHKRMTC.
    Any Inputs?

    Hi,
    Check whether the sourcesystem is responding.
    And also in the error mesg: 224(/SAPAPO/TSM): No planning version selected
    It seems you have not selected any planning version. Give any planning version in the listcube selection screen and execute.
    Regards,
    Ravi Kanth

  • Invalid data status error during the data extraction

    Hi,
    while extracting capacity data from the SNP Capacity view to BW. i get the "invalid data status error" and the data extraction fails.
    when debugged the bad requests of the ODS object, i found that for a certain product(which has both positive and negative input and out qtys) co-product manufacturing orders were created. but this product was not marked as the co-product and functionally its fine.
    how can i rectify the data extraction problem..can you advice.
    Thanks,
    Dhanush

    Sir,
    In my company for some production order status some are having "errors in cost calculation" ie "cser" .how to deal these kind of errors.

  • Error in the Data Transfer phase

    Dear all,
    During the Data Transfer phase, we get 117 errors.
    The error for each failed process is:
    Execution of program /1CADMC/OLC_500000000043327 failed, return code               3
    Message no. DMC_RT_MSG046
    RC = 3: Error writing the data
    I compared the table structures in source and target system, and they are the same.
    Therefore I suspect that something went wrong during the Data Selection phase.
    Does anyone else have this problem?

    Hi Nicolas,
    Error code 3 suggests that there was a problem writing data to the receiver system. This may happen due to various reasons (For example: No tablespace available in the target system). To be sure, please check the System Logs (SM21) and Error Logs (ST22).
    In oder to check if something went wrong during data selection, you may refer to the selection logs for the tables for which data transfer is aborted.
    In case you are not able to identify the issue, kindly open an OSS Message for faster resolution of the problem.
    Regards,
    Suman

  • Error in the Data Selection - Errors in Source System RSM 340

    Hey Everyone,
    I'm having an issue with loading a Delta for 0MAT_PLANT_ATTR.  This is the second night it has happened, where I get the error "Error in the Data Selection".  This error happens in the EXTRACTION part of the Monitor.  And, we cannot run another Delta to see if it'll work, we have to delete the old Delta Init, and run a new one.  The other error is "Errors in Source System - RSM340".  That's as much it gives.
    Could anyone suggest why this would be happening?  I checked RSA3 in R/3, and no errors on the extraction.  I also checked sm37 against the job that loads that data, and it completed successfully.  I honestly don't think there's an issue with the data.  We cannot have this happen often, and I just need to know if this is something that can be corrected.
    Thanks,
    John

    There is nothing wrong with the TID's or anything like that.  There is also no selection criteria in the infopackage.
    When the Delta fails, the error occurs under EXTRACTION in the monitor.  It seems to be successful under TRANSFER and PROCESSING in the monitor, which I find strange.  Also, I run a new Delta Init with Data Transfer, and that works just fine.
    So, I'm not sure what it could be?

  • Error reading the data of InfoProvider /APC/FINGLV01

    Hi All,
    Via RSA1 I wanted to check the data but met the following error
    /APC/FIAGLACC_TD01_FQ9CLNT001: The application running deliberately caused an abo
    Error in substep Error reading the data of InfoProvider /APC/FINGLV01
    Also, in all oview view, it displayed "No data available" error.
    Error msg : Error reading the data of InfoProvider /APC/FINGLV01
    Message no. DBMAN305
    Diagnosis
    Errors occurred while reading a VirtualProvider outside the BI system. Check whether the previous error messages contain any information about the possible cause of this error.
    It is possible that the error message cannot be displayed because the error message class does not exist in the BI system. If this is the case, only the name of the error class and the message number are displayed. View the error message text in the specified error class in the source system of the VirtualProvider.
    Procedure
    Since the error is not necessarily in the BI system, there is no specific procedure for resolving it. With VirtualProviders, problems often occur with the connection to the remote system; these can lead to system termination. If the code for the VirtualProvider is not from SAP, contact the relevant contact person to help resolve the issue.
    If an SQL error is listed in the previous message, see the procedure for SQL errors.
    Thanks in advance
    regards,
    Anil
    Edited by: Anil Kumar Koppuravuri on Oct 16, 2009 3:53 AM

    At this point of time, we are unable to implement any patches, we would like to know exact reason behind the error, so that  we can correct it with out implementing a patch.
    And also the problem is not Consistent, Some time it works fine (50% Time it works fine)
    I really appreciate your time
    Message was edited by: TR Palle

  • IS it possible to Format the data to CXML format in Java ?

    Hi all,
    I am new to Java programming. I am an SAP ABAP Developer and in my SAP CRM E-Commerce Web Shop coding, I have to do coding in Java.
    My current requirement is that I have some set of data and I have to format this data to CXML format in Java. IS this possible?
    Can I format the data to CXML format in Java? Are there standard API's to do this? Please let me know how should I procced with the coding?
    Apart from formatting the output to CXML format, I have to also post this data to an external market place...How can I do this?
    Please help me with relevant information. your help will be highly appreciated.
    Regards,
    Jessica Sam

    It should be possible to format the data, yes. If there's a "standard API" it should be one that comes out of that SAP CRM thing, so look there.
    As for "posting to an external marketplace", that's far too vague a concept to be able to answer. You should start by getting the specs about "how to post" from that marketplace.

  • Can't open aperture 3,  warning box comes up," warning there was an error opening the data base for the library /pictures/aperture library .aplibrary  Whats up?

    I have had Aperture 3 loaded on my computer for a while now. Never had any problems till tonight. Restarted my computer and went to open Aperture and a "warning" box poped up, There was an error opening the data base for the library /picture/aperture library ap library.   Then a "quit" button.
    What is going on and how can I open my aperture. I have pictures that need worked for clients.  Help!

    Have you run through the steps in Aperture 3: Troubleshooting Basics. If not that's always a good place to start.
    If that doesn;t resolve the problem when you post back describe your hardware and software setup.
    good luck

  • Error message: The data for filename was already added to the form

    I recently modified an existing data-collection PDF - only mod was to add some additional pull-down menu options in two fields. I went thru the Distribution wizard, tested the revised form, added the PDF to the Responses file...everything seemed fine. Next day, I distributed the revised form, and had 22 submissions. When adding the 22 submissions to the Response file, 6 or 7 bounced with the error message "The data for <filename> was already added to the form", even though that was not true. I went back, cleared all, and added one of the "bad" files to the response form. It went in OK, but I could not add another "bad one". Although several of the forms may be submitted by the same person, the data is different in all of the submissions, plus, we've been doing this procdure for over a year and never had an issue until now.
    The original form may have been created in Acrobat X, and I have Acrobat 9 Pro. Not sure if that is part or all of the answer. Thanks for any insights...I saw a posting in the Reader side, but I can't see any answers.

    Hi
    According to your error message, we need to verify if Microsoft SQL Server Compact appears in the
    Change Data Source dialog. If not, you need to install
    SQL Server Compact components for Visual Studio firstly, and if you choose to install SQL Server Compact 4.0 , you should note that SQL Server Compact 4.0 supports in Visual Studio 2010 Service Pack 1 or later versions. I recommend you to install the latest
    Service Pack (SP) of SQL Server Compact, and latest SP of Visual Studio, then check if the error still occurs. For more information, see:
    http://blogs.msdn.com/b/sqlservercompact/archive/2011/03/15/sql-server-compact-4-0-tooling-support-in-visual-studio-2010-sp1-and-visual-web-developer-express-2010-sp1.aspx
    However if there is no problem with the installation of SQL Server Compact, it will be an issue that regards ASP.NET and website deployment. I suggest you to post the question in the ASP.NET forums at
    http://forums.asp.net/ . It is appropriate and more experts will assist you.
    In addition, you can review the following link:
    Working with SQL Server Compact in Visual Studio:http://msdn.microsoft.com/en-us/library/gg606540(v=vs.100).aspx
    Thanks
    Lydia Zhang

  • EVDRE encountered error retrieving the data from web Server

    Hi,
    I know this is the common/generic error message, following is our scenario:
    We installed BPC NW 7.5 on our production box and configured F5 load balancing for two .NET servers.
    We are getting the error "EVDRE encountered error retrieving the data from web Server"when we run the report EVDRE on APSHELL (original Appset). This is the fresh installation:
    The workaround "Clear Local application information". Even this works only sometimes.
    Is there anything else we should have configured on using two .NET servers?
    Please suggest.
    Thanks

    hi Nagesh sorry for the delayed reply..
    We changed some of the parameters at F5 switch like sticky time, timeout..
    And the MDXPARSER connection to one of out application server was failling, thats why we did not had this issue consistently.
    When ever the request goes to that app server fails. It took a lot effort to notice this since we were assuming the F5 switch was only causing the issue.
    Thanks

  • BEX query error---Error reading the data of InfoProvider

    Hello all,
    we are getting the following msg when we execute the query-
    Error reading the data of InfoProvider ZEUDPR01
    Errors occurred when extracting data from DataSource 9AEU_DOM
    Short Text: Error for COM routine using application program (return c
    Parameter: 1028533- LC kernel
    Message in Source System: E102(/SAPAPO/OM) ...
    Short Text: COM - error Unknown
    Parameter: Unknown
    Message in Source System: E001(/SAPAPO/OM) ...
    Messages for DataSource 9AEU_DOM from source system PA1CLNT100
    Errors occurred during parallel processing of query 4, RC: 3
    Error while reading data; navigation is possible
    Row: 54 Inc: WRITE_MESSAGES Prog: CL_RSDR_AT_QUERY
    Found
    This is the error observed for a particular selection only..for rest of the selection we get the data correctly.
    Please help with the possible causes of error.
    Thanks,
    Pallavi

    Hi Pallavi,
    How did you manage the pb?
    we have the same error after Stack 21 (SP23)
    we could not run query.
    Thanks.
    John

  • Error running query - 'Error reading the data of InfoProvider 0TCT_VC01'

    Hi,
    I have worked through all the steps to activate BI statistics in our system (Netweaver 2004s SAP_BW 700 BI_CONT 702) yet some of the queries are not working.
    Specifically when I run the query 0TCT_MC01/0TCT_MC01_Q0131 I get an error that reads:
    Error reading the data of InfoProvider 0TCT_VC01                  
    There is still no data source assigned to VirtualProvider 0TCT_VC01
    Any help on how to resolve this would be appreciated.
    Thanks.
    Dyllan

    Did you install the underlying basic cube for the virtual cube(FM) to read the data from? That shoudl be 0TCT_C01- I guess

  • I lost my MacBook calendar when I performed the action required by 5 May although I have all information on my iPhone and iPad. How do I restore the data on my iCal calendar?

    I have performed all the relevant actions required before 5 May to conform with Apple instructions. I have lost my calendar on my MacBook although all is still OK on my iPhone and iPad. I have tried various ways to restore the data including going to MobileMe but I have been unsuccessful. I have tried to merge the information from my iPhone but this did not work either. My Contacts and mail are all OK. Coincidentally I am also unable to access my external hard drive which is working in itself (it is warm and whirrs when activated) but my back ups are failing. Any ideas out there?

    Hi bsavino2,
    Welcome to the Support Communities!
    The article below may be able to help you with this issue.
    Click on the link to see more details and screenshots. 
    iTunes Store: Changing account information
    http://support.apple.com/kb/HT1918
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Cheers,
    - Judy

  • Error Message: The data provider required to connect to the local data file could not be found. The file will be added to the project but the typed DataSet associated with the file will ont be generated.

    I am currently taking the course "C# Fundamentals" from Bob Tabors site:  LearnVisualStudio.NET .  I'm on day 8 where we are integrating SQL Server with C#.  In Lesson 6 and 7, (havent' gotten past these two) I am having an
    issue.  In Lesson 6, "Retrieving Data with ADONET 2 in a Connected Scenario (SQL Server Compact Edition) when I go to create the data file I get the error message I typed into the title.  I cannot get the db to appear in the Solution
    Explorer, or open up so I can create a table.  When I try to skip by that lesson, and complete lesson7, I'm running into the same basic problem, where the error messages are different but I get an exception when I attempt to run the program.  Even
    though I have been able to create the table for this lesson, the Exception states I have an invalid object name 'Customers' which is the name of the table. I have tried reading several different suggestions for correcting this issue, but have not understood
    exactly what I need to do.  Since I work from home on my computer, I do not want to do anything with files or downloads unless I understand what I need to do, cause I do not want to lose my job.  Any help would be appreciated. 
    JennyBarrett7

    Hi
    According to your error message, we need to verify if Microsoft SQL Server Compact appears in the
    Change Data Source dialog. If not, you need to install
    SQL Server Compact components for Visual Studio firstly, and if you choose to install SQL Server Compact 4.0 , you should note that SQL Server Compact 4.0 supports in Visual Studio 2010 Service Pack 1 or later versions. I recommend you to install the latest
    Service Pack (SP) of SQL Server Compact, and latest SP of Visual Studio, then check if the error still occurs. For more information, see:
    http://blogs.msdn.com/b/sqlservercompact/archive/2011/03/15/sql-server-compact-4-0-tooling-support-in-visual-studio-2010-sp1-and-visual-web-developer-express-2010-sp1.aspx
    However if there is no problem with the installation of SQL Server Compact, it will be an issue that regards ASP.NET and website deployment. I suggest you to post the question in the ASP.NET forums at
    http://forums.asp.net/ . It is appropriate and more experts will assist you.
    In addition, you can review the following link:
    Working with SQL Server Compact in Visual Studio:http://msdn.microsoft.com/en-us/library/gg606540(v=vs.100).aspx
    Thanks
    Lydia Zhang

Maybe you are looking for

  • Word document attachments garbled

    When I try to send a Word document to users outside of my ISP they come through as "noname" This does not happen with TextEdit files or with pdf files. It also doe snot happen when sending attachments to other users in my ISP (Road Runner). The folks

  • Error Message When Making Purchases

    Everytime I try to purchase a song or video on iTunes I get an error message (iTunes has encountered an unknown error -2). Does anyone know what the -2 error code means? I have purchased hundreds of items from iTunes and this was not a problem.

  • Error when install latest ODB with Oracle Designer

    I need to use Oracle Discoverer. So I removed all traces of Oracle from my machine. Installed Oracle Designer Suite. It worked. Then I installed Oracle Data Provider for .NET 9.2.0.2.102.. I got 2 errors during install. One was due to a service (Orac

  • JNDI lookup problem (II)

    after reading the reply from Michael Lehmann and changed to 3101. It did connect to the JNDI! now. the problem turn to the domain/application name in the provider_url: env.put(Context.PROVIDER_URL, "ormi://10.6.208.6:3101/XXX"); my question is how yo

  • EXIT or BADI

    Can anyone provide me any exit or badi for the background execurion of COHVPI ? Moderator message: please do more research before asking, show what you have done yourself when asking. Edited by: Thomas Zloch on Jun 14, 2011 1:18 PM