A JTable, a datamodel and a refresh method walk into a pub...

Hi. I have been reading the forums all morning to get help with this but can't seem to find something to suit so far.
I've made a configurable db connector and a GUI for viewing its contents in a JTable after specifying ip address, port number etc.
So far I've got a customised AbstractTableModel to set itself up on default db connection settings and the JTable opens up with that datamodel.
Fine up to this. Its static, just shows up and sits there.
=====================================
What I need:
The JTable should have a default setting of everything blank.
After specifying the db connection you click launch connection button.
I want to be able to connect to a database (no problem there) and get the JTable to populate from this current database.
Then clicking the button again closes the db connection (again, no problem there) and I want the JTable to return to default blank.
=====================================
In a nutshell:
'How can I use a TableModel that can change its contents and refresh/update a JTable from it?'
Any Ideas?

<code>
public class DataTableModel extends AbstractTableModel
private int maxCol = 0;
private List header = new ArrayList();
private List data = new ArrayList();
public DataTableModel() {
public int getRowCount() {
if(data.size()==0)
return 6;
return data.size();
public int getColumnCount() {
if(maxCol == 0)
return 6;
return maxCol;
public String getColumnName(int columnIndex) {
if(columnIndex>=header.size())
return "Colonne "+(columnIndex+1);
return header.get(columnIndex).toString();
public Class getColumnClass(int columnIndex) {
try{
return Class.forName("String");
}catch(Exception e){}
return null;
public boolean isCellEditable(int rowIndex, int columnIndex) {
return false;
public Object getValueAt(int rowIndex, int columnIndex) {
if(rowIndex>=data.size())
return null;
List tmp = (List) data.get(rowIndex);
if(columnIndex>=tmp.size())
return null;
return tmp.get(columnIndex);
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
/**@todo: Implement this javax.swing.table.TableModel method*/
throw new java.lang.UnsupportedOperationException("Method setValueAt() not yet implemented.");
public void addRow(List row){
data.add(row);
if(row.size() > maxCol)
maxCol = row.size();
public void setHeader(List header){
this.header = header;
if(header.size()>maxCol)
maxCol = header.size();
public void setColumName(String value,int index){
if(header.size()==0){
for(int i=0;i<index;i++)
header.add("Colonne "+(i+1));
header.add(value);
double max = Math.max(maxCol,6);
for(int i=header.size();i<max;i++)
header.add("Colonne "+(i+1));
return;
header.remove(index);
header.add(index,value);
public void reinit(){
header.clear();
data.clear();
</code>
this the code of my table model...At the beginning the table has 6 colums and 6 rows.

Similar Messages

  • A Mac, a PC, a Treo, a Tour and an Exchange Server walk into a bar...

    I've been a Palm user for over ten years. Yesterday my boss told me that I'd be getting a data plan for my Verizon phone and I could stick with my Treo or he'd upgrade me to a Blackberry. I've had my Treo for 14 months, well, I've had a Treo for 14 months, but 6 different ones because the stupid things keep breaking. It didn't take a whole lot of time to make the decision to switch to a Blackberry.
    So here's the situation...
    I am a tried and true Mac devotee. I have a Mac laptop and a desktop, and do the majority of my personal and creative work on the laptop. I am also a programmer, so have a PC laptop as well. My work computer is a PC (of course) and our email and calendar is hooked up to an Exchange server. 
    My boss sync'd my Tour to the Exchange server this morning and I am getting my work emails, etc with no problems. 
    I have the Palm desktop on my Mac and my PC, and both are sync'd with my Treo. I need to get all of my contacts into my Tour, and I'd like to get the Blackberry desktop on at least my Mac laptop so that I have a fully sync'd calendar on it since it's the computer I usually have with me. 
    When I back my Treo up, all of my text messages, images, notes, etc are backed up by the Palm software as well - is there a way to port those into the Blackberry as well? Are any applications compatible between the two?
    I also have a fantastic program on my Treo called NVBackup that runs on a schedule that backs up the entire phone every 24 hours so that if the phone dies all you have to do is pop the memory card out, put it in a new phone and it will reinstall everything. Is there a similar program for the Blackberry?
    Thanks!!
    Michelle

    jheymann wrote:
    At this moment I can recieve email thru the exchange server, the Mac shows its connected to the exchange server but I cannot send or reply to an email, and the incoming and outgoing server is the same freaking server!  My simple iphone syncs seeemlessly with my servers, email, calendars and contacts.  It makes no sense.  Any suggestions?
    iPhones connect to Exhange servers via ActiveSync, whereas Mac OS X Mail (as does Entourage EWS and Outlook 2011) connect via Exchange Web Services (I've read it's due to rather licensing issues for ActiveSync that prevents Apple from using it on OS X as well, but that's unconfirmed). So what works with one has little bearing on what works or doesn't work on the other.
    Anyway, we'll see if we can come up with any ideas. Let's start with basics: what version of Exchange is running on the server and what version of Mac OS X is your MacBook running? And does this problem happen when you're connected directly to the company network, or only when you're connecting via another provider?
    Regards.

  • A Time Capsule, Airport Express and AT&T 2Wire walk into a bar...

    Alas, I'm sure this question has been asked before, but my reserach keeps turning up separate answers.  So I thought I'd turn to this forum for some advice.  Ultimately I'm seeks suggestions on various ways to configure my network to allow easy backups, connection two rooms, and wirelessly print from anywhere.
    I have a: 
    Time Capsule (dual band) - used for Time Machine backups
    Airport Express (older)
    and new 2Wire 3800HGV-B wireless modem/router from AT&T (for U-verse internet/TV)
    My room configuration is:
    Living room with TV, internet connected DVD player, and new AT&T 2Wire Wireless U-verse modem
    Home office with 2 desktop comptuers (no wireless cards) and a USB printer. 
    Two roaming laptops which move around the rest of the house
    The livingroom and the office can't be connected with a physical wire. 
    What I was hoping to do was setup my office with the Time Capsule in the office as a wired hub, and then use it as a wirelessly bridge to the 2Wire network.  But as I understand it, a Time Capsule can't be used as a bridge to a non-Apple product.  Please correct me if I'm wrong. 
    Alternately I could always get wireless cards for the desktop computers, but this leaves the printer.
    I've read suggesitons of people who have used their TC as the primary router, disabling wireless on their AT&T 2Wire, and hooking the two together with ethernet.  Others who just join the TC to the 2Wireness network.  But really what I'm seeking is a way to join the two rooms. 
    Any thoughts?  Am I asking the right questions or providing the right information?
    Much thanks,
    dana.

    So I figured I'd go with an initial suggestion and attached my TC via ethernet to the 2Wire modem/router in my living room, and make the TC my primary wireless router.
    Good plan
    since both will be in the same room, I assume I need to disable wireless on the 2Wire
    Correct
    What kind of configuration do I need to do on the TC, or do I just following the wizard and select 'Extend existing network'?
    You can follow the guided setup or I can give you a step by step manual setup. In either case, you will configure the TC to "Create a wireless network". 
    ("Extend" is only used if the TC connects using wireless only....you will be using Ethernet from one of the LAN <-> ports on the 2-Wire to the WAN port (world icon) on the TC.
    The guided setup will normally sense that the TC is connected to another router and suggest that the TC be configured in Bridge Mode, which is the correct setting. Otherwise, select the Bridge Mode option when it is presented.
    Note....If you have a newer dual band TC, the Guest Network option cannot be enabled when the TC is configured in Bridge Mode. So, if you want a "Guest" network, maybe the 2-Wire could provide that service.
    Should I attach this (via ethernet) to the TC or the 2Wire?
    Pick a LAN <-> port on either one, your choice, whichever is easier
    What should the AT&T DVR be connected to?
    I'm not familiar with an AT&T DVR, but if it connects via Ethernet, you can connect to a LAN <-> port on either the 2-Wire or the TC
    For printing, my plan is to attach the printer through USB to the Airport Express and then connect that wirelessly to the TC network (though my first attempt at this failed to connect).
    Suggest that you get the TC up and working smoothly. Then tackle the Express.

  • 10.4.8, Bonjour, an Epson printer and a network all walk into a bar...

    Just Kidding, but I do have a real problem.
    I have two macbooks, networked through an actiontec router/dsl modem wirelessly, and an Epson printer connected to one of them via a usb cable. Now, the macbook connected to the printer physically can print, but the other one, although it sees it via bonjour, can not print to it. It keeps coming back with a communication error.
    when I connected my iBook to the network, it saw the printer as well, and after selecting it in my printer preferences, it even said it was printing, but nothing ever printed.
    Am I missing a step or what?

    Drivers ... you have a Macbook and perhaps the installed drivers are not compatible with Intel.
    Have a look to see if there are any updates. Even download from Epson's web site and try reinstalling them on non-printing macs anyway. Always worth a go..
    Good luck.

  • In mail, I keep getting the same "re-enter password" error msg even though the password in the mail accts is still there.  This started on day 15 of a 30-day trip and continued until i walked into my office at home and my own wi-fi network.  Fix?

    iPad2 -- In mail, how come i suddenly get password error msgs on day 15 of a 30 day trip (preventing me from using Mail) until i return on day 30 to my home wi-fi, when all of a sudden everthing is OK again?  How can i fix this when it happens again?

    Probably your email provider requires that email access be made from a point on their network. This would not be the case while you were traveling be would again be true when you returned.
    Check with your email provider (your ISP?)
    It would help if you identified who is providing your email service.

  • Refreshing JTable contents (rows and columns) handling.

    Hi,
    I have a general question related to refreshing the contents of JTable and handling some application specific requirements.In our application we are planning to refresh the contents of JTable automatically after certain period of time by fetching data from database and update the JTable contents or user has clicked refresh button.
    But following scenarios we are planning to handle when refresh is called automatically or user has clicked refresh button.
    1) User is working with data of JTable. Like rows of JTable has checkBoxes and user selects them and doing operation like viewing the details of selected rows in new details dialog. So if refreshing is done then the selection will be lost if I update the whole data in JTable.
    a)Will it be possible to append the data at the end of JTable rows without disturbing the existing JTable contents.
    b) Is it feasible to compare the data of existing rows and newly fetched rows and update only the rows whose values are changed in database or update specifically updated columns. But this comparision for finding changed values will result in performance problems.So are there any other alternatives of doing this, ideas are most welcome.
    c) Simple way is to alert the user that data will be updated and everything will be refreshed will be the choice in worst case.
    I guess many may have encountered such problems and may have solved it depending on the product requirements.
    Ideas and suggestions are most welcome.
    Regards.

    Hi,
    Here are my views and my assumptions.
    Assumptions :
    1) Your JTable is populated with list of Objects.
    2) Your tables in database is having columns like created date, created time, updated date updated time
    3) Order by clause for all the time will remain same.
    If these assumptions are correct then I think you can achieve your goal.
    Here how it is.
    Your application session will maintain last db hit time and will maintain for every hit that applicate made to fetch data from db.
    When object is created on the server side once it fetch data from table it will compare the created date/time or update date/time with the session varibale that holds last visit date/time. Based on this flag need to be set to indicate if this item is added/updated/deleted since last visit.
    And when all these object is returned to your client, the table model will iterate through the list and based on object index in the list and and if object is changed will update only that perticular row.
    Hope this is what you want to achieve.
    Regards

  • Excel Services Refresh method not working in Sharepoint 2013

    Hi,
    In our application, we open excel services workbook in sharepoint 2013. Using sessionid of the workbook, we called Refresh and CalculateWorkbook methods in that order. After Calculateworkbook method, I see time stamps in LastUpdatedTime for each connection
    in 'Connections' tab of excel workbook. When Refresh method is called again after CalculateWorkbook  method, the LastUpdatedTime for the connections becomes blank.
    When I use sharepoint 2010, the temstamp is not becoming blank after refresh.
    I think due to this reason we see blank data on our reports. Can somebody tell whether there is a problem with Refresh method in sharepoint 2013? Or is there somebody facing problem with excel services in sharepoint 2013? Any pointers can help.
    Thanks,
    Pranava

    Hi,
    For your issue, verify if Excel files are rendered by Office Web Apps:
    When Office Web Apps is responsible for the rendering the URL will look something like this:
    https://server/_layouts/15/WopiFrame.aspx?sourcedoc=/Documents/excel.xlsx&….
    And when Excel Calc is rendering the document it should look like the following:
    https://server/_layouts/15/xlviewer.aspx?id=/Documents/excel.xlsx&…
    Here is an article about how to enable pdf preview with OWA:
    http://www.wictorwilen.se/sharepoint-2013-enabling-pdf-previews-with-office-web-apps-2013-march-2013-update
    Besides, refer to configure Office Web Apps for SharePoint 2013:
    https://technet.microsoft.com/en-us/library/ff431687.aspx
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • JTable, L&F and a TableCellRenderer

    hey guys :)
    i have a lil prob in my swing application. i use a JTable to display my data and i use custom CellEditors and CellRenderers - so far so good. the problem i have now, that the cell itself isnt highlighted (in any way) if it's row is currently selected.
    therefore i took my renderer and changed this method:
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
    if(isSelected)
         setBackground(new Color(204,204,255));
         System.out.println("selected");
    else
         setBackground(Color.white);
    [...]that's in accordance with the metal L&F color scheme.
    it works - but it's not the right way to do that... and if the user changes the L&F it's obvious.
    my question is, how can i get the colors (foreground and background) wich i have to use?
    (i know it's an L&F method but i hadnt found it up to now)
    ta :)

    If the component you are producing is a JLabel then the easiest way to do this is to make your TableCellRenderer extend the DefaultTableCellRenderer and start your getTableCellRendererComponent method with a call to the same method in the superclass e.g.
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
    JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
    // ... make your other changes to label
    return label;
    This is the easiest way to get all the selection, focus, etc. behaviour
    so long as you can use the JLabel.
    If you need to know how to do it for a different component ask.

  • Enabling materialized view for fast refresh method

    In AWM when i select refresh method as FAST and enable the materialized view, am getting the below error:
    "Refresh method fast requires materialized view logs and a previously run complete refresh of the cube mv". i need this Fast refresh of a cube materialized view, so that it performs an incremental refresh and re-aggregation of only changed rows in the source table.
    can anyone help me on this??

    If you want the cube to hold data even after it has been deleted from the relational table, then you should disable the MV on the cube.
    Synchronization with the source table is determined by the default "cube script".
    <li>CLEAR, LOAD, SOLVE : This will synchronize your cube with the source table. It is a requirement for MVs.
    <li>LOAD, SOLVE: This will allow your cube to contain data even after it has been removed from the source table. It sounds like you want this.
    Cube builds can be "incremental" in one of two ways.
    (1) You can have an "incremental LOAD" if the source table contains only the changed rows or if you use MV "FAST" or "PCT" refresh. Since you can't use MVs, you would need a source table with only the changed rows.
    (2) You will have an "incremental SOLVE" (a.k.a. "incremental aggregation") if there is no "CLEAR VALUES" or "CLEAR AGGREGATES" step and various other conditions hold.
    To force a "complete LOAD" with an "incremental SOLVE" you should have all rows in your source table and run the following build script.
    LOAD, SOLVE You could also run "CLEAR LEAVES, LOAD, SOLVE" to synchronize the cube with the table.
    To force an "incremental LOAD" with a "complete SOLVE" you make the source table contains only the changed rows and the run the following:
    CLEAR AGGREGATES, LOAD, SOLVEor
    LOAD, CLEAR AGGREGATES, SOLVEFinally, if you want both LOAD and SOLVE to be incremental you make the source table contains only the changed rows and the run the following:
    LOAD, SOLVE

  • Hey guys, i get the message "Your Apple ID was deaktivated" I have changed my password and the pay method too but nothing happens

    Hey guys, i get the message "Your Apple ID was deaktivated" I have changed my password and the pay method too but nothing happens

    After resetting your password have you tried logging out of your account on your phone by tapping on your id in Settings > iTunes & App Store and then logging back in to see if that 'refreshes' the account on it and if it then works ?
    If that doesn't fix it then you might need to contact iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • How to find BADI Defination and Implemantation from Method of BADI?

    HI,
       can anyone tell me that how to find BADI Defination and Implemantation from Method of BADI?

    & Report  ZPJA_PM002 (V2)                                            &
    & Text Elements:                                                     &
    & P_DEVC Show user-exits from development class                      &
    & P_LIMIT Limit submit program selection                             &
    & P_FUNC Show function modules                                       &
    & P_SUBM Show submit programs                                        &
    & S01    Selection data (TCode takes precedence  over program name)  &
    report  zpja_pm002
      no standard page heading
      line-size 158.
    *tables: enlfdir.     "Additional Attributes for Function Modules
    data: tabix      like sy-tabix,
          w_linnum   type i,
          w_off      type i,
          w_index    like sy-tabix,
          w_include  like trdir-name,
          w_prog     like trdir-name,
          w_incl     like trdir-name,
          w_area     like rs38l-area,
          w_level,
          w_str(50)  type c,
          w_funcname like tfdir-funcname.
    constants: c_fmod(40) type c value 'Function modules selected: ',
               c_subm(40) type c value 'Submit programs selected: ',
               c_col1(12) type c value 'Enhanmt Type',
               c_col2(40) type c value 'Enhancement',
               c_col3(30) type c value 'Program/Include',
               c_col4(20) type c value 'Enhancement Name',
               c_col5(40) type c value 'Enhancement Description'.
    Work Areas: ABAP Workbench
    data: begin of wa_d010inc.
    data: master type d010inc-master.
    data: end of wa_d010inc.
    data: begin of wa_tfdir.
    data: funcname type tfdir-funcname,
          pname    type tfdir-pname,
          include  type tfdir-include.
    data: end of wa_tfdir.
    data: begin of wa_tadir.
    data: devclass type tadir-devclass.
    data: end of wa_tadir.
    data: begin of wa_tstc.
    data: pgmna type tstc-pgmna.
    data: end of wa_tstc.
    data: begin of wa_tstcp.
    data: param type tstcp-param.
    data: end of wa_tstcp.
    data: begin of wa_enlfdir.
    data: area type enlfdir-area.
    data: end of wa_enlfdir.
    Work Areas: BADIs
    data: begin of wa_sxs_attr.
    data: exit_name type sxs_attr-exit_name.
    data: end of wa_sxs_attr.
    data: begin of wa_sxs_attrt.
    data: text type sxs_attrt-text.
    data: end of wa_sxs_attrt.
    Work Areas: Enhancements
    data: begin of wa_modsap.
    data: member type modsap-member.
    data: end of wa_modsap.
    data: begin of wa_modsapa.
    data: name type modsapa-name.
    data: end of wa_modsapa.
    data: begin of wa_modsapt.
    data: modtext type modsapt-modtext.
    data: end of wa_modsapt.
    Work Areas: Business Transaction Events
    data: begin of wa_tbe01t.
    data: text1 type tbe01t-text1.
    data: end of wa_tbe01t.
    data: begin of wa_tps01t.
    data: text1 type tps01t-text1.
    data: end of wa_tps01t.
    user-exits
    types: begin of t_userexit,
          type(12) type c,
          pname    like trdir-name,
          txt(300),
          level    type c,
          modname(30) type c,
          modtext(40) type c,
    end of t_userexit.
    data: i_userexit type standard table of t_userexit with header line.
    Function module developmnet classes
    types: begin of t_devclass,
          clas   like trdir-clas,
    end of t_devclass.
    data: i_devclass type standard table of t_devclass with header line.
    Submit programs
    types: begin of t_submit,
          pname     like trdir-name,
          level,
          done,
    end of t_submit.
    data: i_submit type standard table of t_submit with header line.
    Source code
    types: begin of t_sourcetab,                        "#EC * (SLIN lügt!)
            line(200),                                  "#EC * (SLIN lügt!)
          end of t_sourcetab.                           "#EC * (SLIN lügt!)
    data: sourcetab type standard table of t_sourcetab with header line.
    data c_overflow(30000) type c.
    Description of an ABAP/4 source analysis token
    data: i_stoken type standard table of stokex with header line.
    data wa_stoken like i_stoken.
    Description of an ABAP/4 source analysis statement
    data: i_sstmnt type standard table of sstmnt with header line."#EC
    keywords for searching ABAP code
    types: begin of t_keywords,
          word(30),
    end of t_keywords.
    data: keywords type standard table of t_keywords with header line.
    function modules within program
    types: begin of t_fmodule,
          name   like rs38l-name,
          pname  like trdir-name,
          pname2 like trdir-name,
          level,
          bapi,
          done,
    end of t_fmodule.
    data: i_fmodule type standard table of t_fmodule with header line.
    & Selection Options                                                  &
    selection-screen begin of block selscr1 with frame title text-s01.
    parameter: p_pname like trdir-name memory id rid,
               p_tcode like syst-tcode,
               p_limit(4) type n default 100,
               p_devc  like rihea-dy_ofn default ' ',
               p_func  like rihea-dy_ofn default ' ',
               p_subm  like rihea-dy_ofn default ' '.
    selection-screen end of block selscr1.
    & START-OF-SELECTION                                                 &
    start-of-selection.
      if p_pname is initial and p_tcode is initial.
        message e008(hrfpm).  "Make entry on the selection screen
        stop.
      endif.
    ensure P_LIMIT is not zero.
      if p_limit = 0.
        p_limit = 1.
      endif.
      perform data_select.
      perform get_submit_data.
      perform get_fm_data.
      perform get_additional_data.
      perform data_display.
    & Form DATA_SELECT                                                   &
    form data_select.
    data selection message to sap gui
      call function 'SAPGUI_PROGRESS_INDICATOR'
        destination 'SAPGUI'
        keeping logical unit of work
        exporting
          text                  = 'Get programs/includes'       "#EC NOTEXT
        exceptions
          system_failure
          communication_failure
        .                                                       "#EC *
    determine search words
      keywords-word = 'CALL'.
      append keywords.
      keywords-word = 'FORM'.
      append keywords.
      keywords-word = 'PERFORM'.
      append keywords.
      keywords-word = 'SUBMIT'.
      append keywords.
      keywords-word = 'INCLUDE'.
      append keywords.
      if not p_tcode is initial.
    get program name from TCode
        select single pgmna from tstc into wa_tstc-pgmna
                     where tcode eq p_tcode.
        if not wa_tstc-pgmna is initial.
          p_pname = wa_tstc-pgmna.
    TCode does not include program name, but does have refereve TCode
        else.
          select single param from tstcp into wa_tstcp-param
                       where tcode eq p_tcode.
          if sy-subrc = 0.
            check wa_tstcp-param(1)   = '/'.
            check wa_tstcp-param+1(1) = '*'.
            if wa_tstcp-param ca ' '.
            endif.
            w_off = sy-fdpos + 1.
            subtract 2 from sy-fdpos.
            if sy-fdpos gt 0.
              p_tcode = wa_tstcp-param+2(sy-fdpos).
            endif.
            select single pgmna from tstc into wa_tstc-pgmna
                   where tcode eq p_tcode.
            p_pname = wa_tstc-pgmna.
            if sy-subrc <> 0.
              message e110(/saptrx/asc) with 'No program found for: '
    p_tcode."#EC NOTEXT
              stop.
            endif.
          else.
            message e110(/saptrx/asc) with 'No program found for: ' p_tcode.
    "#EC NOTEXT
            stop.
          endif.
        endif.
      endif.
    Call customer-function aus Program coding
      read report p_pname into sourcetab.
      if sy-subrc > 0.
        message e017(enhancement) with p_pname raising no_program."#EC *
      endif.
      scan abap-source sourcetab tokens     into i_stoken
                                 statements into i_sstmnt
                                 keywords   from keywords
                                 overflow into c_overflow
                                 with includes.
                                 WITH ANALYSIS.
      if sy-subrc > 0. "keine/syntakt. falsche Ablauflog./Fehler im Skanner
        message e130(enhancement) raising syntax_error.         "#EC *
      endif.
    check I_STOKEN for entries
      clear w_linnum.
      describe table i_stoken lines w_linnum.
      if w_linnum gt 0.
        w_level = '0'.
        w_prog = ''.
        w_incl = ''.
        perform data_search tables i_stoken using w_level w_prog w_incl.
      endif.
    endform.                        "DATA_SELECT
    & Form GET_FM_DATA                                                   &
    form get_fm_data.
    data selection message to sap gui
      call function 'SAPGUI_PROGRESS_INDICATOR'
        destination 'SAPGUI'
        keeping logical unit of work
        exporting
          text                  = 'Get function module data'    "#EC NOTEXT
        exceptions
          system_failure
          communication_failure
        .                                                       "#EC *
    Function module data
      sort i_fmodule by name.
      delete adjacent duplicates from i_fmodule comparing name.
      loop at i_fmodule where done  ne 'X'.
        clear:   i_stoken, i_sstmnt, sourcetab, wa_tfdir, w_include .
        refresh: i_stoken, i_sstmnt, sourcetab.
        clear wa_tfdir.
        select single funcname pname include from tfdir into wa_tfdir
                                where funcname = i_fmodule-name.
        check sy-subrc = 0.
        call function 'FUNCTION_INCLUDE_SPLIT'
          exporting
            program = wa_tfdir-pname
          importing
            group   = w_area.
        concatenate 'L' w_area 'U' wa_tfdir-include into w_include.
        i_fmodule-pname  = w_include.
        i_fmodule-pname2 = wa_tfdir-pname.
        modify i_fmodule.
        read report i_fmodule-pname into sourcetab.
        if sy-subrc = 0.
          scan abap-source sourcetab tokens     into i_stoken
                                     statements into i_sstmnt
                                     keywords   from keywords
                                     with includes.
          if sy-subrc > 0.
            message e130(enhancement) raising syntax_error.
          endif.
    check i_stoken for entries
          clear w_linnum.
          describe table i_stoken lines w_linnum.
          if w_linnum gt 0.
            w_level = '1'.
            w_prog  = i_fmodule-pname2.
            w_incl =  i_fmodule-pname.
            perform data_search tables i_stoken using w_level w_prog w_incl.
          endif.
        endif.
      endloop.
      if p_devc = 'X'.
        loop at i_fmodule.
          clear: wa_tadir, wa_enlfdir.
          select single area from enlfdir into wa_enlfdir-area
                                where funcname = i_fmodule-name.
          check not wa_enlfdir-area is initial.
          select single devclass into wa_tadir-devclass
                          from tadir where pgmid    = 'R3TR'
                                       and object   = 'FUGR'
                                       and obj_name = wa_enlfdir-area.
          check not wa_tadir-devclass is initial.
          move wa_tadir-devclass to i_devclass-clas.
          append i_devclass.
          i_fmodule-done = 'X'.
          modify i_fmodule.
        endloop.
        sort i_devclass.
        delete adjacent duplicates from i_devclass.
      endif.
    endform.                        "GET_FM_DATA
    & Form GET_SUBMIT_DATA                                               &
    form get_submit_data.
    data selection message to sap gui
      call function 'SAPGUI_PROGRESS_INDICATOR'
        destination 'SAPGUI'
        keeping logical unit of work
        exporting
          text                  = 'Get submit data'             "#EC NOTEXT
        exceptions
          system_failure
          communication_failure
        .                                                       "#EC *
      sort i_submit.
      delete adjacent duplicates from i_submit comparing pname.
      w_level = '0'.
      loop at i_submit where done ne 'X'.
        clear:   i_stoken, i_sstmnt, sourcetab.
        refresh: i_stoken, i_sstmnt, sourcetab.
        read report i_submit-pname into sourcetab.
        if sy-subrc = 0.
          scan abap-source sourcetab tokens     into i_stoken
                                     statements into i_sstmnt
                                     keywords   from keywords
                                     with includes.
          if sy-subrc > 0.
           message e130(enhancement) raising syntax_error.
            continue.
          endif.
    check i_stoken for entries
          clear w_linnum.
          describe table i_stoken lines w_linnum.
          if w_linnum gt 0.
            w_prog  = i_submit-pname.
            w_incl = ''.
            perform data_search tables i_stoken using w_level w_prog w_incl.
          endif.
        endif.
    restrict number of submit program selected for processing
        describe table i_submit lines w_linnum.
        if w_linnum ge p_limit.
          w_level = '1'.
        endif.
        i_submit-done = 'X'.
        modify i_submit.
      endloop.
    endform.                       "GET_SUBMIT_DATA
    & Form DATA_SEARCH                                                   &
    form data_search tables p_stoken structure stoken
                            using p_level p_prog p_incl.
      loop at p_stoken.
        clear i_userexit.
        tabix = sy-tabix + 1.
        i_userexit-level = p_level.
        if i_userexit-level = '0'.
          if p_incl is initial.
            i_userexit-pname = p_pname.
          else.
            concatenate  p_pname '/' p_incl into i_userexit-pname.
          endif.
        else.
          if p_incl is initial.
            i_userexit-pname = p_prog.
          else.
            concatenate  p_prog '/' p_incl into i_userexit-pname.
          endif.
        endif.
    Include
        if p_stoken-str eq 'INCLUDE'.
          check p_level eq '0'.    " do not perform for function modules
    *(2nd pass)
          w_index = sy-tabix + 1.
          read table p_stoken index w_index into wa_stoken.
          check not wa_stoken-str cs 'STRUCTURE'.
          check not wa_stoken-str cs 'SYMBOL'.
          read table i_submit with key pname = wa_stoken-str.
          if sy-subrc <> 0.
            i_submit-pname = wa_stoken-str.
            i_submit-level = p_level.
            append i_submit.
          endif.
        endif.
    Enhancements
        if p_stoken-str eq 'CUSTOMER-FUNCTION'.
          clear w_funcname.
          read table p_stoken index tabix.
          translate p_stoken-str using ''' '.
          condense p_stoken-str.
          if p_prog is initial.
            concatenate 'EXIT' p_pname p_stoken-str into w_funcname
                         separated by '_'.
          else.
            concatenate 'EXIT' p_prog p_stoken-str into w_funcname
                   separated by '_'.
          endif.
          select single member from modsap into wa_modsap-member
                where member = w_funcname.
          if sy-subrc = 0.   " check for valid enhancement
            i_userexit-type = 'Enhancement'.
            i_userexit-txt  = w_funcname.
            append i_userexit.
          else.
            clear wa_d010inc.
            select single master into wa_d010inc-master
                  from d010inc
                     where include = p_prog.
            concatenate 'EXIT' wa_d010inc-master p_stoken-str into
    w_funcname
                   separated by '_'.
            i_userexit-type = 'Enhancement'.
            i_userexit-txt  = w_funcname.
          endif.
        endif.
    BADIs
        if p_stoken-str cs 'cl_exithandler='.
          w_index = sy-tabix + 4.
          read table p_stoken index w_index into wa_stoken.
          i_userexit-txt = wa_stoken-str.
          replace all occurrences of '''' in i_userexit-txt with space.
          i_userexit-type = 'BADI'.
          append i_userexit.
        endif.
    Business transaction events
        if p_stoken-str cs 'OPEN_FI_PERFORM'.
          i_userexit-type = 'BusTrEvent'.
          i_userexit-txt = p_stoken-str.
          replace all occurrences of '''' in i_userexit-txt with space.
          i_userexit-modname =  i_userexit-txt+16(8).
          case i_userexit-txt+25(1).
            when 'E'.
              clear wa_tbe01t.
              select single text1 into wa_tbe01t-text1 from tbe01t
                               where event = i_userexit-txt+16(8)
                                 and spras = sy-langu.
              if wa_tbe01t-text1 is initial.
                i_userexit-modtext = ''.            "#EC NOTEXT
              else.
                i_userexit-modtext = wa_tbe01t-text1.
              endif.
              i_userexit-modname+8 = '/P&S'.                    "#EC NOTEXT
            when 'P'.
              clear wa_tps01t.
              select single text1 into wa_tps01t-text1 from tps01t
                               where procs = i_userexit-txt+16(8)
                                 and spras = sy-langu.
              i_userexit-modtext = wa_tps01t-text1.
              i_userexit-modname+8 = '/Process'.
          endcase.
          append i_userexit.
        endif.
    Program exits
        if p_stoken-str cs 'USEREXIT_'.
          i_userexit-type = 'Program Exit'.
          i_userexit-txt = p_stoken-str.
          replace all occurrences of '''' in i_userexit-txt with space.
          append i_userexit.
        endif.
    Submit programs
        if p_stoken-str cs 'SUBMIT'.
          check p_level eq '0'.    " do not perform for function modules
    *(2nd pass)
          check not p_stoken-str cs '_'.   " ensure not SUBMIT_XXX
          w_index = sy-tabix + 1.
          read table p_stoken index w_index into wa_stoken.
          check not wa_stoken-str cs '_'.   " ensure not SUBMIT_XXX
          replace all occurrences of '''' in wa_stoken-str with space.
          read table i_submit with key pname = wa_stoken-str.
          if sy-subrc <> 0.
            i_submit-pname = wa_stoken-str.
            i_submit-level = p_level.
            append i_submit.
          endif.
        endif.
    Perform routines (which reference external programs)
        if p_stoken-str cs 'PERFORM'.
          check p_level eq '0'.    " do not perform for function modules
    *(2nd pass)
          w_index = sy-tabix + 1.
          read table p_stoken index w_index into wa_stoken.
          if not wa_stoken-ovfl is initial.
            w_off = wa_stoken-off1 + 10.
            w_str = c_overflow+w_off(30).
            find ')' in w_str match offset w_off.
            w_off = w_off + 1.
            wa_stoken-str = w_str(w_off).
          endif.
          check wa_stoken-str cs '('.
          w_off = 0.
          while sy-subrc  = 0.
            if wa_stoken-str+w_off(1) eq '('.
              replace section offset w_off length 1 of wa_stoken-str with ''
              replace all occurrences of ')' in wa_stoken-str with space.
              read table i_submit with key pname = wa_stoken-str.
              if sy-subrc <> 0.
                i_submit-pname = wa_stoken-str.
                append i_submit.
              endif.
              exit.
            else.
              replace section offset w_off length 1 of wa_stoken-str with ''
              shift wa_stoken-str left deleting leading space.
            endif.
          endwhile.
        endif.
    Function modules
        if p_stoken-str cs 'FUNCTION'.
          clear i_fmodule.
          check p_level eq '0'.    " do not perform for function modules
    *(2nd pass)
          w_index = sy-tabix + 1.
          read table p_stoken index w_index into wa_stoken.
         if wa_stoken-str cs 'WF_'.
         if wa_stoken-str cs 'IF_'.
           break-point.
         endif.
          if wa_stoken-str cs 'BAPI'.
            i_fmodule-bapi = 'X'.
          endif.
          replace first occurrence of '''' in wa_stoken-str with space.
          replace first occurrence of '''' in wa_stoken-str with space.
          if sy-subrc = 4.   " didn't find 2nd quote (ie name truncated)
            clear wa_tfdir.
            concatenate wa_stoken-str '%' into wa_stoken-str.
            select single funcname into wa_tfdir-funcname from tfdir
                         where funcname like wa_stoken-str.
            if sy-subrc = 0.
              i_fmodule-name = wa_tfdir-funcname.
            else.
              continue.
            endif.
          else.
            i_fmodule-name = wa_stoken-str.
          endif.
          i_fmodule-level = p_level.
          append i_fmodule.
        endif.
      endloop.
    endform.                        "DATA_SEARCH
    & Form GET_ADDITIONAL_DATA                                           &
    form get_additional_data.
    data selection message to sap gui
      call function 'SAPGUI_PROGRESS_INDICATOR'
        destination 'SAPGUI'
        keeping logical unit of work
        exporting
          text                  = 'Get additional data'         "#EC NOTEXT
        exceptions
          system_failure
          communication_failure
        .                                                       "#EC *
      loop at i_userexit.
    Enhancement data
        if  i_userexit-type cs 'Enh'.
          clear: wa_modsapa.
          select single name into wa_modsapa-name from modsap
                            where member = i_userexit-txt.
          check sy-subrc = 0.
          i_userexit-modname = wa_modsapa-name.
          clear wa_modsapt.
          select single modtext into wa_modsapt-modtext from modsapt
                            where name = wa_modsapa-name
                                         and sprsl = sy-langu.
          i_userexit-modtext = wa_modsapt-modtext.
        endif.
    BADI data
        if  i_userexit-type eq 'BADI'.
          clear wa_sxs_attr.
          select single exit_name into wa_sxs_attr-exit_name from sxs_attr
                                        where exit_name = i_userexit-txt.
          if sy-subrc = 0.
            i_userexit-modname = i_userexit-txt.
          else.
            i_userexit-modname = 'Dynamic call'.                "#EC NOTEXT
          endif.
          clear wa_sxs_attrt.
          select single text into wa_sxs_attrt-text from sxs_attrt
                                         where exit_name =
    wa_sxs_attr-exit_name
                                           and sprsl = sy-langu.
          i_userexit-modtext = wa_sxs_attrt-text.
        endif.
        modify i_userexit.
      endloop.
    get enhancements via program package
      clear wa_tadir.
      select single devclass into wa_tadir-devclass from tadir
                                 where pgmid    = 'R3TR'
                                   and object   = 'PROG'
                                   and obj_name = p_pname.
      if sy-subrc = 0.
        clear: wa_modsapa, wa_modsapt.
        select name from modsapa into wa_modsapa-name
                              where devclass = wa_tadir-devclass.
          select single modtext from modsapt into wa_modsapt-modtext
                              where name = wa_modsapa-name
                                and sprsl = sy-langu.
          read table i_userexit with key modname = wa_modsapa-name.
          if sy-subrc <> 0.
            i_userexit-modtext = wa_modsapt-modtext.
            i_userexit-type = 'Enhancement'.                    "#EC NOTEXT
            i_userexit-modname  = wa_modsapa-name.
            i_userexit-txt = 'Determined from program DevClass'."#EC NOTEXT
            i_userexit-pname = 'Unknown'.                       "#EC NOTEXT
            append i_userexit.
          endif.
        endselect.
      endif.
    endform.                        "GET_ADDITIONAL_DATA
    & Form DATA_DISPLAY                                                  &
    form data_display.
    data selection message to sap gui
      call function 'SAPGUI_PROGRESS_INDICATOR'
        destination 'SAPGUI'
        keeping logical unit of work
        exporting
          text                  = 'Prepare screen for display'  "#EC NOTEXT
        exceptions
          system_failure
          communication_failure
        .                                                       "#EC *
      sort i_userexit by type txt modname.
      delete adjacent duplicates from i_userexit comparing txt modname.
    format headings
      write: 'Enhancements from main program'.                  "#EC NOTEXT
      write: /.
      uline.
      format color col_heading.
      write: /    sy-vline,
             (12) c_col1,                    "Enhanmt Type
                  sy-vline,
             (40) c_col2,                    "Enhancement
                  sy-vline,
             (30) c_col3,                    "Program/Include
                  sy-vline,
             (20) c_col4,                    "Enhancement name
                  sy-vline,
             (40) c_col5,                    "Enhancement description
                  sy-vline.
      format reset.
      uline.
    format lines
      loop at i_userexit.
    set line colour
        case i_userexit-type.
          when 'Enhancement'.
            format color 3 intensified off.
          when 'BADI'.
            format color 4 intensified off.
          when 'BusTrEvent'.
            format color 5 intensified off.
          when 'Program Exit'.
            format color 6 intensified off.
          when others.
            format reset.
        endcase.
        write: / sy-vline,
                 i_userexit-type,
                 sy-vline,
                 i_userexit-txt(40),
                 sy-vline,
                 i_userexit-pname(30),
                 sy-vline,
                 i_userexit-modname(20),
                 sy-vline,
                 i_userexit-modtext(40),
                 sy-vline.
      endloop.
      format reset.
      uline.
    user-exits from development class of function modules
      if p_devc = 'X'.
        write: /.
        write: / 'User-exits from function module development class'."#EC
    *NOTEXT
        write: 157''.
        uline (90).
        write: 157''.
        loop at i_devclass.
          clear wa_modsapa.
          select name from modsapa into wa_modsapa
                       where devclass = i_devclass-clas.
         select single name modtext into corresponding fields of wa_modsapt
                                       from modsapt
                                         where name  = wa_modsapa-name
                                           and sprsl = sy-langu.
            format color 3 intensified off.
            write: / sy-vline,
                     (12) 'Enhancement',
                     sy-vline,
                    wa_modsapa-name,
                    sy-vline,
                    wa_modsapt-modtext,
                    sy-vline.
          endselect.
        endloop.
        uline (90).
        format reset.
      endif.
      describe table i_fmodule lines w_linnum.
      write: / c_fmod , at 35 w_linnum.                         "#EC NOTEXT
      write: 157''.
      if p_func = 'X'.
    display fuction modules used in program
        uline (38).
        write: 157''.
        loop at i_fmodule.
          write: sy-vline,
                 i_fmodule-name,
                 sy-vline,
                 i_fmodule-bapi,
                 sy-vline.
          write: 157''.
        endloop.
        uline (38).
      endif.
      describe table i_submit lines w_linnum.
      write: / c_subm , at 35 w_linnum.                         "#EC NOTEXT
      write: 157''.
      if p_subm = 'X'.
    display submit programs used in program
        uline (44).
        write: 157''.
        loop at i_submit.
          write: sy-vline,
                 i_submit-pname,
                 sy-vline.
          write: 157''.
        endloop.
        uline (44).
      endif.
    issue message with number of user-exits displayed
      describe table i_userexit lines w_linnum.
      message s697(56) with w_linnum.
    endform.                        "DATA_DISPLAY
    reward points if it helps
    gunjan

  • Regarding BDC and Call transaction Method

    hi gurus,
          can anyone tell the difference how many records Call transaction and Session
    Method can upload in case of single transaction and what is the time taken by each.its urgent pls.
    thanks and regards.

    Rajesh,
    u can do as many as ,
    coming to speed means it depends on server,
    if ur using session then u can calculate time ,
    with in one time h many records system will upload the records by seeing in sm35
    (first see h many records systems uploads, see the number and put the time , after one min again see the records h many it is ,) u can calculate by this.
    remember this speed will changes depends on server,
    so if u have n number of records better to do upload in weekends.
    2) if u r using call transaction method means , normally we use error file where ever record occurs that record is in error file, i think we cant analyze h many records it will be with in a time r .
    we can also check by going respective tables , just put the time and do refreshing the table after one minute , n this way u can analyze .
    Thanks

  • Animated gif and page refresh problem

    Animated gif and page refresh problem
    Hi There,
    I'm trying to build a simple "Please wait......" screen using jsp and javascript.
    So far all is going well except that my animatate gif keeps refreshing everything the page is refresh.
    Is there a way the i can prevent the body of the page from refreshing?
    below is my sample code:
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <jsp:useBean id="StatusBean" class="com1.CandidateRelease" scope="session"/>
    <html>
    <script LANGUAGE="JavaScript">
    function refresh()
    <% if (StatusBean.isRunning()) { %>     
         //setTimeout("refresh()", 1000);
         setTimeout("location='status.jsf'", 1000);
    <% }else{%>
         window.location= "busStopAdmin.jsf";
    <%} %>
    </script>
    <head>
         <script LANGUAGE="JavaScript">     
              refresh();
         </script>     
    </head>
    <body>
         <img id="myImage" src="../img/ojp_wait.gif" alt="" width="151" height="36">
    </body>
    </html>

    Animated gif and page refresh problem
    Hi There,
    I'm trying to build a simple "Please wait......" screen using jsp and javascript.
    So far all is going well except that my animatate gif keeps refreshing everything the page is refresh.
    Is there a way the i can prevent the body of the page from refreshing?
    below is my sample code:
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <jsp:useBean id="StatusBean" class="com1.CandidateRelease" scope="session"/>
    <html>
    <script LANGUAGE="JavaScript">
    function refresh()
    <% if (StatusBean.isRunning()) { %>     
         //setTimeout("refresh()", 1000);
         setTimeout("location='status.jsf'", 1000);
    <% }else{%>
         window.location= "busStopAdmin.jsf";
    <%} %>
    </script>
    <head>
         <script LANGUAGE="JavaScript">     
              refresh();
         </script>     
    </head>
    <body>
         <img id="myImage" src="../img/ojp_wait.gif" alt="" width="151" height="36">
    </body>
    </html>

  • Easiest and/or best methods for generating XML output (not with a report)

    Hi, several of our EBS customers (11.5.10) are converting their PDF reports to use XML/BI publisher to produce output. The data stream comes from a report that generates the XML output, and then the XML template is applied. This works great ... no problems, etc. From what I have read, however, Oracle intends to treat the traditional Forms and Reports Developers as legacy tools (although still supporting them, of course).
    My question is if I wanted to ditch using Reports to generate XML output, what, in your opinion or in your current usage, is the easiest way of getting this data? In Reports, the data modeler is excellent in providing a method to write your queries, split them into different repeating groups, write formula and summary columns, link multiple queries, etc, etc. If one were to become Reports Developer free, what comparable tools are available to take its place? I would expect this tool to handle a mix of GUI and coding like the Reports data modeler. Please note that I'm not looking for an EBS-specific solution -- say for a custom application using regular Oracle 10g DB and iAS, with BI Publisher for reporting.
    Thanks for your feedback,
    Ryan

    What I'm looking for is to not use Oracle Reports to generate the XML data output since Oracle's statement of direction is pushing BI Publisher rather than Oracle Reports as the preferred tool for reporting. That said, the data modeler in Reports provides a very flexible tool to construct and link multiple queries and to manipulate the queries into several levels of a master/detail relationship. Further, the mix of GUI and coding makes setting up the data model a lot more efficient. What I'm looking for (and I don't know if anything exists) is something comparable that can be used to generate XML output from the DB -- the idea being that I wouldn't use legacy tools, like Reports, for this task. I hope that is clearer.
    Really, another way of answering my question is, aside from Reports and the APIs mentioned so far, what are my fellow developers using, if anything, to extract XML data in a way that handles the features i list above?

  • Using Excel 2007 to display and auto-refresh planning.

    Hi all,
    a customer wants to display a simple planning screen on a 24" monitor.
    We're using an old domain pc, with domain user (planning) logged on to display the planning file.
    We've configured the worksheet so that multiple users can edit it.
    I've also found the settings which auto-update the file. I was amazed that this is standard functionality.
    Although, it doesn't work as we expected. It goes well, but when too much users work in the file, some users still get the error message: 'can't open file because it's already in use'.
    This does NOT happen when the file is not constantly opened by the 'planning user'.
    So that's one issue, probably caused by the 'planning user', having the file opened 24/7.
    Another issue is that the file stops auto-refreshing after a while. I didn't find any pattern in that.
    So basically, what the customer needs is:
    Display Excel worksheet
    Auto-refresh
    I've found some nice articles about SharePoint and Excel services, but unfortunately they're running SharePoint 2010 Foundation, which does not include Excel services...
    Is there any other way or tool to achieve this, without using the Excel-built-in options?
    Or maybe there's a fix for that problem?
    Thanks in advance.

    Hi LunAds,
    I'm afraid you have just discovered how bad these features are implemented in Excel: they just don't work properly and I always advise against using them for any serious long-term solution.
    If you do not have Excel services, then editing the document on the server (which would prevent lots of problems) is out of the question indeed.
    Alternatives depend a lot on your needs.
    For example, you could use sharepoint lists that the users can edit and then import those lists into Excel for reporting purposes.
    But if this is relational data (parent-child tables, which is very often the case) then a database solution is probably the best route to take.
    Regards, Jan Karel Pieterse|Excel MVP|http://www.jkp-ads.com

Maybe you are looking for

  • Can you use the mic of a bluetooth stereo headset on an iPod touch 2G w/ fi

    Hi guys. I have a Dell bluetooth stereo headset with mic incorporated. I want to use this to have conversations with my iPod touch, using voip software. Can this be done? I'm asking because when I pair the headset with my iPod, the new voice notes ap

  • Calling program

    Dear Experts,      I have a requirements explained below.     I have writen a Z program with the selection screen,  i need to execute the standard program RIMHIO00 (grid report)from Z Program by passing values to the selection screen of standard prog

  • Prompt settings being passed between Dashboard Pages - Can this be stopped?

    I have a dashboard with 4 pages. Pages 1 and 2 share the exact same prompt, page 3 has its own prompt but within that prompt it has a field that is common with the prompt on pages 1 and 2. Page 4 has its own prompt as well with some fields that are c

  • NI 488.2 - 3.1.1 installation error (windows 7)

    Hello, I tried to install the NI 488.2 driver to connect an GPIB-USB-HS device on my computer. All my try were unsuccessful (execute as administrator, desactivate my antivirus software,...). The joined messages appeared. Thank you in advance for your

  • Error when opening portal page-inner desktop frame work image error

    Hi, I have installed EP-6.0.Ima getting an error when i log in to portal. An exception occurred while processing a request for : iView : pcd:portal_content/every_user/general/defaultDesktop/frameworkPages/frameworkpage/com.sap.portal.innerpage/com.sa