How to know the which week in GregorianCalendar API

Dear all
does someone know that way when i use GregorianCalendar this API to know the which week is
for example in this month has 6 week and 2008/08/27 is week 5 , dose any idea i can know it in this program
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Date;
import java.text.DateFormat;
public class DateExample5 {
     public static void main(String[] args) {
          DateFormat dateFormat =
          DateFormat.getDateInstance(DateFormat.FULL);
          // Create our Gregorian Calendar.
          //GregorianCalendar cal = new GregorianCalendar(2008,05,10);
          GregorianCalendar cal = new GregorianCalendar();
          //cal.setTime(new Date());
          System.out.println("System Date: " +dateFormat.format(cal.getTime()));
          // Set the day of week to FRIDAY
          cal.set(GregorianCalendar.DAY_OF_WEEK,GregorianCalendar.SUNDAY);
          System.out.println("After Setting Day of Week to Friday: " + dateFormat.format(cal.getTime()));
          cal.set(GregorianCalendar.DAY_OF_WEEK,GregorianCalendar.MONDAY);
          System.out.println("After Setting Day of Week to Friday: " +dateFormat.format(cal.getTime()));
          cal.set(GregorianCalendar.DAY_OF_WEEK,GregorianCalendar.TUESDAY);
          System.out.println("After Setting Day of Week to Friday: " +dateFormat.format(cal.getTime()));
          cal.set(GregorianCalendar.DAY_OF_WEEK,GregorianCalendar.WEDNESDAY);
          System.out.println("After Setting Day of Week to Friday: " +dateFormat.format(cal.getTime()));
          cal.set(GregorianCalendar.DAY_OF_WEEK,GregorianCalendar.THURSDAY);
          System.out.println("After Setting Day of Week to Friday: " +dateFormat.format(cal.getTime()));
          cal.set(GregorianCalendar.DAY_OF_WEEK,GregorianCalendar.FRIDAY);
          System.out.println("After Setting Day of Week to Friday: " +dateFormat.format(cal.getTime()));
          cal.set(GregorianCalendar.DAY_OF_WEEK,GregorianCalendar.SATURDAY);
          System.out.println("After Setting Day of Week to Friday: " +dateFormat.format(cal.getTime()));
          cal.add(GregorianCalendar.DAY_OF_MONTH,7);
}Edited by: roger5089 on Aug 26, 2008 9:25 AM

import java.util.Calendar;
import static java.util.Calendar.WEEK_OF_MONTH;
public class DateExample5 {
    public static void main(String[] args) {
        Calendar cal = Calendar.getInstance();
        int weekOfMonth = cal.get(WEEK_OF_MONTH);
        System.out.println(weekOfMonth); //5
}Never used Calendar.WEEK_OF_MONTH, but I had a butcher's hook and found this documentation:
<quote>
Field number for get and set indicating the week number within the current month. The first week of the month, as defined by getFirstDayOfWeek() and getMinimalDaysInFirstWeek(), has value 1. Subclasses define the value of WEEK_OF_MONTH for days before the first week of the month.
</quote>

Similar Messages

  • How to know the which add-ons my sap system Have

    AS per Note 1318299 - SAP Enhancement Package 5 for SAP ERP 6.0:Compatible Add-ons
    Symptom
    You plan to run SAP enhancement package 5 for SAP ERP 6.0 together with an Add-On on the same system. Which points do you need to consider?
    Other terms
    AddOn; add-on; Enhancement Package; compatibility;
    Solution
    In general, please check whether your Add-On supplier has released your specific Add-On for usage with SAP enhancement package 5 for SAP ERP 6.0.
    If you have a solution categorized as '(Standard) Custom Development' for your ERP system, please contact SAP Custom Development at least three months before implementing SAP enhancement package 5 for ERP 6.0, because sufficient time might be required in case of adjustments.
    If you find the add-on you are looking for neither in the list below nor in the related notes, please contact SAP Support (for SAP Products) or the specific partner (non SAP-Products).
    Then my question is, how can i find, the add-ons present in my windows/oracle ECC 6.0 installation.

    HI
    All componets are add-on installed in your system. If you want select according technical usages in mantienance optimazer for EHP5 see sap  Note 1324838 - Enhancement package 5 for SAP ERP 6.0: Required SWC
    In the attachments you found a table with Technical usages - add on.
    When you select your technical usages then appear add-on that will be upgrade.
    Regards
    William Neira

  • How to know the consumer_group belong to which plan

