Toplink Cache not getting refreshed after executing UpdateAllQuery

After executing UpdateAllQuery, the records in the database are getting updated, however the Toplink cache is not getting refreshed with the new data, it still has stale data which is causing issues.
We're also setting
updateQuery.setCacheUsage(UpdateAllQuery.INVALIDATE_CACHE);
Thanks.

Toplink version is 10.1.3.0.0
Here is the code
UpdateAllQuery updateQuery = new UpdateAllQuery(RegisterImpl.class);
updateQuery.setCacheUsage(UpdateAllQuery.INVALIDATE_CACHE);
ExpressionBuilder registerBuilder = updateQuery.getExpressionBuilder();
updateQuery.addArgument("userIdArg");
updateQuery.addArgument("channelArg");
updateQuery.addArgument("tokenArg");
updateQuery.addArgument("dateArg");
updateQuery.addArgument("businessFuncIdArg");
Expression reservedDetailRegExp = registerBuilder.get("reservedDetail");
// build expressions
Expression userIdExp = reservedDetailRegExp.get("userId").equal(
registerBuilder.getParameter("userIdArg"));
Expression channelExp = reservedDetailRegExp.get("channel").equal(
registerBuilder.getParameter("channelArg"));
Expression tokenExp = reservedDetailRegExp.get("token").equal(
registerBuilder.getParameter("tokenArg"));
Expression dateExp = reservedDetailRegExp.get("date").equal(
registerBuilder.getParameter("dateArg"));
Expression busFuncExp = registerBuilder.get("businessFuncId").equal(
registerBuilder.getParameter("businessFuncIdArg"));
// set selection criteria
updateQuery.setSelectionCriteria(userIdExp.and(channelExp.and(tokenExp.and(dateExp
.and(busFuncExp)))));
// substitute the values
updateQuery.addUpdate(reservedDetailRegExp.get("userId"), "");
updateQuery.addUpdate(reservedDetailRegExp.get("channel"), "");
updateQuery.addUpdate(reservedDetailRegExp.get("token"), "");
updateQuery.addUpdate(reservedDetailRegExp.get("date"), "");
updateQuery.addUpdate(registerBuilder.get("businessFuncId"), "");
In the object model for the query, the RegisterImpl has an aggregate mapping (ReservedDetail), which in turn has a number of direct-to-field mappings and an one-to-one mapping to businessFunction (for our query we use a direct query key "businessFuncId")

