Can anyone explain me how to create a transparent table(z table) dynamicall

Can anyone explain me how to create a transparent table(z table) dynamically in the program.

Hi,
Look at the below link
http://www.sap-img.com/ab030.htm
Regards
Sudheer

Similar Messages

  • Can anyone explain me how to scale the image in canvas in flash builder 4.6

    Can anyone explain me how to scale the image in canvas in flash builder 4.6, Scaling of image in component , can i get some examples ..  it should set almost all size screen

  • Can anyone explain me "  How to debug updaterules?"

    Can anyone explain me "  How to debug updaterules?"

    Hi ALI,
    Transfer rules and Update rules are the main areas within a BW system where the BW professional can transform your transaction system data into the required format for what ever InfoObject / InfoProvider is being updated.
    Quite often when ABAP is used as part of your transfer and update rules there is a need to debug the code to ensure you don’t introduce any problems into your production environment.
    When data is loaded into a BW system the a background process is used. This means you can not run the data load in debug mode as you would most other programs. What you need to do is run the load program in Simulation mode.
    The first step to take is set a breakpoint in you coded Update/Transfer rule. This can be achieved by:
    •     Setting a breakpoint within the generated program once the rule has been activated.
    •     Locate the code manually during your debug session and setting a break-point.
    •     Hard code a breakpoint in the rule as shown below:
    o     if sy-uname = 'MYUSERID'.
         break.
    o     endif.
    My preferred method is the first option. I try not to hard code breakpoints (second option) as I sometimes forget to remove the code once I have finished debugging and the third option takes I find take too long.
    To set a break-point in the activated code you have to find the activated program and then search for your code that you want to debug. Follow these 4 steps (Update Rule):
    1, View the code for the Update Rule.
    2, Locate the code that you want to debug and remember some content that will identify the code that you need to debug.
    3, Come back out of the code and activate your Update rule. Once activated, select “Display Activated program from the Extra’s menu.
    4, Search for the code that you located in step 2 and set the break-point.
    Once your beak-point has been set you then need to run the update/transfer rule in simulation mode. To achieve this you must have already loaded data into the PSA. Follow these steps:
    1, Navigate to the PSA under the Monitoring section with transaction RSA1. Find the PSA Request that you want to debug and select the ‘Simulate/Cancel update’ option from the right mouse click menu.
    2, The screen will then show the details tab of the InfoPackage Monitor for the specific request. Right-click on a selected Data-Packet and select Simulate.
    3, Select the appropriate ‘Activate Debugging’ option for your rule (Update/transfer). Select the radio button to determine the number of records that you want to process in you debugging session and select the ‘Perform Simulation’ button.
    4, Select the Data Packets, Number of Records and then the continue button.
    5, The update process will start and your screen will show the debug window. Press ‘F8’ to run through your program. It will then stop at the breakpoint you set earlier.
    Regards]
    Anil

  • Hi can anyone explain me how to  syncronize two database using jsp?

    Hi can anyone explain me how to syncronize two database using jsp?

    I thinking than you really need the jsp page for calling the java methods whith sincronize the database.You think wrong.
    You wrote a bad question.What was bad about it?
    You need a java method for sincronize the two databases using a jsp page.No you don't, see my answer.

  • Can anyone tell me how to create a dvd from slideshow on my OSX10.9.5 that i can view on a tv

    can anyone tell me how to create a dvd to play on my tv from a slideshow on my mac

    Not in the Classic forum:
    http://discussions.apple.com/docs/DOC-2463
    Try iLife, iDVD, or iPhoto.  AppleTV may also help.

  • Can anyone explain to how to get rid off restore session on the mozilla firefox it keeps coming up every time i click on mozilla firefox it comes up restore session why is this it is driving me nuts

    can anyone explain to me how to get rid off restore session on the mozilla firefox it keeps coming up every time i click on mozilla firefox it comes up restore session why is this i want to get rid of it it is driving me nuts

    What do you have checked in Firefox Preferences>General?
    Ciao.

  • Can you explain me how to create ALERT

    Hi Experts,
      Can any one explain me how to create alert when we get some exception, and where we can see these alerts. Does it possible to create alerts without using BPM?
    Thanks,
    dhanush

    Hi
    XI/PI: Throwing Generic Exceptions from any type of Mapping
    /people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping
    Throwing Smart Exceptions in XI Graphical Mapping
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    "Fast return" with Java exceptions
    /people/valery.silaev/blog/2007/05/15/fast-return-with-java-exceptions
    Errors, Exceptions, and Asynchronous Web Services
    /people/udi.dahan/blog/2007/03/27/errors-exceptions-and-asynchronous-web-services
    Alerts
    http://help.sap.com/saphelp_nw04/helpdata/en/da/a3a7408f031414e10000000a1550b0/frameset.htm
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    Thanks

  • Can anyone teach me how to create a JTable

    In my project, i would like to make a class extends JTable for which it can function like the excel one.
    This means that the table can split into two parts.
    Each of them have a standalone view and can let user to update the table.

    Had some time to spare so a quick rough example.
    Note this makes use of the TableModel created by JTable when passed an Object[][].
    I'd recommend instead that you create your own TableModel and pass that to both JTables yourself.
    import javax.swing.*;
    import javax.swing.table.*;
    public class SplitTableDemo extends JFrame
       public SplitTableDemo(String title) {
            super(title);
            // prepare data
            int cols = 26;
            int rows = 200;
            Object[][] data = new Object[rows][cols];
            for (int j=0; j<rows; j++) {
                for (int k=0; k<cols; k++) {
                    data[j][k] = new String("");
            // prepare column names
            Object[] columnNames = new Object[cols];
            for (int m=0; m<cols; m++) {
                char c = (char) (65+m);   
                columnNames[m] = String.valueOf(c);
            // create first table view
            JTable upperTable = new JTable(data, columnNames);
            // create second table view with same model (obtained from first)
            TableModel tm = upperTable.getModel();
            JTable lowerTable = new JTable(tm);
            // put tables in ScrollPanes
            JScrollPane upperScroller = new JScrollPane(upperTable);
            JScrollPane lowerScroller = new JScrollPane(lowerTable);
            // display in split pane
            JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, upperScroller, lowerScroller);
            this.getContentPane().add(sp);
       public static void main (String[] args)
          SplitTableDemo splitTableDemo = new SplitTableDemo("Split Table Demo");
          splitTableDemo.pack();
          splitTableDemo.show();
    }

  • Can anyone show me how to create a scheduled app to run

    hi
    i have a application that needs to be run at certain time daily. i was wondering if anyone here can show me how to do that? thanks

    thanks, i have never used either to run java app. however i had used window's schedule task to run other window programs before. is there any sample to use both to run java prgram? thanks

  • Can Anyone Tell Me How to Create Greeting Cards with Photoshop Elements 7 or 8?

    I need a 7x10 page setup so that when the card is folded to a 5x7 my photo is landscape on the outside of the card.  Currently I can only find a 8 1/2 x 11 paper size.
    Thanks,
    Lexington59

    In Photoshop Elements 8 Editor, go to the Create tab, and you will see Greeting card, with 5x7 page size.

  • Can anyone guide me how to create the databse with or without using the GUI

    I need to create the Database from SQL prompt can any body tell me the links where i can find some sample scripts to do that....Thanks

    Hi,
    I would like to mention few stuffs too..
    for manually.
    1. startup nomount pfile=path of the pfile.
    2. run the create datbase script.
    3. run catalog.sql, catproc.sql script.
    that was the brief idea,but you need to create your sample pfile,setting up your dir locations,setting envrmnts variables.
    for gui envrmnts you have DBCA , use it and forget about all the cavtes.
    thanks
    Alok.

  • Hello can anyone explain me how to solve this scenario.

    Hello Experts,
    Today i have attended an interview .. the interviewer has given me this scenario and gave me a system and asked me to solve this scenario practically..
    So this is the scenario.. How to solve can any one send me some idea and if possible probable solution..
    <b>scenario.</b>
    IBM sells Notebooks and Machines through dealers.they provide direct selling to corporates.
    .they give 10% discount to orders of 10 pcs and more.
    <b>scope</b>
    <b>.masters</b>
    maintaining dealers
    maintaining product list and price
    maintainig corporate details.
    <b>transactions</b>
    no of orders placed and delivery date.
    <b>reports</b>
    . dealer wise order report
    . company stock report
    .sales report monthly and yeraly wise.
    So what i am asking you is kindly guide me how to approach to solve this scenario.

    this is the exception,I don't know why this exception exist sometimes and isn't exist sometimes
    java.io.UTFDataFormatException
         at java.io.ObjectInputStream$BlockDataInputStream.readUTFSpan(ObjectInputStream.java:2963)
         at java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(ObjectInputStream.java:2888)
         at java.io.ObjectInputStream$BlockDataInputStream.readUTF(ObjectInputStream.java:2701)
         at java.io.ObjectInputStream.readString(ObjectInputStream.java:1536)
         at java.io.ObjectInputStream.readTypeString(ObjectInputStream.java:1344)
         at java.io.ObjectStreamClass.readNonProxy(ObjectStreamClass.java:540)
         at java.io.ObjectInputStream.readClassDescriptor(ObjectInputStream.java:762)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1503)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
         at REDCSecurity.RSAKeyPair.readFromFile(RSAKeyPair.java:122)
         at REDCTools.USBHandler.getPrivKey(USBHandler.java:99)
         at REDCClient.Disconnected.compare(Disconnected.java:289)
         at REDCClient.Disconnected.authenticate(Disconnected.java:185)
         at REDCClient.Disconnected.connect(Disconnected.java:75)
         at REDCClient.ConnectionAgent.connect(ConnectionAgent.java:28)
         at REDCClient.testConnect.main(testConnect.java:13)

  • How to create a transparent table(z table) dynamically

    Hi,
    Can anyone explain me how to create a transparent table(z table) dynamically in the program.
    Any function module or suggestions welcome.

    Hi Mithun
                 we will not create transparent table in the program . you could do it by using native SQL in the ABAP Program . the sample is show in below .
    This is a sample that show how to connect to Database directly and can use the native SQL to select , create or delete table.
    PARAMETERS dbs TYPE dbcon-con_name default 'SDB'.
    DATA carrid_wa TYPE scarr-carrid.
    DATA lv_int  TYPE i.
    *Types
    data: begin of ty_equi,
    equipment(25) type c,
    SERIALENERGY(25) type c,
    end of ty_equi.
    *Internal Tables
    data it_equi like table of ty_equi.
    data wa_equi like line of it_equi.
    DATA dbtype TYPE dbcon_dbms.
    SELECT SINGLE dbms
           FROM dbcon
           INTO dbtype
           WHERE con_name = dbs.
    IF dbtype = 'ORA'.
      TRY.
          EXEC SQL.
            CONNECT TO :dbs
          ENDEXEC.
          IF sy-subrc <> 0.
            RAISE EXCEPTION TYPE cx_sy_native_sql_error.
          ENDIF.
          EXEC SQL.
            OPEN dbcur FOR
              SELECT
                     EQUIPMENT,
                     SERIALENERGY
                     FROM emd.meter
          ENDEXEC.
          DO.
            EXEC SQL.
              FETCH NEXT dbcur INTO :wa_EQUI
            ENDEXEC.
            IF sy-subrc <> 0.
              EXIT.
            ELSE.
              WRITE: /
              wa_equi-equipment,
              wa_equi-SERIALENERGY.
            ENDIF.
          ENDDO.
          EXEC SQL.
            CLOSE dbcur
          ENDEXEC.
          EXEC SQL.
            DISCONNECT :dbs
          ENDEXEC.
        CATCH cx_sy_native_sql_error.
          MESSAGE `Error in Native SQL.` TYPE 'I'.
      ENDTRY.
    ENDIF.
    Regards
    Wiboon

  • How to create screen resolution in bdc table control

    hi gurus
    can anyone suggest me
    how to create screen resolution in bdc table control
    thanks&regards
    mark.

    Hi ,
    Using CTU_PARAMS table for screen resolution .
    For this sample code.
    This is for Transation  FB60.
    report ZZFB60
           no standard page heading line-size 255.
    tables t100.
    PARAMETERS : p_file1  like  rlgrap-filename,
                 p_doctyp like  RF05A-BUSCS,
                 p_invdat like  INVFO-BLDAT,
                 p_posdat like  INVFO-BUDAT.
    CONSTANTS  :  C_TRANS_FB60(4) VALUE 'FB60'.
    *Parameter string for runtime of CALL TRANSACTION
    data : l_option type ctu_params,
           l_subrc type sysubrc.
    DATA :  l_mstring(150).
    data      accnt type char17.
    data       : day   type char2,
                 month type char2,
                 year  type char4,
                 date1 type char10,
                 date2 type char10.
    data      :  cnt(2) TYPE n,
                 cnt1 type i,
                 fld(25) TYPE c.
    data : begin of excel occurs 0,
            fieldname(255) type c,
           end of excel.
    DATA:BEGIN OF it_mess OCCURS 0,
             msgtyp(5),
             lms(200),
              msgv1(50),
         END OF it_mess.
    data: begin of t_record occurs 0,
             BUKRS(004),
            ACCNT(017),
            XBLNR(016),
            WRBTR1(016),
            WAERS(005),
            SECCO(004) ,
            SGTXT(050),
            HKONT(010),
            WRBTR2(017),
            MWSKZ(002),
            GSBER(004),
            KOSTL(010),
         end of t_record.
    *Internal Table for Header Data
    DATA :  BEGIN OF t_head OCCURS 0,
            BUKRS(004),      "Company Code
            ACCNT(017),      "Account or Vendor
            XBLNR(016),      "Reference
            WRBTR1(017),     "Amount in document currency
            WAERS(005),      "Currency
            SECCO(004),      "Section Code
            SGTXT(050),      "Text
            END OF t_head.
    *Internal table for Item Data
    DATA :  BEGIN OF t_item OCCURS 0,
            ACCNT(017),      "Account
            HKONT(010),     "GL Account
            WRBTR2(017),    "Line item Amount in document currency
            MWSKZ(002),     "Tax Code
            GSBER(004),     " Business Area
            KOSTL(010),     "Cost centre
            END OF t_item.
    DATA: IT_BDCDATA      LIKE  BDCDATA OCCURS 0 WITH HEADER LINE,
          IT_BDC_MESSAGES LIKE  BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    *include bdcrecx1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      PERFORM  file_selection.
      PERFORM  data_upload.
      PERFORM  table_control.
    start-of-selection.
    l_option-defsize = 'X'.
    l_option-dismode = 'A'.
    l_option-updmode = 'S'.
    day = p_invdat+6(2).
    month = p_invdat+4(2).
    year =  p_invdat+0(4).
    concatenate day month year into date1 SEPARATED BY '.'.
    day = p_posdat+6(2).
    month = p_posdat+4(2).
    year =  p_posdat+0(4).
    concatenate day month year into date2 SEPARATED BY '.'.
    *perform open_group.
    loop at t_head.
    CLEAR    IT_BDCDATA.
    REFRESH  IT_BDCDATA.
    perform bdc_dynpro      using   'SAPLACHD'         '1000'.
    perform bdc_field       using   'BDC_OKCODE'        '=ENTR'.
    perform bdc_field       using   'BKPF-BUKRS'        t_head-bukrs.
    perform bdc_dynpro      using   'SAPMF05A'          '1100'.
    perform bdc_field       using   'BDC_OKCODE'        '/00'.
    perform bdc_field       using   'RF05A-BUSCS'       p_doctyp.
    perform bdc_field       using   'INVFO-ACCNT'       t_head-accnt.
    perform bdc_field       using   'INVFO-BLDAT'       date1.
    perform bdc_field       using   'INVFO-BUDAT'       date2.
    perform bdc_field       using   'INVFO-XBLNR'       t_head-xblnr.
    perform bdc_field       using   'INVFO-WRBTR'       t_head-wrbtr1.
    perform bdc_field       using   'INVFO-WAERS'       t_head-waers.
    perform bdc_field       using   'INVFO-SECCO'       t_head-secco.
    perform bdc_field       using   'INVFO-SGTXT'       t_head-sgtxt.
    cnt = 1.
    cnt1 = 1.
    loop at t_item where accnt = t_head-accnt.
    *if cnt > 4.
    *cnt = 4.
    *endif.
    if cnt1 gt 1.
    CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
    perform bdc_field      using   fld                   'X'.
    perform bdc_dynpro      using 'SAPMF05A'          '1100'.
    perform bdc_field       using 'BDC_OKCODE'        '=0005'.
    endif.
    perform bdc_dynpro      using 'SAPMF05A'          '1100'.
    perform bdc_field       using   'BDC_OKCODE'        '/00'.
    CONCATENATE 'ACGL_ITEM-HKONT(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-hkont.
    CONCATENATE 'ACGL_ITEM-WRBTR(' cnt ')' INTO fld.
    perform bdc_field  using       fld                t_item-wrbtr2.
    CONCATENATE 'ACGL_ITEM-MWSKZ(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-mwskz.
    CONCATENATE 'ACGL_ITEM-GSBER(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-gsber.
    CONCATENATE 'ACGL_ITEM-KOSTL(' cnt ')' INTO fld.
    perform bdc_field       using  fld                t_item-kostl.
    perform bdc_field      using  'BDC_CURSOR'  fld.
    *CONCATENATE 'ACGL_ITEM-MARKSP(' cnt ')' INTO fld.
    *perform bdc_field      using   fld                   'X'.
    cnt1 = cnt1 + 1.
    *cnt = cnt + 1.
    *if cnt > 1.
    *perform bdc_dynpro      using 'SAPMF05A'          '1100'.
    *perform bdc_field       using 'BDC_OKCODE'        '=0005'.
    **perform bdc_field       using 'BDC_OKCODE'        '=0006'.
    *endif.
    endloop.
    perform bdc_dynpro      using 'SAPMF05A' '1100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BS'.
    perform bdc_dynpro      using 'SAPMSSY0' '0120'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    *perform bdc_transaction using 'FB60'.
    CALL TRANSACTION C_TRANS_FB60 USING IT_BDCDATA  options from l_option
                                 MESSAGES INTO IT_BDC_MESSAGES.
    perform error.
    perform errordownload.
    endloop.
    *perform close_group.
    *Form  data_upload
    FORM data_upload .
    CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
       FILENAME              =  p_file1
       FILETYPE              = 'DAT'
      TABLES
        DATA_TAB             =  t_record.
    ENDFORM.                    " data_upload
    *Form  file_selection
    FORM file_selection .
    CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  =  syst-cprog
          dynpro_number =  syst-dynnr
          field_name    = 'p_file1'
        IMPORTING
          file_name     =  p_file1.
    ENDFORM.                    " file_selection
    Form  BDC_DYNPRO
    FORM BDC_DYNPRO using program dynpro.
      CLEAR IT_BDCDATA.
      IT_BDCDATA-PROGRAM = PROGRAM.
      IT_BDCDATA-DYNPRO = DYNPRO.
      IT_BDCDATA-DYNBEGIN = 'X'.
      APPEND  IT_BDCDATA.
    endform.
    *Form  BDC_FIELD
    FORM  bdc_field using fnam fval.
      CLEAR  IT_BDCDATA.
      IT_BDCDATA-FNAM = FNAM.
      IT_BDCDATA-FVAL = FVAL.
      APPEND  IT_BDCDATA.
    ENDFORM.
    Table Control
    FORM table_control .
      LOOP AT t_record.
        ON CHANGE OF t_record-accnt.
          MOVE-CORRESPONDING t_record TO t_head.
          APPEND t_head.
        ENDON.
      loop at t_head.
             t_item-accnt   =  t_head-accnt.
             t_item-hkont   =  t_record-hkont.
             t_item-wrbtr2  =  t_record-wrbtr2 .
             t_item-mwskz   =  t_record-mwskz .
             t_item-gsber   =  t_record-gsber .
             t_item-kostl   =  t_record-kostl.
        APPEND t_item.
    endloop.
         If t_record-level = 'H'.
             t_head-bukrs   =  t_record-text1.
             t_head-accnt   =  t_record-text2.
             t_head-xblnr   =  t_record-text3.
             t_head-wrbtr1  =  t_record-text4.
             t_head-waers   =  t_record-text5.
             t_head-secco   =  t_record-text6.
             t_head-sgtxt   =  t_record-text7.
          APPEND t_head.
         else.
            t_item-accnt   =  t_head-accnt.
            t_item-hkont   =  t_record-text1.
            t_item-wrbtr2  =  t_record-text2.
            t_item-mwskz   =  t_record-text3.
            t_item-gsber   =  t_record-text4.
            t_item-kostl   =  t_record-text5.
         APPEND t_item.
         endif.
      ENDLOOP.
    ENDFORM.
    FORM error .
      LOOP AT IT_BDC_MESSAGES.
        IF IT_BDC_MESSAGES-msgtyp = 'E'.
       SELECT single  * FROM t100  WHERE
                                    sprsl = it_BDC_MESSAGES-msgspra
                                    AND   arbgb = IT_BDC_MESSAGES-msgid
                                    AND   msgnr = IT_BDC_MESSAGES-msgnr.
          IF sy-subrc = 0.
            l_mstring = t100-text.
            IF l_mstring CS '&1'.
              REPLACE '&1' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
              REPLACE '&2' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
              REPLACE '&3' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
              REPLACE '&4' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
            ELSE.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv1 INTO l_mstring.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv2 INTO l_mstring.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv3 INTO l_mstring.
              REPLACE '&' WITH IT_BDC_MESSAGES-msgv4 INTO l_mstring.
            ENDIF.
            CONDENSE l_mstring.
            it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
            APPEND it_mess.
          ELSE.
            it_mess-msgtyp = IT_BDC_MESSAGES-msgtyp.
            it_mess-lms = l_mstring.
            it_mess-msgv1 = IT_BDC_MESSAGES-msgv1.
            APPEND it_mess.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDFORM.
    form errordownload.
    *down the internal table to excel file.
    call function 'EXCEL_OLE_STANDARD_DAT'
               EXPORTING
                    file_name                 = 'c:/Error.xls'
               TABLES
                    data_tab                  = it_mess
                    fieldnames                = excel
               EXCEPTIONS
                    file_not_exist            = 1
                    filename_expected         = 2
                    communication_error       = 3
                    ole_object_method_error   = 4
                    ole_object_property_error = 5
                    invalid_filename          = 6
                    invalid_pivot_fields      = 7
                    download_problem          = 8
                    others                    = 9.
    endform.
    Reward if useful
    Regards,
    Narasimha
    Edited by: narasimha marella on May 13, 2008 12:12 PM

  • Can anyone explain this Calendar beheaviour?

    This is my code
    public static void main(String[] args) {
    Calendar checkDate = Calendar.getInstance();
    System.out.println(checkDate.getTime());
    checkDate.set(Calendar.HOUR, 23);
    System.out.println(checkDate.getTime());
    checkDate.set(Calendar.MINUTE, 59);
    System.out.println(checkDate.getTime());
    checkDate.set(Calendar.SECOND, 59);
    System.out.println(checkDate.getTime());
    checkDate.set(Calendar.MILLISECOND, 0);
    System.out.println(checkDate.getTime());
    checkDate.set(Calendar.DAY_OF_MONTH, 1);
    System.out.println(checkDate.getTime());
    checkDate.add(Calendar.DAY_OF_MONTH, -1);
    System.out.println(checkDate.getTime());
    System.out.println("---------------------------------");
    Calendar checkDate2 = Calendar.getInstance();
    checkDate2.set(Calendar.HOUR, 23);
    checkDate2.set(Calendar.MINUTE, 59);
    checkDate2.set(Calendar.SECOND, 59);
    checkDate2.set(Calendar.MILLISECOND, 0);
    checkDate2.set(Calendar.DAY_OF_MONTH, 1);
    checkDate2.add(Calendar.DAY_OF_MONTH, -1);
    System.out.println(checkDate2.getTime());
    So i'm basically doing twice the same, but the second time without the sysouts.
    But the output is:
    Thu Nov 08 18:18:43 CET 2007
    Fri Nov 09 11:18:43 CET 2007
    Fri Nov 09 11:59:43 CET 2007
    Fri Nov 09 11:59:59 CET 2007
    Fri Nov 09 11:59:59 CET 2007
    Thu Nov 01 11:59:59 CET 2007
    Wed Oct 31 11:59:59 CET 2007
    Thu Nov 01 11:59:59 CET 2007
    Can anyone explain me how this is possible?

    Cinnam wrote:
    practissum wrote:
    Here we go - use HOUR_OF_DAY instead of HOUR. I have no idea why, but this seems to work. Anyone out there have any ideas?Yes, that does the trick. My explanation would be that HOUR is used for 12 hour cycle, HOUR_OF_DAY is for 24 hour cycle. The calendar is in lenient mode because it didn't throw an exception when the OP was HOUR with the value 23. That means it will accept the value 23 and will recompute the other fields - it will basically set the hour to 11 and then add 12 hours. I guess the fields don't get recomputed if some get() isn't called, which is why the System.out.println() makes a difference.Ahh, that would make a lot of sense. I'll accept it as a valid answer/explanation. But, of course, I suppose the only person who has to do that is the OP...
    Anyhow, from my perspective, thanks!

Maybe you are looking for

  • Lenono Vibe X2 Battery Die even when phone is not being used

    HI, I baught Lenovo Vibe X2 couple of months back, and I continuously noticed that the battery of my phone die within 4-5 hours. Even i am not using my phone at all it doesn't work for more then 7-8 hours.  I am seriously not able to understand what

  • Applet won't initialize when testing Applet

    I compiled my file with no errors, yet when I test the Applet it tells me that it can not initialize, can anyone help me. Thanks

  • Fusion middleware 12c products install sequence

    Hello, I'm working on a project that requires following 12c products : - Oracle Enterprise Repository (V59651-01.zip file) - Oracle SOA Suite and BPM (V44420-01.zip file) - Oracle Service Bus (V44423-01.zip file) - Oracle Event Processing (V44422-01.

  • How to fix flash player, it recognizes my microphone, but doesn't record sound on websites?

    We shortly I wanted to record something on http://www.musipedia.org/microphone.html so it asked me to allow usage of adobe flash player and when I wanted to record sound he didn't do it so i got to settings and checked microphone it was there and it

  • BI7.0 Portal buffer clear

    Hi, I have assigned the iviews to roles which got migrated from BW abap to BW Portal by synchroizing the roles.  But when user loggs in he is not seeing the reports.  How to clear the buffer or cahse in BI Portal Thanks Naveen