    Dear all,
    How to know the consumer_group belong to which plan? I found a consumer_group name TEST in table DBA_RSRC_CONSUMER_GROUPS
    , but I can not locate it belong to which Plan.

    Do you have enterprise manager db console configured, then its easy to drill to find that information through few clicks. Not sure what's the sql query to get it. if you find one then do post here.

  • How to know the full path which is being used in the dataconnection .

    How to know the full path which is being used in the dataconnection without going and looking into coding.
    I am new to crystal reports.
    Plz advice.Thanks in advance
    Jay

    This forum is dedicated to topics related to custom application development or deployment with Crystal Reports in .Net. This includes full versions of Crystal Reports as well as those versions of Crystal Reports bundled with Microsoft Visual Studio .Net.
    As you do not want to do any coding, this query is in the wrong forum. However, in most versions of Crystal Reports, you can look up the database connection information by simply opening the report in the CR designer. Then go to the database menu and select "Set Datasource Location..."
    Ludek

  • HT201407 how to know under which carrier has the phone been issued

    how to know under which carrier has the phone been issued

    If you bought it from an authorized Apple reseller, it should say on the receipt. If you bought it from a private seller, ask that seller, or call Apple Support and they may be able to tell you.
    Regards.

  • How to get the current week from sysdate?

    Hi sir,
    i want to know how to get the current week from sysdate?
    thanks