Similar Messages

  • Report is not getting refreshed after changing prompts once again?

    HI,
    I am running some webi and deski reports using webi sdk also i'm handling the prompts of
    report.
    Problem is that if i ran the parametrized webi or deski report then my application shows the prompt page
    then i fill all the prompt for the report it shows the data for selected prompt values.
    But if i once again changed prompt values it shows data of previously selected prompt values not for
    the currently changed prompt values. means reports not getting refreshed.
    sometimes its work correctly.
    What will be problem?
    How can i resolve this issues?
    Please help me
    Thanks in advance
    Harshad

    The workflow is:
    1. Refresh
    2. Set Prompts
    3. Get View.
    then repeat.
    Are you refreshing before setting prompts?
    Sincerely,
    Ted Ueda

  • ADF Region not getting refreshed after Commit

    Hi everyone!
    I'm having some trouble with a region that is disturbing me for more than 2 weeks, its true guys, I tried everything!!
    My parent page is a normal ADF .jspx page that contains inside it a task-flow call. The first task-flow activity is a router, after sending a String
    to router it chooses the region activity that fits the page (in this example I always pass the same value, same String).
    After the router is called then it delegates to "ExecuteWithParams" method call before calling my final region that have its query executed with
    parameter set inside task-flow.
    The region is refreshed (refresh="ifNeeded") when I change row inside a table in ParentPage, all fine here.
    The problem is:
    - After any Commit (with navigation case or executable binding) is issued inside Region the region save its state and does not refresh anymore, even if task-flow parameters change.
    Already tried CacheResults="false" on iterator too.
    I'm using Jdeveloper 11.1.2.1.
    Thanks in advance!!

    Hi,
    so I think the shirt summary of your problem is that an ADF region doesn't refresh after it issued a commit. Sounds like a bug to me if this reproduces in a test case. Do you have a testcase based on the Oracle HR schema ? If so, send it my way in a zip file you rename to ".unzip". My mail address is in my OTN profile. Note that bugs I file are not visible to customers. So if you need to keep track of any state of the issue, you need to file a service request with support yourself.
    Frank

  • Cube does not get refreshed after maitainence

    Hi
    I have a cube in a schema that was existing.
    I have added new data to the fact table that is mapped to the cube.
    I maintained the cube by using the complete refresh option in the analytical workspace manager.
    After maintaining the cube and selecting from the cube view I do not see the new data that I have added.
    I have even tried dropping and recreating the cube but still it does not work.
    I have also tried adding the clean step for all measures and yet it does not work.
    Creating the cube with a different view name is a solution but that is not what I want. I want to be able to refresh the same view.
    Please advise / suggest
    Edited by: CelestialCitizen on Sep 4, 2011 9:53 PM

    Hi All
    The above is a false alarm.
    Basically it turned out that one of the keys in the fact table was not a leaf node in the dimension.
    After rectifying that all works fine now.

  • Toplink Cache not refreshed

    In my project, TOPLINK is used. To carry out the CRUD operation, Stored procedures are used on all objectcs.
    Toplink query is not used.
    In some cases, since we wanted to use the existing Stored procedures for running the business logic, toplink is not used.
    After running these procedures, we refresh the Toplink Cache by using "refreshObject(java.lang.Object p1)" method of UnitOfWork before we read the Object.
    When we read this object, the data appears to be in sinc with what is present in the database tables.
    But when we write the data once again to the database, Toplink some how refers to the Old data ( Data which was present before refreshing).
    It seems to be a strange issue.
    Kindly help.

    If you call refresh on an object already loaded in the UnitOfWork, and the object was modified before you call refresh, the refresh will override the modification done to the object.
    You should never need to call refresh.
    What you should do instead of refresh is to invalidate on session cache so when ever you read the object later, it will be refresh if was invalidated, so more efficient.
    If you use TopLink 11 JPA api you need to flush to get current transaction/uow see the modified data in db.
    But realistically, stored procedure do not work well with O-R framework, and you say Toplink query is not used, why not removing TopLink from the equation? If you want better JDBC you can use iBatis or Spring.

  • Data is not Getting refresh in Dashboard

    Hi I have implemented Xcelsius on the top of SAP BI System.
    I have the following architecture -
    SAP BI Cube --> BO XI 3.1 Universe Based on Cube --> QWaaS on the Universe --> Xcelsius Dashboard on the QWaas.
    When i created a dashboard and run it , it worked fine and showed me data , which is lying in Cube.
    But When the Data get updated in Cube and i again refresh the Dashboard , It still showing me the old data , the Data is not getting refresh in Dashboard .
    what could be the possible casue ?
    Is QWaas always fetch the dat at run time ?
    Thanks

    QaaWS web service call needs to be invoked to get the data updates from the datasource. Xcelsius provides several options to command how frequently web services connections are calle/refreshed ('refresh on load', 'refresh every X seconds' or trigger cells...).
    You should also keep in mind, that, since QaaWS hits datasource each time web service is called, this can bring some performance issues (web service calls WebI server to run corresponding query, which performs a refresh). In order to mitigate this, since XI 3.0, QaaWS features a cache mechanism, that is used to store data results from each query refresh (corresponding to a web service call), in order to serve it again with better efficiency, in case same request is performed during a specific time interval (which typically corresponds to dashboard interactions).
    Cache sessions are sorted according to the user names and prompt values used, cache is emptied after a defauilt duration without any interaction (request from the same session).
    Cache timeout duration is set for each QaaWS query, and can be tuned from QaaWS Designer when modifying/creating the query : go to Advanced... button on first step of query edition wizard, cache lifetime corresponds to timeout value (in seconds) displayed on Advanced parameter panel (default value being set to 60 seconds).
    Cache lifetime may also be an explanation why you do not see data refreshed (if you are with QaaWS XI 3.0 or later).
    Hope that helps,
    David.

  • Tree Table is not getting refreshed properly in Jdev 11.1.2.0

    Hi,
    I am seeing a peculiar issue with tree table not getting refreshed in Jdev 11.1.2.0.
    Let me explain you my use case.
    I have a tree table in a page, where the first column is displayed as selectBooleanRadio component. When user selects this selectBooleanRadio component, that treetable node should get expanded and at the same time all the child records(I have a select boolean check box component(transient attribute) at the child level) for that node should get selected. This is to allow user to unselect the child records, which he/she does not want to process further(some functionality).
    Now when the user selects any radio button, the tree table node is not expanded, but the arrow beside the radio button for that node can be seen as expanded.
    I thought it may be a partial trigger issue, so i tried refreshing the tree table programatically as well. But it was of no use.
    Then I set the partial triggers wrt to SelectBooleanRadio component on the parent container of the TreeTable. After which somehow the node got expanded but the tree table shrinks in width and the actual disclosure functionality of a tree table is lost.
    The same use case works perfectly fine in Jdev 11.1.1.5.
    For reference:
    I created a sample test case(Dept/Emp) in jdev version 11.1.1.5, which works fine. Workspace: http://adf-use-cases.googlecode.com/files/TreeTable1.rar
    But the same test case, when i created in jdev version 11.1.2.0, gives issues. Workspace: http://adf-use-cases.googlecode.com/files/TreeTableUseCase.rar
    If you download the application and run in respective jdev version, you will get to know more about the issue.
    Please let me know, If I am doing anything wrong in the implementation of this use case.
    Any help/suggestions are appreciated.
    Thanks
    Umesh
    Note: My complete application is in Jdev 11.1.2.0, so I can't degrade my jdev version to 11.1.1.5.

    Thanks Frank for the reply.
    But upgrading the jdeveloper to 11.1.2.2 is not an ideal solution for us now, because of the size of the project.
    Some how, the issue of refreshing the tree table is resolved. I am using a command button with clientComponent to true and causing a full page refresh.
    I am not sure, if this is a perfect solution.
    As you said, that this behavior may be an issue with the Jdev version 11.1.2.0, I am using. I am going with the above said approach.

  • Screen fields not getting displayed after Line 16

    Hi All,
    There is a screen exit created in IW51, now the new requirment is to add 3 more fields.  I added the fields below the exiting fields, in line number 15 , 16 &17. After executing the Tcode I could find that the field created in line 17 is not getting displayed in runtime. I have increased the screen length. The fields if moved to line numbers below 16 then they are getting displayed. Can anyone help me to find why it is not getting displayed after line 16.

    Hi,
    Can you give me the Enhancement name?
    I searched for the exits using package , but i did not find any screen exists for that IW51 Tcode?

  • Cell data not getting refreshed in which user enters data OO ALV(editable)

    Hi Friends,
    I am using OO ALV for editable grid display.
    I am unable to change grid data in the cell in which user enters something, using OO ALV. Did through debugging of my own program and found that some problem with system program. Then I did all system debugging. Could not find out why is the grid not getting refreshed with the new data in the cell in which user had entered some value. Rest of the cell's data are getting refreshed with the values which i am updating in the final internal table. I can see that the data in the final internal table is changed for the cell in which user enters data. But even after the call of
          CALL METHOD obj_alvgrid1->refresh_table_display
    does not refreshes the data in the cell in which user had entered data. Rest of the cells data are getting refreshed.
    Piece of code:
      SET HANDLER obj_event_receiver->handle_data_changed
                                         FOR obj_alvgrid1.
        METHODS: handle_data_changed
                       FOR EVENT data_changed OF cl_gui_alv_grid
                           IMPORTING er_data_changed
                                     e_onf4
                                     e_onf4_before
                                     e_onf4_after.
    METHOD handle_data_changed.
      DATA : v_valid    TYPE char1,
             v_refresh  TYPE char1.
    *--check mt_good_cells semantically
      CALL METHOD perform_semantic_checks( er_data_changed ).
    *--If PBO is again visited, just refresh the ALV grid.
      CALL METHOD obj_alvgrid1->refresh_table_display
        EXCEPTIONS
          finished = 1
          OTHERS   = 2.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
    ENDMETHOD.
    METHOD perform_semantic_checks.
        LOOP AT er_data_changed->mt_good_cells INTO w_good.
          v_index = sy-tabix.
          CASE w_good-fieldname.
            WHEN 'ZASCAS'.
    *Now here based on some conditions I am changing my final internal table i_zamtsmatnp
                              MODIFY i_zamtsmatnp FROM w_zamtsmatnp INDEX
                                               w_good-row_id TRANSPORTING
                                                 zascas modif.
    User enters data in zascas field. Based on the data entered, I am changing other fields which is getting refreshed. I am also changing zascas in the program even after user had already entered the value which was bit wrong and i am correcting it in the program on the even "data_changed" even.
    Please help me friends as i m strugling past hours wondering why the data is not getting refreshed for the cell in which user enter data.
    Regards,
    Surya

    Hi Surya,
       The approach you are following is correct. You need to use the comibnation of all these things:
    Event - DATA_CHANGED
    Methods - CHECK_CHANGED_DATA
                 -  GET_CHANGED_DATA.
    However, here are few standard programs which are having similar functionality.
    BCALV_EDIT_03
    BCALV_EDIT_07
    Check out these once.
    Note: If anything is helpful, dont forget to reward points
    Thanks,
    Adithya K
    SAP Practise
    [email protected]

  • Selection Screen getting refreshed after execution..

    Hello All,
    I have a strange problem..
    My selection-screen values are getting refreshed after execution and come back to selection screen. I am using normal ALV Fm to display the values. Can some suggest a possible reason?
    Many thanks,
    V Nair

    No .. I have checked it..Selection variables are not getting refreshed.
    My Code Below
    REPORT  yhr_icm_exception_report.
    Type Pool declarations
    TYPE-POOLS: slis,                                     "For AlV
                sdydo,                                    "Dynamic Documents
                icon.                                     "For ICON
    Table declarations
    TABLES : yhr_icm_exp_log,                             "ICM Exceptions Log
             yhr_icm_exp_hist.                            "ICM Exception History
    Include Constants
    INCLUDE   yhr_icm_constants .                         "Program to hold constants
    Types declarations
    *-To hold return field
    TYPES: BEGIN OF ty_returntab.
            INCLUDE STRUCTURE ddshretval.                 "Interface Structure
    TYPES: END OF ty_returntab.
    *-To hold deletion records
    TYPES : BEGIN OF ty_icm_del,
               tab_name      TYPE yhr_tabname,            "Internal table name
               objid         TYPE hrobjid,                "Object ID
               begda         TYPE begda,                  "Begin Date
               otype         TYPE otype,                  "Object Type
            END OF ty_icm_del.
    *-Message details to be displayed
    TYPES : BEGIN OF ty_message,
              msgnr          TYPE  msgno,                 "System message number
              text           TYPE  yhr_icm_exp_log-msgxx, "Message Text
            END OF ty_message.
    *-To hold exception log
    TYPES : BEGIN OF ty_icm_exp_log,
             msgno           TYPE msgnr,                  "Message number
             run_id          TYPE yhr_icm_erun_id,        "Exception Run ID
             delta_id        TYPE yhr_icm_run_id,         "Run ID
             record_type     TYPE yhr_icm_exp_type,       "Record Type
             otype           TYPE yhr_otype,              "Object Type
             objid           TYPE hrobjid,                "Object ID
             begda           TYPE begda,                  "Begin Date
             msgxx           TYPE msgxx,                  "Message
             status          TYPE yhr_icm_icon,           "Status
             delta_relevance TYPE yhr_delta_rel,          "Delta Relevance
            END OF ty_icm_exp_log.
    *-To hold email attachment
    TYPES: BEGIN OF ty_attach,
               text(500)     TYPE c,                      "Text
    END OF ty_attach.
    *To hold object type & text
    TYPES :BEGIN OF ty_objid_text,
              objid          TYPE objid,                  "Object ID
              text           TYPE emnam,                  "Object Text
           END OF ty_objid_text.
    *-To hold counter values - Exp , Del & historical
    TYPES :BEGIN OF ty_count,
              exp(10)        TYPE c,                      "Exceptions
              del(10)        TYPE c,                      "Deletions
              hist(10)       TYPE c,                      "Historical Deletions
           END OF ty_count.
    *- To hold lock details
    TYPES : BEGIN OF ty_lock,
              live           TYPE c,                      "Live Callidus Program
              genr           TYPE c,                      "Generation Program
              exp            TYPE c,                      "Exception Program
            END OF ty_lock.
    Range Declarations
    RANGES :
           gr_objid          FOR hrp1001-objid,           "Range for Object ID
           gr_pernr          FOR pa0000-pernr.            "Range for Employee number
    Internal Table Declarations
    DATA : gt_records        TYPE STANDARD TABLE OF yhr_icm_exp_report,
           gt_objid_text     TYPE STANDARD TABLE OF ty_objid_text,
           gt_icm_exp_log    TYPE STANDARD TABLE OF ty_icm_exp_log,
           gt_returntab      TYPE STANDARD TABLE OF ty_returntab,
           gt_t777o          TYPE STANDARD TABLE OF t777o,
           gt_diff_tab       TYPE STANDARD TABLE OF yhr_icm_diff,
           gt_del_tab        TYPE STANDARD TABLE OF ty_icm_del, "#EC *
           gt_iattach        TYPE STANDARD TABLE OF ty_attach,
           gt_message        TYPE STANDARD TABLE OF ty_message,
           gt_fieldcat       TYPE slis_t_fieldcat_alv,
           gt_heading        TYPE slis_t_listheader,
           gt_exceptions     TYPE yhr_icm_exp_list_t,
           gt_events         TYPE slis_t_event.
    Structure Declarations
    DATA : gs_objid_text     TYPE ty_objid_text,
           gs_icm_exp_log    TYPE ty_icm_exp_log,
           gs_records        TYPE yhr_icm_exp_report,
           gs_exceptions     TYPE yhr_icm_exp_list,
           gs_count          TYPE ty_count,
           gs_fieldcat       TYPE slis_fieldcat_alv,            "#EC *
           gs_returntab      TYPE ty_returntab,
           gs_icm_exp_hist   TYPE yhr_icm_exp_hist,
           gs_iattach        TYPE ty_attach,
           gs_message        TYPE ty_message,                   "#EC *
           gs_layout         TYPE slis_layout_alv,
           gs_t777o          TYPE t777o,
           gs_lock           TYPE ty_lock.
    Constant declarations
    CONSTANTS:
           c_yes             TYPE string        VALUE 'YES',
           c_no              TYPE string        VALUE 'NO',
           c_true            TYPE c             VALUE 'X',
           c_deletions       TYPE c             VALUE 'D',
           c_delta_no        TYPE c             VALUE 'N',
           c_delta_yes       TYPE c             VALUE 'Y',
           c_historical      TYPE c             VALUE 'H',
           c_a               TYPE c             VALUE 'A',
           c_error           TYPE c             VALUE 'E',
           c_equal(2)        TYPE c             VALUE 'EQ',
           c_participants    TYPE c             VALUE 'P',
           c_include         TYPE c             VALUE 'I',
           c_position        TYPE c             VALUE 'S',
           c_organization    TYPE c             VALUE 'O',
           c_runlock         TYPE string        VALUE 'RUN_LOCK',
           c_parameter       TYPE string        VALUE 'P',
           c_selfield        TYPE string        VALUE 'SEL_FIELD' ,
           c_type            TYPE string        VALUE 'TYPE',
           c_topofpage       TYPE string        VALUE 'TOP_OF_PAGE',
           c_rectype         TYPE string        VALUE ' S_RECTYPE',
           c_objectkey       TYPE string        VALUE 'OBJECTKEY1',
           c_icon_green      TYPE string        VALUE '@08@',
           c_icon_red        TYPE string        VALUE '@0A@',
           c_icon_amber      TYPE string        VALUE '@09@',
           c_green           TYPE string        VALUE 'GREEN',
           c_amber           TYPE string        VALUE 'AMBER',
           c_red             TYPE string        VALUE 'RED',
           c_tabname         TYPE slis_tabname  VALUE 'GT_RECORDS',
           c_structname      TYPE dd02l-tabname VALUE 'YHR_ICM_EXP_REPORT' ,     
           c_siwb_wallpaper  TYPE sdydo_key     VALUE 'SIWB_WALLPAPER',
           c_user_command    TYPE slis_formname VALUE 'F01_ALV_EVENT_USER_COMMAND',
           c_genname         TYPE trdir-name    VALUE 'YHR_ICM_GENERATE_EXCEPTIONS',
           c_expname         TYPE trdir-name    VALUE 'YHR_ICM_EXCEPTION_REPORT',
           c_pf_status       TYPE slis_formname VALUE 'SET_PF_STATUS',
           c_msg_class       TYPE string        VALUE 'YHR_ICM'.
    Global Variable Declarations
    DATA:  gv_email_error    TYPE c,
           gv_email_sent     TYPE c,
           gv_exit           TYPE c.
    Selection Screen - Block I
    SELECTION-SCREEN:   BEGIN OF BLOCK b3 WITH FRAME TITLE text-s07.
    SELECT-OPTIONS:
    *-  Run ID
        s_run_id             FOR yhr_icm_exp_hist-run_id,
    *-  Exception Type
        s_rectyp             FOR yhr_icm_exp_log-record_type NO INTERVALS,
    *-  Object Type
        s_otype              FOR yhr_icm_exp_log-otype NO INTERVALS,
    *-  Object ID
        s_objid              FOR yhr_icm_exp_log-objid NO INTERVALS,
    *-  Start Date
        s_begda              FOR yhr_icm_exp_log-begda,
    *-  Message number
        s_msgno              FOR yhr_icm_exp_log-msgno,
    *-  Message Text
        s_msgxx              FOR yhr_icm_exp_log-msgxx.
    SELECT-OPTIONS:
    *- Delta Relevance
       s_relv                FOR yhr_icm_exp_log-delta_relevance NO INTERVALS.
    PARAMETERS:
    *- Long Text
       p_ltext               AS   CHECKBOX DEFAULT ' '.
    SELECTION-SCREEN:   END OF BLOCK b3.
    Selection Screen - Block II
    SELECTION-SCREEN:   BEGIN OF BLOCK b2 WITH FRAME TITLE text-s08.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(14) text-033.
    *-Sucess
    PARAMETERS:
      p_stat_s               AS CHECKBOX.                  "D11K917251
    SELECTION-SCREEN COMMENT 24(14) text-034.
    *-Warning
    PARAMETERS:
      p_stat_w               AS CHECKBOX.                  "D11K917251
    SELECTION-SCREEN COMMENT 48(15) text-035.
    PARAMETERS:
    *-Error
      p_stat_e               AS CHECKBOX .                 "D11K917251
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN:   END OF BLOCK b2.
    Selection Screen - Block III
    SELECTION-SCREEN:   BEGIN OF BLOCK b4 WITH FRAME TITLE text-s09.
    *-Email Details
    PARAMETERS:
      p_email(128)            TYPE c.
    SELECTION-SCREEN:   END OF BLOCK b4.
                 Selection Screen on value request.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_msgno-low.
      PERFORM f4_message.
                 Selection Screen Output.
    AT SELECTION-SCREEN OUTPUT.
      CHECK gt_returntab[] IS NOT INITIAL.
      REFRESH s_msgno.
      s_msgno-option = c_equal.
      s_msgno-sign = c_include.
      LOOP AT gt_returntab INTO gs_returntab.
        s_msgno-low = gs_returntab-fieldval.
        s_msgno-high = space.
        APPEND s_msgno.
      ENDLOOP.
    At Selection Screen for Validation
    AT SELECTION-SCREEN.
      CLEAR gv_email_error.
    *-Validate Object Type
      PERFORM validate_objecttype.
    *-Validate Exception ID
      PERFORM fetch_exp_header.
    *-Validate Exception Type
      PERFORM validate_exptype.
    *-Validate Message Number
      PERFORM validate_msgno.
    *-Validate Message Type
      PERFORM validate_msgtype.
    *-Validate Delta
      PERFORM validate_delta.
    *-Validate Email ID
      PERFORM validate_email USING p_email
                             CHANGING gv_email_error.
      IF gv_email_error IS NOT INITIAL.
        MESSAGE e000(yhr_icm) WITH text-027.
      ENDIF.
    Initialization
    INITIALIZATION.
    Initialization
      PERFORM initialization.
    Start Of Selection
    START-OF-SELECTION.
      CLEAR : gv_email_error,
              gv_email_sent,
              gv_exit,
              gs_lock.
    Try locking the main program
      PERFORM lock_generation_program.
      CHECK gs_lock IS INITIAL.
    *-Fetch the messages stored in table
      PERFORM fetch_item_records.
    Read object type text.
      PERFORM read_text.
    Get Object Text
      PERFORM get_object_text.
    *-Fetch the current SAP messages
      PERFORM fetch_records.
    *-Update Delta Flag
      PERFORM update_delta_flag.
    *-Compare messages in table & in SAP
      PERFORM compare_message.
    If receiver is not blank, try sending out mail
      PERFORM send_mail USING p_email.
    End Of Selection
    END-OF-SELECTION.
      IF gv_exit IS NOT INITIAL.
        EXIT.
      ENDIF.
    *-Display ALV
      PERFORM display_alv.
    *-Build the event table for ALV display
      PERFORM build_eventtab CHANGING gt_events[].
    *-Fill the layout details
      PERFORM layout_build .
    Release all locks
      PERFORM release_locks.
    *-Finally call the grid display
      PERFORM display_data.
    *&      Form  set_pf_status
          text
         -->RT_EXTAB   text
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.        "#EC *
    Set PF Status
      SET PF-STATUS 'STANDARD'.
    ENDFORM. "Set_pf_status
    *&      Form  DISPLAY_ALV
          text
    -->  p1        text
    <--  p2        text
    FORM display_alv .
    *- Use FM to create field catalog
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_internal_tabname     = c_tabname
          i_structure_name       = c_structname
        CHANGING
          ct_fieldcat            = gt_fieldcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 1
          OTHERS                 = 1.
      IF sy-subrc = 1.
        MESSAGE i000(yhr_icm) WITH text-001.
        EXIT.
      ENDIF.
    *- Remove SEL Field Column as it is not required
      DELETE gt_fieldcat WHERE fieldname = c_selfield.
    *-If user chooses long text, activate icon
      IF p_ltext IS INITIAL.
        LOOP AT gt_fieldcat INTO gs_fieldcat WHERE fieldname = c_type.
          gs_fieldcat-icon = c_true.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV
    *&      Form  BUILD_EVENTTAB
          text
         <--P_GT_EVENTS[]  text
    FORM build_eventtab CHANGING    p_events  TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
    *-Get the list of event for alv
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = p_events.
    *-Add top of page event to event list
      READ TABLE p_events
            WITH KEY name = slis_ev_top_of_page
             INTO ls_event.
      IF sy-subrc = 0.
        MOVE c_topofpage TO ls_event-form.
        APPEND ls_event TO p_events.
      ENDIF.
    ENDFORM.                    " BUILD_EVENTTAB
    *&      Form  LAYOUT_BUILD
          text
    -->  p1        text
    <--  p2        text
    FORM layout_build .
      gs_layout-zebra                = c_true.
      gs_layout-colwidth_optimize    = c_true.
      gs_layout-detail_popup         = c_true.
      gs_layout-detail_initial_lines = c_true.
      gs_layout-detail_titlebar      = text-044.
      gs_layout-box_fieldname        = c_selfield.
    ENDFORM.                    " LAYOUT_BUILD
    *&      Form  DISPLAY_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
    *-Display ALV display
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_user_command  = c_user_command
          i_background_id          = c_siwb_wallpaper
          i_callback_program       = sy-repid
          i_callback_pf_status_set = c_pf_status
          i_default                = c_true
          i_save                   = c_a
          is_layout                = gs_layout
          it_fieldcat              = gt_fieldcat
          it_events                = gt_events
        TABLES
          t_outtab                 = gt_records.
    ENDFORM.                    " DISPLAY_DATA
    *&      Form  FETCH_RECORDS
          text
    -->  p1        text
    <--  p2        text
    FORM fetch_records .
      REFRESH : gt_diff_tab,
                gt_del_tab,
                gr_pernr,
                gt_exceptions.
      CLEAR:    gs_icm_exp_log.
    *-Get Employee details
      PERFORM get_person_data.
    *-Get Position Details
      PERFORM get_position_data.
    *-Get Organization Details
      PERFORM get_org_data.
    *-Get Exception current SAP exception list.
      PERFORM get_exception_list.
    *-Add deletion records
      PERFORM filter_deletions.
    ENDFORM.                    " FETCH_RECORDS
    *&      Form  top_of_page
          text
    FORM top_of_page.                                           "#EC *
      PERFORM build_comment   USING    gt_heading.
    *-Display Use FM to display Top Of Page
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_heading[].
      CLEAR gt_heading.
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  build_comment
          text
         -->P_HEADING  text
    FORM build_comment USING p_heading TYPE slis_t_listheader.
      DATA: ls_hline     TYPE slis_listheader,
            lv_text(120) TYPE c.
    *-Display report title
      ls_hline-typ  = c_historical.
      WRITE text-006 TO lv_text.
      ls_hline-info = lv_text.
      APPEND ls_hline TO p_heading.
      CLEAR ls_hline.
      ls_hline-typ  = c_s.
    *-Remove leading & trailing spaces
      CONDENSE : gs_count-del,  gs_count-exp,  gs_count-hist.
    *-If the count is space then pass 0
      IF gs_count-del = space.
        gs_count-del = 0.
      ENDIF.
      IF gs_count-exp = space.
        gs_count-exp = 0.
      ENDIF.
      IF gs_count-hist = space.
        gs_count-hist = 0.
      ENDIF.
      IF gs_lock IS INITIAL.
    *-Display Deletion, Exception, Historical Count
        CONCATENATE  text-037 gs_count-del
                     text-032 gs_count-exp
                     text-039 gs_count-hist
                INTO ls_hline-info SEPARATED BY space.
      ELSEIF gs_lock-live IS NOT INITIAL.
        ls_hline-info = text-007.
      ELSEIF gs_lock-genr IS NOT INITIAL.
        ls_hline-info = text-008.
      ELSEIF gs_lock-exp IS NOT INITIAL.
        ls_hline-info = text-009.
      ENDIF.
      APPEND ls_hline TO p_heading.
      CLEAR ls_hline.
    ENDFORM.                    "BUILD_COMMENT
    *&      Form  INITIALIZATION
          text
    -->  p1        text
    <--  p2        text
    FORM initialization .
    Read Previous run
    SELECT MAX( run_id )
       INTO s_run_id-low
       FROM yhr_icm_exp_hist.                                  "#EC *
    s_run_id-option = c_equal.
    s_run_id-sign = c_include.
    APPEND s_run_id.
    s_rectyp-option = c_equal.
    s_rectyp-sign = c_include.
    s_rectyp-low = c_error.
    APPEND s_rectyp.
    s_rectyp-low = c_deletions.
    APPEND s_rectyp.
      PERFORM restrict_selections.
    *Get the message from Message Class YHR_ICM
      SELECT msgnr
             text
        FROM t100
        INTO TABLE gt_message
       WHERE arbgb = c_msg_class  AND
             msgnr GT '000'.                                    "#EC *
    ENDFORM.                    " INITIALIZATION
    *&      Form  F4_MESSAGE
          text
         <--P_P_MSGNO  text
    FORM f4_message.
    F4 Help - Display all messages
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'MSGNR'
          dynpprog        = sy-cprog
          dynpnr          = sy-dynnr
          dynprofield     = 'S_MSGNR'
          window_title    = text-045
          value_org       = c_s
          multiple_choice = c_true
        TABLES
          value_tab       = gt_message
          return_tab      = gt_returntab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 1.
      IF sy-subrc = 1.
        MESSAGE i000(yhr_icm) WITH text-002.
        EXIT.
      ELSEIF sy-subrc = 2.
        MESSAGE i000(yhr_icm) WITH text-003.
        EXIT.
      ENDIF.
    ENDFORM.                    " F4_MESSAGE
    *&      Form  VALIDATE_OBJECTTYPE
          text
    -->  p1        text
    <--  p2        text
    FORM validate_objecttype .
      CHECK s_otype-low IS NOT INITIAL.
      CONDENSE s_otype-low.
    Validate object type to check whether user has entered only S, P or O
      IF  s_otype-low NE c_organization AND
            s_otype-low NE c_position AND
              s_otype-low NE c_participants  .
        MESSAGE e000(yhr_icm) WITH 'Enter either S(Position), P(Person) or O(Org Unit)'(021).
      ENDIF.
    ENDFORM.                    " VALIDATE_OBJECTTYPE
    *&      Form  VALIDATE_OBJECTTYPE
    FORM f01_alv_event_user_command USING r_ucomm LIKE sy-ucomm
                                          rs_selfield TYPE slis_selfield."#EC *
      DATA : lv_answer TYPE c,
             lt_fields TYPE STANDARD TABLE OF sval,
             ls_fields TYPE sval.
    *-Get the row user has selected in ALV list
      READ TABLE gt_records INTO gs_records INDEX rs_selfield-tabindex.
      CASE r_ucomm.
        WHEN 'DISP'.
          CASE gs_records-otype.
            WHEN 'S'.
              SET PARAMETER ID 'POT' FIELD gs_records-otype.
              SET PARAMETER ID 'PON' FIELD gs_records-objid.
              CALL TRANSACTION 'PP01_DISP' AND SKIP FIRST SCREEN.
            WHEN 'P'.
              SET PARAMETER ID 'PER' FIELD gs_records-objid.
              CALL TRANSACTION 'PA20' AND SKIP FIRST SCREEN.
            WHEN 'O'.
              SET PARAMETER ID 'POT' FIELD gs_records-otype.
              SET PARAMETER ID 'PON' FIELD gs_records-objid.
              CALL TRANSACTION 'PP01_DISP' AND SKIP FIRST SCREEN.
          ENDCASE.
        WHEN 'CHNG'.
          CASE gs_records-otype.
            WHEN 'S'.
              SET PARAMETER ID 'POT' FIELD gs_records-otype.
              SET PARAMETER ID 'PON' FIELD gs_records-objid.
              CALL TRANSACTION 'PP01' AND SKIP FIRST SCREEN.
            WHEN 'P'.
              SET PARAMETER ID 'PER' FIELD gs_records-objid.
              CALL TRANSACTION 'PA30' AND SKIP FIRST SCREEN.
            WHEN 'O'.
              SET PARAMETER ID 'POT' FIELD gs_records-otype.
              SET PARAMETER ID 'PON' FIELD gs_records-objid.
              CALL TRANSACTION 'PP01' AND SKIP FIRST SCREEN.
          ENDCASE.
        WHEN 'EMAIL'.
    *-    Check whether email has already been sent
          IF  gv_email_sent = c_true.
    *-      If yes, then display pop up to confirm for mailing again
            CALL FUNCTION 'POPUP_TO_CONFIRM'
              EXPORTING
                text_question  = text-041
                text_button_1  = text-042
                text_button_2  = text-043
              IMPORTING
                answer         = lv_answer
              EXCEPTIONS
                text_not_found = 1
                OTHERS         = 1.
            IF sy-subrc = 1.
              MESSAGE i000(yhr_icm) WITH text-004.
              EXIT.
            ENDIF.
    *-     Continue only if user has selected Yes
            CHECK lv_answer = '1'.
          ENDIF.
    *-      Add Email Field & Table
          ls_fields-tabname = 'SZA5_D0700'.
          ls_fields-fieldname =  'SMTP_ADDR'.
          APPEND ls_fields TO lt_fields.
    *-      Use FM to get new Email ID
          CALL FUNCTION 'POPUP_GET_VALUES'
            EXPORTING
              popup_title     = text-s09
              start_column    = '5'
              start_row       = '5'
            TABLES
              fields          = lt_fields
            EXCEPTIONS
              error_in_fields = 1
              OTHERS          = 1.
          IF sy-subrc = 1.
            MESSAGE i000(yhr_icm) WITH text-004.
            EXIT.
          ENDIF.
    *-    Get the Email user has entered
          READ TABLE lt_fields INTO ls_fields INDEX 1.
    *-      Validate Email ID
          PERFORM validate_email USING ls_fields-value
                         CHANGING gv_email_error.
    *-    If the flag is not initial, indicates possible error
          IF  gv_email_error IS NOT INITIAL.
            MESSAGE i000(yhr_icm) WITH text-027.
            EXIT.
          ELSE.
          If no error, then try ending email
            PERFORM send_mail USING ls_fields-value.
          ENDIF.
        WHEN 'REFRESH'.
    *-    Fetch the current SAP messages
          PERFORM fetch_records.
    *-    Update Delta Flag
          PERFORM update_delta_flag.
    *-    Compare messages in table & in SAP
          PERFORM compare_message.
    *-    Refresh alv which is already displayed
          rs_selfield-refresh = c_true.
      ENDCASE.
    ENDFORM.                    "F01_ALV_EVENT_USER_COMMAND
    *&      Form  RESTRICT_SELECTIONS
          text
    -->  p1        text
    <--  p2        text
    FORM restrict_selections .
      TYPE-POOLS sscr.
      STATICS: lt_restrict TYPE sscr_restrict,
               lt_opt_list TYPE sscr_opt_list,
               ls_***      TYPE sscr_***.
    Restrict the wage type selection so the user can only enter
    values with the 'EQ' clause.
      CLEAR lt_opt_list.
      MOVE c_objectkey TO lt_opt_list.
      MOVE c_true TO: lt_opt_list-options-eq,
                      lt_opt_list-options-bt,
                      lt_opt_list-options-cp,
                      lt_opt_list-options-eq,
                      lt_opt_list-options-ge,
                      lt_opt_list-options-gt,
                      lt_opt_list-options-le,
                      lt_opt_list-options-lt.
      APPEND lt_opt_list TO lt_restrict-opt_list_tab.
      MOVE: c_s         TO ls_***-kind,
            c_rectype   TO ls_***-name,
            c_include         TO ls_***-sg_main,
            space       TO ls_***-sg_addy,
            c_objectkey TO ls_***-op_main.
      APPEND ls_***     TO lt_restrict-***_tab.
    *-Restrict the values OTYPE
      MOVE  'S_OTYPE'    TO ls_***-name.
      APPEND ls_***      TO lt_restrict-***_tab.
    *-Restrict the values OBJID
      MOVE    'S_OBJID'  TO ls_***-name.
      APPEND ls_***      TO lt_restrict-***_tab.
    *-Use FM to restrict the values
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
          restriction = lt_restrict.
    ENDFORM.                    " RESTRICT_SELECTIONS
    *&      Form  GET_PERSON_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM get_person_data .
      DATA : lt_del_tab TYPE STANDARD TABLE OF yhr_icm_diff.
      SORT gt_icm_exp_log BY msgno .
      gr_pernr-sign = c_include.
      gr_pernr-option = c_equal.
      LOOP AT gt_icm_exp_log INTO gs_icm_exp_log WHERE otype = c_participants AND
                                                       record_type = c_error.
    *-  Sort the table based on msgno and collect pernr
        gr_pernr-sign = c_include.
        gr_pernr-option = c_equal.
        gr_pernr-low = gs_icm_exp_log-objid.
        APPEND gr_pernr.
        CLEAR gr_pernr-low.
        AT END OF msgno.                                        "#EC *
    *-    For the list of Pernr having same PERNR get the current exp details
          IF  gs_icm_exp_log-msgno = c_msg_100.
    *-      Export the pernr list to memory id & import in the below FM
    *-      Selection of records should be based on values exported from here
            EXPORT gr_pernr TO MEMORY ID 'PERNR_0001'.
          Get Org Assignment 0001 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_0001_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda
                refresh      = space
                UPDATE       = space
              TABLES
                diff_tab     = gt_diff_tab
                del_tab      = lt_del_tab.
        ELSEIF  gs_icm_exp_log-msgno = c_msg_101. "Y_HR_DIFF_PERNR_0001_ORG_DATA
          ELSEIF  gs_icm_exp_log-msgno = c_msg_102 .
            EXPORT gr_pernr TO MEMORY ID 'PERNR_0000'.
          Get Actions 0000 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_0000_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda
                refresh      = space
                UPDATE       = space
              TABLES
                diff_tab     = gt_diff_tab
                del_tab      = lt_del_tab.
          ELSEIF  gs_icm_exp_log-msgno = c_msg_103.
            EXPORT gr_pernr TO MEMORY ID 'PERNR_0002'.
          Get Personal Details 0002 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_0002_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda
                refresh      = space
                UPDATE       = space
              TABLES
                diff_tab     = gt_diff_tab
                del_tab      = lt_del_tab.
          ELSEIF  gs_icm_exp_log-msgno = c_msg_104.
            EXPORT gr_pernr TO MEMORY ID 'PERNR_0004'.
          Get Disability 0004 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_0004_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda
                refresh      = space
                UPDATE       = space
              TABLES
                diff_tab     = gt_diff_tab
                del_tab      = lt_del_tab.
          ELSEIF  gs_icm_exp_log-msgno = c_msg_105.
            EXPORT gr_pernr TO MEMORY ID 'PERNR_0006'.
          Get Addresses 0006 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_0006_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda
                refresh      = space
                UPDATE       = space
              TABLES
                diff_tab     = gt_diff_tab
                del_tab      = lt_del_tab.
          ELSEIF  gs_icm_exp_log-msgno = c_msg_106.
            EXPORT gr_pernr TO MEMORY ID 'PERNR_0007'.
          Get Planned Time 0007 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_0007_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda
                refresh      = space
                UPDATE       = space
              TABLES
                diff_tab     = gt_diff_tab
                del_tab      = lt_del_tab.
          ELSEIF  gs_icm_exp_log-msgno = c_msg_107.
            EXPORT gr_pernr TO MEMORY ID 'PERNR_0016'.
          Get Contract Element 0016 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_0016_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda
                refresh      = space
                UPDATE       = space
              TABLES
                diff_tab     = gt_diff_tab
                del_tab      = lt_del_tab.
          ELSEIF  gs_icm_exp_log-msgno = c_msg_108.
            EXPORT gr_pernr TO MEMORY ID 'PERNR_0077'.
          Get Additional Personal 0077 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_0077_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda
                refresh      = space
                UPDATE       = space
              TABLES
                diff_tab     = gt_diff_tab
                del_tab      = lt_del_tab.
          ELSEIF  gs_icm_exp_log-msgno = c_msg_109 .
            EXPORT gr_pernr TO MEMORY ID 'PERNR_0105'.
          Get Communications 0105 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_0105_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda
                refresh      = space
                UPDATE       = space
              TABLES
                diff_tab     = gt_diff_tab
                del_tab      = lt_del_tab.
          ELSEIF  gs_icm_exp_log-msgno = c_msg_110.
            EXPORT gr_pernr TO MEMORY ID 'PERNR_2001'.
          Get Absences 2001 Data
            CALL FUNCTION 'Y_HR_DIFF_PERNR_2001_DATA'
              EXPORTING
                period_begda = gs_icm_exp_hist-begda
                period_endda = gs_icm_exp_hist-endda

  • Image not getting refreshed

    Hi,
    In my JSF application, I have 2 pages. My first page displays the user details with an image and in the second page I can change the image.
    If I change the image in my second page and come back to my first page, the image is not getting refreshed. The image gets changed only when I refresh that page.
    Can anyone please help me with some inputs on this.
    Thanks..

    Clean way is to change the HTTP headers so that the browser doesn't cache the page. Here is the complete set to be used in HTML <head>:
    <meta http-equiv="cache-control" content="max-age=0, must-revalidate, no-cache, no-store, private">
    <meta http-equiv="pragma" content="no-cache">Or if you're using HttpServletResponse, then do:
    response.setHeader("cache-control", "private, no-cache, no-store, no-transform, must-revalidate"); // HTTP 1.1
    response.setHeader("pragma", "no-cache"); // HTTP 1.0Another solution -nasty but working- is to add a fake query string behind the image URL which changes from time to time so that the browser is forced to reload the image.
    E.g.<img src="/images/foo.gif?<%= System.currentTimeMillis(); %>" />

  • Values not getting refreshed in web report.

    Hello Friends,
    Currently i am running an web report. The scenerio is i have check box with 5 options For Ex: IMS , IMR, IMN,IMM,IMP.
    IMS is the combination of all divisions and IMR is the combination of only three divisions.
    In BEx we runthe report with divisions . For ex : divisions are Ind1, ind2,ind3,ind4,ind 5.
    Instead of displaying divisions in the select options like Ind1,ind2....etc., we have created a structure in the report
    and using new selection we have restricted the divisions with IMS,IMN,etc.,
    IMS->combination of all divisions. IMR is combination of ind1,ind2,ind3.
    IMN... all are with single divisions
    Now we have assigned the query in the data provider for select options in hte web report,
    But when we select any options the values of the remaining queries are not getting refreshed.
    If we use the divisons directly with out using the structures the values are getting refreshed.
    Can any one give me the solutions for this?
    Regards
    Srinivas

    Hi Mansi,
    Check the Prompt properties in the Edit Query window of the webI. In the query filters section of window, click on the blue icon which says Prompt Properties. Deselect Keep Last values select and run the webI again.
    If the solution is not related to your question, please provide more details.
    Thanks,
    Rajesh

  • Message not getting refreshed in bsp pages.

    Hi experts,
    An error message which is getting displayed should be removed on leaving the page. I mean the meassage area is not getting refreshed on leaving the page. Everytime i need to refresh the page to remove it. Please help.
    Abhi.

    hello Friend,
    Please clear the internal table / work are used to show message in OnInitialization method of the BSP page.
    now It is not getting cleared at the time leaving the page and data stays in memory...
    Thanks
    K.

  • Panel is not getting refreshed.i see a jam of old and new graph and lines

    hi friends
    i am attaching my code .when i adjust the slider position the size of the graph will increase(scaling).when i scroll to see the entire graph the screen is not getting refreshed properly.
    no leads ..can be 3,12 ...try any arbitary ...(stored in a txt file)
    myfile.txt=consider some 600 random numbers for testing.
    public class ECGDisplay extends JFrame implements WindowListener
          Container contain;
          JSlider sliderX,sliderY,sliderCount;
          JTextField Xval,Yval,Count;
          int [] time=new int[600];
          int []Volt=new int[600];
         Simpanel[] panelname;
          float relX=1;
          float relY=1;
          LineBorder lineborder,lineborder1;
          JPanel ScalingAdjustersPanel,ECGDisplayPanel;
          JScrollPane Scroll;
          JViewport vp;
          JRadioButton RbX,RbY,RbCount;
          ButtonGroup group;
          private FileInputStream in;
          String horizontalScalingSliderLabel = "mm/S";
          String verticalScalingSliderLabel = "mm/mV";
          String heightOfTileSliderLabel ="Height of tile in uV";
          boolean flag=false;
          int LeadCount;
          int x=20,y=15;
          int count=4;
          JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
          java.awt.Dimension screen = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    public ECGDisplay()
         super();     
         this.setTitle("ECG FRAME");
         this.addWindowListener(this);
         this.setSize (screen.width, screen.height);
         contain=getContentPane();
         EcgLeadCount();
         EcgWindowCreation(LeadCount);
    void  EcgLeadCount( )
              try
               FileInputStream in = new FileInputStream("no_Leads.txt");
               BufferedReader br = new BufferedReader(new InputStreamReader(in));
               LeadCount=Integer.parseInt(br.readLine());
               in.close();
               catch (Exception e)
                 System.err.println ("Error while reading no of leads");
    void PanelAdjuster()
              for(int i=0;i<LeadCount;i++)
              panelname.setPreferredSize(new Dimension((30*x),(count*y)));
    void readMyFile(int i)
              try
              FileInputStream in = new FileInputStream("myfile.txt");
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              String strLine;
              for (int j = 0; j < Volt.length; j++)
                   Volt[j] = Integer.parseInt(br.readLine());
                   in.close();
              catch (Exception e)
                   System.err.println ("Error writing to file");
    public void EcgWindowCreation(int LeadCount)
         for(int i=0;i<600;i++)
              time[i]=i;
              ScalingAdjustersPanel=new JPanel();
              ECGDisplayPanel=new JPanel();
              panelname=new Simpanel[LeadCount];
              for(int i=0;i<LeadCount;i++)
                   panelname[i] =new Simpanel();
                   System.out.println(panelname[i]);
                   readMyFile(i);
                   ECGDisplayPanel.add(panelname[i]);
              ScalingAdjustersPanel.setPreferredSize(new Dimension(200,(screen.height-50)));
              ScalingAdjustersPanel.setLayout(new BoxLayout(ScalingAdjustersPanel,BoxLayout.Y_AXIS));
              ECGDisplayPanel.setLayout(new BoxLayout(ECGDisplayPanel,BoxLayout.Y_AXIS));
         sliderX=new JSlider(10,50,20);
         sliderY=new JSlider(15,50,15);
              sliderCount=new JSlider(4,10,4);
              ScalingAdjustersPanel.add(sliderCount);
              sliderCount.setBorder(BorderFactory.createTitledBorder("uV"));
              sliderCount.setMajorTickSpacing(2);
              sliderCount.setMinorTickSpacing(1);
              sliderCount.setPaintTicks(true);
              sliderCount.setPaintLabels(true);
              sliderCount.setVisible(false);
              sliderCount.addChangeListener(new SliderChange());     
              ScalingAdjustersPanel.add(sliderX);
              sliderX.setBorder(BorderFactory.createTitledBorder(horizontalScalingSliderLabel));
              sliderX.setMajorTickSpacing(10);
              sliderX.setMinorTickSpacing(5);
              sliderX.setPaintTicks(true);
              sliderX.setPaintLabels(true);
              sliderX.addChangeListener(new SliderChange());
              sliderX.setVisible(true);
              ScalingAdjustersPanel.add(sliderY);
              sliderY.setBorder(BorderFactory.createTitledBorder(verticalScalingSliderLabel));
              sliderY.setMajorTickSpacing(10);
              sliderY.setMinorTickSpacing(5);
              sliderY.setPaintTicks(true);
              sliderY.setPaintLabels(true);
              sliderY.addChangeListener(new SliderChange());
              sliderY.setVisible(false);
              RbX=new JRadioButton ("horizontal Scaling",true);
              RbY=new JRadioButton ("vertical Scaling");
              RbCount=new JRadioButton ("height Of Tile");
              group=new ButtonGroup ();
              group.add(RbX);
              group.add(RbY);
              group.add(RbCount);
         ScalingAdjustersPanel.add(RbX);
              ScalingAdjustersPanel.add(RbY);
              ScalingAdjustersPanel.add(RbCount);
              RbX.addActionListener(new buttonSelected());
              RbY.addActionListener(new buttonSelected());
              RbCount.addActionListener(new buttonSelected());
              lineborder = new LineBorder(Color.GRAY,2,true);
              lineborder1 = new LineBorder(Color.RED,2,true);
              ScalingAdjustersPanel.setBorder(lineborder);
              JScrollPane Scroll=new JScrollPane(ECGDisplayPanel);
              contain.setLayout(new BorderLayout());
              splitPane.setOneTouchExpandable(true);
         splitPane.add(ScalingAdjustersPanel);
         splitPane.add(Scroll);
              contain.add(splitPane,BorderLayout.CENTER);     
              setVisible(true);
    public void windowClosing(WindowEvent evt)
              this.setVisible(false);
              this.dispose();
    public void windowOpened(WindowEvent evt) {}
    public void windowClosed(WindowEvent evt) {}
    public void windowIconified(WindowEvent evt) {}
    public void windowDeiconified(WindowEvent evt) {}
    public void windowActivated(WindowEvent evt) {}
    public void windowDeactivated(WindowEvent evt) {}          
    public class SliderChange implements ChangeListener
              public void stateChanged(ChangeEvent AE)
                   Object sliderOBJ=AE.getSource();
                   if(sliderOBJ==sliderX)
                        x= sliderX.getValue();
                        relX=(float)x/20;
                   else if (sliderOBJ==sliderY)
                        y= sliderY.getValue();
                        relY=(float)(((float)y*count)/(15*4));
                   else if(sliderOBJ==sliderCount)
                        count=sliderCount.getValue();
                        relY=(float)(((float)y*count)/(15*4));
                   PanelAdjuster();
                   ECGDisplayPanel.repaint();
                   ECGDisplayPanel.updateUI();
    public class buttonSelected implements ActionListener
         public void actionPerformed(ActionEvent e)
              JRadioButton slid1=(JRadioButton)e.getSource();
              if(slid1==RbX)
              sliderX.setVisible(true);
              sliderY.setVisible(false);
              sliderCount.setVisible(false);
              if(slid1==RbY)
              sliderX.setVisible(false);
              sliderY.setVisible(true);
              sliderCount.setVisible(false);
              if(slid1==RbCount)
              sliderX.setVisible(false);
              sliderY.setVisible(false);
              sliderCount.setVisible(true);
    public class Simpanel extends JPanel
         public void paintComponent(Graphics g)
              g.setColor(Color.BLUE);
              for(int i=0;i<599;i++)
                   g.drawLine((int)(time[i]*relX),(int)(Volt[i]*relY),(int)(time[i+1]*relX),(int)(Volt[i+1]*relY));
              Graphics2D g2=(Graphics2D) g;
         //drawing a rectangle
         double leftX=0;
         double topY=0;
              double width=x;
              double height=y;
                   g2.setColor(Color.RED);
              for(int j=0;j<=count;j++)
                   for(int i=0;i<30;i++)
                             Rectangle2D rect=new Rectangle2D.Double(leftX,topY,width,height);
                             g2.draw(rect);
                             leftX=leftX+x;
                        leftX=0;
                        topY=topY+y;
    public static void main(String args[])
              ECGDisplay frame=new ECGDisplay();
    Edited by: garlapati on Apr 7, 2009 10:18 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    From the [custom painting tutotial|http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html]:
    Most of the standard Swing components have their look and feel implemented by separate "UI Delegate" objects. The invocation of super.paintComponent(g) passes the graphics context off to the component's UI delegate, which paints the panel's background. For a closer look at this process, see the section entitled "Painting and the UI Delegate" in the aforementioned SDN article.

  • Production Reporting out put not getting deleted after 30mins what we set.

    Hi,
    This issue regarding Production Reporting. In the workspace the report output not getting deleted after 30minutes (while publishing the report settings were like delete after 30 mins). Any suggestions please .....
    Thanks
    Venkat

    Hi Deepak,
    Please chek the field / value which u have changed is relavant to  printouts of the change.
    You can check  with following path
    SPRO> MM > Purchasing > Message > Fields Relevant to Printouts of Changes.
    Confirm tick is provided for PO ( P)
    Vivek

