Skip to Content

About Date

Hey guys I need an help regarding Calendar functions.

As i am beginner in netweaver...

i was able to display the system date n time

but the problem is that i want the previous and next week dates.

the code which i have done is as follows which moves only one week previous n next...

i want it to move successively previous n next....plz help

thanx in advance.....

Calendar cal = Calendar.getInstance();

java.sql.Date sqlDate1 = new java.sql.Date(cal.getTime().getTime());

cal.setFirstDayOfWeek(Calendar.MONDAY);

cal.setMinimalDaysInFirstWeek(1);

cal.set(Calendar.WEEK_OF_YEAR, wdContext.currentContextElement().getSweek()-1);

cal.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);

java.util.Date weekDate = cal.getTime();

DateFormat formatter = DateFormat.getDateInstance(3);

String result = formatter.format( weekDate);

cal.set(Calendar.DAY_OF_WEEK, Calendar.FRIDAY);

java.util.Date weekDate1 = cal.getTime();

DateFormat formatter1 = DateFormat.getDateInstance(3);

String result1 = formatter.format( weekDate1);

wdContext.currentContextElement().setWeek(result" to "result1);

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 03:57 PM

    I think that you need to post this question in the ABAP forum.

    Regards,

    Graham

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.