    Hi Nicolas
    It seems you like to check my post and also make commend ;) thanks for your attention
    Have you ever read the posts above and given solutions ?Yes, I did
    Have you read the docs ? Yes, I checked
    What's the added value here ?Did youYou shared doc with solution(long one), I shared short one which point same solution(Check what Joel posted)..So what is benefit, As you can guess oracle docs are sometimes become so complicated as specialy for beginner...(At least it was like that for me and Belive me somedocs are still sooo complicated even for oracle coworkers ) But for you I dont know ;)
    => Why writting the PS in bold ?Why.. Let me think... Ohh Maybe I am looking some questions(many) and even user get answer they should not changed status so I am reading some posts and try to get problem and loosing time..
    So I am putting that PS wiht BOLD because I dont wanna lose time my friend ;) Because While I am trying to help ppl here In same time I am trying to giving support to my customer prod systems. Which mean time is very important for me...
    Hope my answer could satisfy you..
    One important PS for you.. You may not like my posts (or someone) but my friend I become tired to read&answer and make commend to on your comment which is about my posts.
    I am not newbie in forum(At least I fell like that) and I belive I know how I should make post..
    Thank you
    Regards
    Helios

  • How to know the dynamic values for this :AND category_id_query IN (1, :3, )

    Hi Team,
    R12 Instance :
    Oracle Installed Base Agent User Responsibility --> Item Instances -->
    Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
    In the above page there are two table regions.
    Notes.
    -------------------------------------Table Region---------------------------
    Attachments
    -------------------------------------Table Region---------------------------
    --the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
    I want to know what are the document types are displayed in this page ?
    --We developed a custom program to attach the attachments to the  services contracts and the above seeded OAF page displays those ..as needed.
    But after recent changes..the Attachments--> table region is not showing the attachments.
    I have verified the query..and could not find any clue in that..
    but i need some help if you guys can provide..
    SELECT *
    FROM
    *(SELECT d.DOCUMENT_ID,*
    d.DATATYPE_ID,
    d.DATATYPE_NAME,
    d.DESCRIPTION,
    DECODE(d.FILE_NAME, NULL,
    *(SELECT message_text*
    FROM fnd_new_messages
    WHERE message_name = 'FND_UNDEFINED'
    AND application_id = 0
    AND language_code  = userenv('LANG')
    *), d.FILE_NAME)FileName,*
    d.MEDIA_ID,
    d.CATEGORY_ID,
    d.DM_NODE,
    d.DM_FOLDER_PATH,
    d.DM_TYPE,
    d.DM_DOCUMENT_ID,
    d.DM_VERSION_NUMBER,
    ad.ATTACHED_DOCUMENT_ID,
    ad.ENTITY_NAME,
    ad.PK1_VALUE,
    ad.PK2_VALUE,
    ad.PK3_VALUE,
    ad.PK4_VALUE,
    ad.PK5_VALUE,
    d.usage_type,
    d.security_type,
    d.security_id,
    ad.category_id attachment_catgeory_id,
    ad.status,
    d.storage_type,
    d.image_type,
    d.START_DATE_ACTIVE,
    d.END_DATE_ACTIVE,
    d.REQUEST_ID,
    d.PROGRAM_APPLICATION_ID,
    d.PROGRAM_ID,
    d.category_description,
    d.publish_flag,
    DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
    d.URL,
    d.TITLE
    FROM FND_DOCUMENTS_VL d,
    FND_ATTACHED_DOCUMENTS ad
    WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
    *) QRSLT*
    WHERE ((entity_name    ='OKC_K_HEADERS_V'-- :1
    AND pk1_value          IN ( 600144,599046) --:2
    AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    AND datatype_id       IN (6,2,1,5)
    AND (SECURITY_TYPE     =4
    OR PUBLISH_FLAG        ='Y')))
    --='000180931' -- 'ADP118'
    The above seeded query is the one which is used for table region to retrieve the data..
    how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    --Sridhar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Patricia,
    is it working for restricted key figure and calculated key figure ??
    Note Number Fisc Period Opening Days
    1 1 2
    2 1 3
    3 1 0
    because I have other restriction, so I create two restricted key figure..
    RK1  with restriction :  Total Number of Note,
    RK2  with restriction :  Total Opening Days ,
    then I Created a calculated key figure, average opening days in a period
    CK1 = RK2 / RK1..
    in this case, I am not sure if it will work or not..
    for example, during RK2 calclation, it might be this   2+3 = 5, the line with 0 will be ignored..
    during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
    could you please confirm..

  • With a contract number, how to know the total PO release value against it?

    Usually one contract corresponds to multiple PO records, now we know the contract number, then how to know the total PO release value against this contract.  In other word, we would like to know the total release value of all the POs with the same contract number.  To just input the contract number in EKPO table? but then look for which field in this table to add these PO release values up?
    We will give you reward points!
    Thanks!

    hi Mohammad,
    By following your instruction, input the contract number 4800000112 into Document number field, then hit Enter, get the following (only copy two records here for example), but kind of a mess.  Could you let us know which one is the PO release value for this contract?
    Contract   Type Vendor     Name                                 PGp Agmt. date
      Item  Material           Short text                               Mat. group
      D I A Plnt SLoc                 Targ.qty. Un       Net price  Curr.   per Un
    4800000112 WK   2000012012 GULF INTERSTATE FIELD SERVICES       QBH 06/20/2006
    Agreement start06/20/2006 Agreement end 12/31/2007
    Tgt. val.        1,000,000.00  USD   Open          1,000,000.00 USD   100.00 %
      00001                    Inspection Svcs, Construction            R3VNI
      L   U                                  0  UL            0.00  USD       1 EA
      00002                    Chief Inspector                          R3VNI
      L   U                                  0  DAY         390.00  USD       1 DAY

  • How to know the class method behind an enterprise service

    Hi,
    SAP has provided enterprise services for Room booking in Real Estate module. They are even shipping the complete application for a nominal price. But the standard version is not suitable for our client requirement so they want to develop this application inhouse.
    Now my question is:  I know the enterprise services used in this application. How to know the implementing methods behind these enterprise services ?
    If possible suggest which approach will be a better option for the inhouse development.
    1. Webdynpro ABAP and use directly methods behind the enterprise services.
    2. Webdynpro ABAP and create client proxy class for the enterprise services.
    3. Webdynpro JAVA and use the enterprise services.
    4. Using visual composer modelling the application.
    Please suggest the best alternative.
    Best Regards,
    Aleem Mohiuddin.

    Hi
    They are even shipping the complete application for a nominal price. But the standard version is not suitable for our client requirement so they want to develop this application inhouse.
    I assume you are talking about xApps.
    How to know the implementing methods behind these enterprise services ?
    In sproxy transaction you can search service and then you can see class and method implemented behind that particular service.
    1. Webdynpro ABAP and use directly methods behind the enterprise services.
    In my opinion not recommended to bypass ES and use method behind it.
    2. Webdynpro ABAP and create client proxy class for the enterprise services.
    Not sure why you want to create proxy of ES.
    3. Webdynpro JAVA and use the enterprise services.
    4. Using visual composer modelling the application.
    You can use either Webdynpro (ABAP or Java) or VC to model your application which consume ES in backend. Both options are good, you can chose Java or ABAP flavor of dynpro based on skill available in team. VC is very effective in rapid modelling and can be used in protyping or in development of complete application.
    Regards,
    Gourav

  • How to know the amount of ora 11g page-out  memory (sga and pga)?

    How to know the amount of oracle 11g page-out memory ( sga and pga) in the SunSolaris 10 Unix and Linux.
    I need to know how many oracle memory are being page-out ( all and for a one oracle server process).
    thanks

    You can monitor the paging with vmstat or sar commands.
    http://download.oracle.com/docs/cd/B28359_01/server.111/b32009/tuning.htm#sthref500
    You can also get the paging information on OEM home page if configured for your database.
    But I don't know if there exists a method with which one can find out how much memory per session/server process is getting paged out.

  • How to know the total page number of the standard report

    How to know the total page number of the standard report?
    If I insert a graph, a table, or text into the end of the standard report, how to know how much space is left for the current page?

    Hello Net,
    Unfortunately, we do not have any VIs in LabVIEW that can figure out the number of pages of a standard report. However, with the use of ActiveX calls you can achieve this task. Here are a couple of discussion forums which discuss this:
    Excel Page Numbering with ActiveX:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=194479&requireLogin=False
    Number Pages in Word Report:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=162972&requireLogin=False
    There is also great documentation on using ActiveX on msdn. You can search this document for page number objects. Here is a link to this:
     http://msdn2.microsoft.com/en-us/library/aa223048(​office.11).aspx
    Please refer to these links. If you still have questions please feel free to let us know so we can assist you.
    Thank you
    Best Regards,
    Dominic L.

  • Hi, how to know the standard routines.........

    hi,
    sap gurus,
    how to know the standrad routines
    user exits
    functional module exits
    field exits
    used to process the business transaction
    balaji.t
    09990019711

    hi,
    you can find the enhancements that can be done in SD under
    SPRO > SD > System Modifications. Here you can find the list of enhancements which will contain exits that can be used at order,delivery, billing etc. Also you can add new fields to pricing field catalog.
    To see the all the available routines, used in copy controls,pricing routines, forumulas please see t.code VOFM.
    Balaji, can i please request you to close your previous threads if they are answered by rewarding all the useful answers.
    regards
    sadhu kishore

  • How to know the Function Module of a standard datasource?

    Hi All,
    As per my understanding there will be an underlying Function Module for each SAP BI datasource. But I dont know how to know the name of that  Function Module for a particular datasource.Could anybody pls help me as i am need of this urgently.
    Thanks in advance.
    Regards,
    kp

    Run transaction RSO2 and enter the required datasource whether transaction data, MD attributes or Text then click on display.  In the message pain and the bottom of the gui it will tell you which function module said datasource uses for extraction.
    Cheers
    Craig

  • How to know the User name and date, who executed the report last time.

    Hi All,
    We are collecting a list of reports which are not executed for past 3 months. Can anybody tell me how to know the username and date they executed the report last time.
    Is there any table to look ? or is there any process ?
    Thanks,
    Ravi.

    Ravi,
    Use SE16 - then look at rszcompdir.
    We look up Version = 13 for queries.
    Regards
    Gill

  • How to know the select statement perfomence

    how to know the select statement perfomence. suppose i have 10 select statements in my program. how will i know which select statement not performance wise poor.

    Go to ST04/
    Click on Detail Analysis menu button.
    Click on the SQL Request button.
    In the pup up give <table name> and execute.
    Then you will get a list of all the programs that have a select on that table.
    Or ST05 transaction t start the trace and run your program .Deactivate the trace in st05 .
    and display the trace.
    Regards,
    Ravi