Maybe you are looking for

  • Values from Search help not returned to UI

    Hi, For a field on Web UI, i have to open a popup which would be configured from a search help created in transaction SE11. The search help uses a Searchhelp Exit. On the UI, I am getting the popup but the value i select is not reflecting on the UI.

  • Ipod touch 4G with phone 3G accessories

    Hi, I used to have an iphone 3G (still have the hardware, but due problems with AT&T I am not longer an iphone user). Now, I just bought an ipod touch 32GB 4G for my niece as a christmas present and I am wondering if I can give her all the accessorie

  • Can't get EE and SE to play nicely with deploytool

    Hi, I have tried the following combinations of installations: j2se 1.4.x / j2ee 1.4.x (beta) j2se 1.4.x / j2ee 1.3.1 j2se 1.3.1 / j2ee 1.4.x (beta) With all of these combinations, the deploytool utility which comes with the j2ee bundle crashes on me

  • Problem when Saving Outline

    Hello: We're working with Essbase 9.3.1 and when we try to save the outline an error window appears: The title of the window is "outline message" and it shows an error icon, but without showing any message, just "[]", and the outline is not saved. In

  • Adpreclone dbTier ran successful but have an Exception message

    'perl adpreclone.pl dbTier' ran successfully. See the end of the log file content below. But I can see an Exception message aswell (BOLDED). Can it be ignored? Why is this occuring? ------------ADX Database Utility Finished--------------- P:\R12\11.1