Maybe you are looking for

  • How do you update a later version of the iPod touch? Mine dosen't have the update button in settings.

    I am confused because I downloaded on the computer the newest iTunes and it is not updating when I plug it in........How do I update my iOS 4.1 iPod to the newest iOS??? Please help. Thanks!

  • Upgrade to Photoshop CS5 from CS3/CS2/6.0

    I purchased Adobe Photoshop 6.0, then upgraded to CS2, then CS3. Can I upgrade to CS5? If so, can I install the trial and later activate it once I have the key? Since the key is an upgrade key, what is it going to ask for to verify the fact that the

  • Problem in Mail with signatures

    Has anyone experienced this? I'm running Leopard and using two different user identities("A" and "B" on my macbook. In one identity "A", I use signatures in Mail for two different email accounts. Sometimes I log out of identity "A" and use Mail in id

  • How to pass variable in the place of numeric value?

    Hi, my requirement is i want to validate the selection screen block width. I have created tabbed selection screen. i need in which variable tab lengh values will be stored ex:- selection-screen: begin of tabbed block MYTAB for 10 lines,              

  • Running Sun App Server 7 and 8 on the same box

    Hello, Are there any known issues with running Sun App Server 7 and 8 in the same host box ? Currently I am encountering some class not found exceptions with Sun App Server 8 . Sun App Server 7 runs just fine. Thanks, Aswin.