How to store selections of multiple comboBox in to Array

Mine only store the last comboBox's selection which is really wierd.
Who could give some suggestion pls?
Besides anyone know how to display different contents in different comboBox within one column of the table pls?
Help!!!

Sorry, but can you explain more specifically pls?
By the way here is the full code, I'm trying to apply data file into a quiz program and collect answers from combobox selection, which is adding them into an array:
public void go(){          
          fc = new JFileChooser();           
          //Presentation Part
          //JTable
          String[] columnNames={"Question","Answer","Points"};
          Object[][] data={};
          dtm = new MyTableModel(data, columnNames);
          table=new JTable(dtm);
          table.setPreferredScrollableViewportSize(new Dimension(500,570));
          JScrollPane scrollPane= new JScrollPane(table);
          //image Icon
          iIcon = new ImageIcon("icon1.jpg");
          //Setup Two Buttons for main Panel
          button = new JButton("Load Questions");
          button2 = new JButton("Calculate Score");
          button.addActionListener(new ButtonListener());
        button2.addActionListener(new ButtonListener());
          //Set panels to frame
          JPanel mainPanel = new JPanel();
          mainPanel.add(button,"South");
          mainPanel.add(button2);
          mainPanel.add(scrollPane);
          //Set frame
          frame = new JFrame("IOExample");
          frame.getContentPane().add(mainPanel);
          frame.setSize(750, 720);
          frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
          frame.setVisible(true);
     public static void main(String[] args) {               
               Homework3 example = new Homework3();
               example.go();
     public class ButtonListener implements ActionListener{
          public void actionPerformed(ActionEvent e) {
                 String command = e.getActionCommand();
                 //read selected answers                 
                if (command.equals("Calculate Score")) {
                     for (int j=0;j<i;j++){                         
                          Object index = comboBox[j].getSelectedItem();
                         checkList[j]=(String) index;
                          System.out.println("test "+(j+1)+" "+checkList[j]);
                        checkList[0]= (String) comboBox[0].getSelectedItem();
                         System.out.println(Thread.currentThread().getContextClassLoader().getResource(""));
                // read data and apply to interface
                 if (command.equals("Load Questions")) {
                      if(e.getSource()==button){
                           int returnVal=fc.showOpenDialog(frame);
                           if (returnVal==JFileChooser.APPROVE_OPTION){
                                File file=fc.getSelectedFile();
                                //open file and split in to lines
                                try {
                                     String thisLine;
                                     ArrayList<String> arrayList=new ArrayList<String>();
                                    FileReader fr= new FileReader(file);
                                    BufferedReader br = new BufferedReader(fr);
                                    i = 0;
                                    while ((thisLine = br.readLine()) != null) { // while loop begins here
                                             // split row and add it to table
                                             arrayList.add(thisLine);
                                              String row [] = null;
                                              row = thisLine.split(";");
                                              dtm.addRow(row);
                                              answerList=row[3];
                                        //render collumns
                                        TableColumn col = table.getColumnModel().getColumn(0);
                                        col.getCellRenderer();
                                        //Split answer options
                                        TableColumn answer = table.getColumnModel().getColumn(1);
                                        String temp [] = null;
                                        temp = row[1].split("/");
                                        //add 3 options to ComboBox
                                        comboBox[i]=new JComboBox();                              
                                             comboBox[i].addItem(temp[0]);
                                             comboBox[i].addItem(temp[1]);
                                             comboBox[i].addItem(temp[2]);
                                             comboBox[i].setSelectedItem(temp[0]);
                                             answer.setCellEditor(new DefaultCellEditor(comboBox[i]));
                                             //comboBox[i].addActionListener(new ComboBoxListener());
                                        i++;
                                             System.out.println("Q"+i+" Correct Answer: "+row[3]);
                              br.close();
                              catch (IOException e1) {
                              System.err.println("Error: " + e1);
                    }else {System.out.println("Sorry! no file");
class MyTableModel extends DefaultTableModel{
     public Object data;
          MyTableModel(Object[][]d, Object[]c){
          super(d,c);
public Class getColumnClass(int c){
     return getValueAt(0,c).getClass();
class Renderer extends JLabel implements TableCellRenderer {
     public void MyQuestionLogo() {
          JLabel label = new JLabel("Icon", iIcon, JLabel.CENTER);
     public Component getTableCellRendererComponent(
          JTable table, Object color,
          boolean isSelected, boolean hasFocus,
          int row, int column) {
          return this;

Similar Messages

  • How do I select from multiple schema's

    How do I select from multiple schema's
    Tried:
    SELECT * FROM schema1.table1, schema2.table2
    WHERE schema1.table1.column1 = schema2.table2.column2;
    Errored......

    Thanks
    We finally got in touch with our DBA and he said the same thing.
    SELECT t1.*,
    t2.*
    FROM schema1.table1 t1,
    schema2.table2 t2
    WHERE t1.column1 = t2.column2;
    I'll try it afther I finish a task my boss just gave me.
    BRB then.

  • How do you select/move multiple clips from one timeline to another?

    Has to do with combining multiple edls from Avid - required due to an issue with duplicate reel names in the original Arri footage. I can move them one at a time, but it is very tedious. Is there a way to select multiple clips and move them together?

    Actually discovered the magic of the shift key.
    IRCP Beauty doesn't recognize multiple timelines in a session, so first you have to at least get the footage on multiple tracks in the same timeline. Shift + drag on the track will allow you to move it to another timeline. Also Shift + drag on the center of the first clip in a sequence will slide the entire sequence down - which is how timelines end up getthing offset all the time. Also, if there are multiple tracks in a timeline and some are locked and some aren't, Shift + drag on a clip will slide ALL UNLOCKED tracks in the timeline.
    Finally, Shift + click on either in or out marker moves both points up or down the timeline.

  • How to store (non-persistent) multiple float[] arrays.

    Hi;
    In a situation where an object needs to store multiple float arrays, how can I use a 2 dimensional array to store them? I can't use a collection since an array is a primitive.
    I would use a 2 dimensional array, but my keys to get/set these arrays are ints. So I cant do a "int i[][]", nor a "float f[][]".
    Any ideas?
    Thanks;
    -nat

    You could make a Map (such as HashMap) with an
    Integer (java.lang.Integer) key and a "int []" or "float []" as a value (an array is an Object, so can be put as a value).You kid me not! I need to review my basics.
    I simply didn't know that an array of primitives can be stored as a value in a map.
    Thank you!
    -nat

  • How can I select between multiple JREs to run an *applet* in MSIE??

    (I'm posting this after spending quite a bit of time trolling the Forum for an answer, and could definitely use some help - thanks in advance!)
    I've got an applet that opens a socket to a small server running on an embedded controller to download some data. Recently, it started taking forever (>30 seconds) to open the socket, but but once its open, the download is fine.
    The problem seems to have cropped up around the time that JRE 1.5.0_02 came out. I'd like to do some testing with older versions to see if this is really true.
    The environment here is Microsoft Internet Explorer running under XP Pro.
    It appears that the version of JRE loaded by the browser will depend upon a registry setting, and while I've found several likely candidates in HKEY_CLASSES_ROOT|LOCAL_MACHINE_SOFTWARE|JavaSoft, none of them seem to make a difference. I restarted the browser after each attempt, but did not reboot the machine. I also experimented with CLASSPATH, but that seemed to be ignored as well.
    Again, the goal is to be able to switch between JREs involked by the browser for an applet.
    Can anyone offer some help on how to do this.
    Thanks, - LR
    PS - I know the delay in the applet is occuring when the socket is opened because I surrounded the Socket() call with two System.err.println() calls, and can see it hanging there. The first println happens, there's a long pause, and then I see the second one simultaneously with my server showing that the data is being served.

    Chuck,
    First of all, thanks very much for the quick reply
    I took a look at your post, and the reference in the Java Deployment Guide it mentions. I was able to run jpicpl32.exe in the /oldversion/bin, enable it for the browser, and get the old version running.
    But now I can't seem to get back to the current one. When I execute Java from the XP Control Panel and look in Java|Java Applet Runtime Settings, I see only the new version (1.5.0_02). If I select it, and then hit OK and Apply, when I restart the brower I still get the old version (1.4.2_07).
    What am I missing?
    Thanks again,
    -lr

  • Shared Objects: How to store and read multiple instances

    Hi,
    Can we store multiple instances of Shared Objects in memory and read the desired instance.
    e.g
    If i execute the below program twice then also it will create only a single instance in the memory.
    Can we create a memory object with a key and then read the instance with the object with key
    data: handle type ref to ZCL_SHM_AREA_XX,
          root   type ref to ZCL_SHM_AREA_ROOT_XX.
    handle = ZCL_SHM_AREA_XX=>attach_for_write( ).
    create object root AREA HANDLE handle.
    root->FORM = 'Termination'.
    handle->set_root( root ).
    handle->detach_commit( ).

    Hi Sameer,
    check my reply to Recursive methods..
    Cheers
    Graham Robbo

  • How to store select query output in arrays.

    i created a varray type variables and now want to assign some data though select query output in pl/sql code as well as in reports 6i.

    You're in the wrong forum (this one is for issues with the SQL Developer tool). You were in the right one where you posted first, but don't reuse unrelated threads as you did.
    Regards,
    K.

  • How to store vaults for multiple libraries on one drive

    Does anyone know if one can have a vault for three different Aperture libraries on the same external drive? The prompt says something about erasing all vaults.

    Tanja Turtsanyi wrote:
    I have a new Macbook Pro with Yosemite.
    Apple>About This Mac>More Info>Service
    Please read the warranty paperwork that came w/your computer.
    You have 14 days to return the computer w/no questions asked. 
    You have 90 days of FREE phone tech support on top of your standard 1 year warranty unless you also purchased AppleCare which gives you an additional 2 years of coverage plus FREE phone support.
    Strongly suggest that you take FULL advantage of the above before it runs out.  Let Apple deal w/the problems.
    Mac OS X (10.4)
    Conflicting info:  Please update/correct your profile so that you can receive the correct troubleshooting suggestions.  This will assist the users in trying to help you.  Thank you.

  • How to store the measured data in a new array

    we want to put the measured data in a new array and then use this array to plot the SPC chart. Can anyone provide some suggestions?

    are you using some kind of data acquisition? If you reading in a loop you can build an array using the autoindexing tunnel (best way). Or you can use the build array function with a shift register inside a loop. Can you post an example?
    BJD1613
    Lead Test Tools Development Engineer
    Philips Respironics
    Certified LV Architect / Instructor

  • Getting selected item from combobox itemrenderer and storing in object

    Hi Guys,
    Can anyone help me in this regard. Its very urgent.
    I have a combo box itemrenderer in datagrid column. I want to get the user selected item from the dropdown of the row(s) (User may select values from combo box from multiple rows of datagrid) and corressponding values of all other columns of the rows and store it in an object . Then pass this object to database to update only those rows that user has changed.
    I am able to get the selected item from combo box using "event.currentTarget.selectedItem" and corressponding values of all other columns of the rows using "valueSelect.ID", etc where valueSelect is object which contains data for datagrid. But am stuck up with, how to store the selected item value of the combobox  and corressponding values of all other columns of the rows into an Object ?.
    Can anybody help me with sample to store selected item from combobox and its corressponding values of all other columns into an object which i can send to db...?
    Kindly help me in this regard.
    Thanks,
    Anand.

    Hi!
    Are you using a collection of VO or DTO as the dataprovider of the combobox component?
    If so, have you created some attribute there to control the user's selection in the combobox?
    For instance:
    private var selected:Boolean = false;
    If your solution fits this approach, you may create a new collection that contains just the objects that were selected by the user, it means you can loop through the datagrid's dataprovider and only insert in this new collection those objects that have the attribute "selected" set to true.
    For instance:
    private function getSelectedRecords(datagridDataProvider:ArrayCollection):ArrayCollection
        var newCollection:ArrayCollection = new ArrayCollection();
        for each (var item:Object in datagridDataProvider)
            if (item.selected)
                newCollection.addItem(item)
        return newCollection;
    Afterwards, you may serialize this new collection with your back-end.
    Hope it helps you!
    Cheers,
    @Pablo_Souza

  • How to pass the single/multiple selected data of a table to SAP(R/3)

    Hi ,
    I have a table with 2 colums and 10 records.Now i want to send the selected record/Multiple records to the R/3.
    Once the user checks the checkbox i retrieved the column values of that row/rows into a string array.
    and i added all the string arrays to an AbstractList.
    Now in function module it is giving as setT_TestOperations(AbstractList)
    can any one help as  how the function module understands the individual/multiple String arrays.
    If possible provide sample code for the same.
    Thanks and regards,
    Chandrashekar.

    One way to achieve this is to maintain an attribute in the assistance class or a node element , called OldLeadSelection , at the Component controller level which stores the value of the lead selection index.
    On LeadSelect action handler method, in the first line, read the value of the attribute/element defined above. For the first time a row is lead selected, this value will be initial. After exexcuting the code in the LeadSelection event handler method, store the LeadSelection index value in the attribute defined above. The next time when the LeadSelection event method is called, when the value of this attribute is read in the initial line, it will house the value of the index of the previous LeadSelection.
    There could be other ways to achieve this. This is one of the methods.
    Best Regards,
    Rashmi.

  • How to store multiple files from SAp in to Application server?

    Hi Guys,
                 Can anybody tell me how to store multiple files from SAP into Application server.in my application i have to get the data from SAP tables BSEG , BKPF , BSAK and BSIK that to daily i have to do.
                Any Logic  or Code for how to do is welcomed.
                        plz help me urgently.
    Thanks,
    Gopi

    Hi,
      directories creates basis. If you have task to store data in application server you already should have information into which folder you have to do it. If you don't have this information because it is just for example training for next task then you can use your personal folder into which you have access. To get list of all available folders please look at attached code and form get_directories (you get the list of folders you see in transaction AL11). But don't forget: If you are using open dataset you have to have rights to access application folder!
    Here you are code which I use to upload text files from local disc into application folder
    Regards,
      Karol
    *& Report  FILE_PC_TO_SAP
    REPORT  FILE_PC_TO_SAP.
    DATA: BEGIN OF searchpoints OCCURS 100,
            DIRNAME(200)     TYPE c, " name of directory.
            sp_name(100)     TYPE c," name of entry. (may end with *)
          END OF searchpoints.
    DATA: BEGIN OF isearchpoints OCCURS 10,
            dirname(75) TYPE c,            " name of directory.
            aliass(75)  TYPE c,            " alias for directory.
            svrname(75) TYPE c,            " svr where directory is availabl
            sp_name(75) TYPE c,            " name of entry. (may end with *)
            sp_cs(10)   TYPE c,            " ContainsString pattern for name
          END OF isearchpoints.
    data: l_file type filetable.
    data: l_rc   type i.
    data: itab   type TABLE OF string.
    data: g_tmp_file_path type rlgrap-filename.
    data: wa_itab type string.
    data: h_destin(100) type c.
    data: dat      type string.
    INITIALIZATION.
    perform get_directories.
    START-OF-SELECTION.
    parameters: in_file type string OBLIGATORY LOWER CASE.
    parameters: destin(100) type c OBLIGATORY LOWER CASE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      = in_file
       "FILETYPE                      = 'BIN'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = ' '
       HEADER_LENGTH                 = 0
       READ_BY_LINE                  = 'X'
       DAT_MODE                      = ' '
      TABLES
        DATA_TAB                     = itab
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17.
    IF sy-SUBRC <> 0.
      write: / 'Error during loading input file!'.
    ENDIF.
    if h_destin is INITIAL.
      h_destin = in_file.
    endif.
    CONCATENATE destin h_destin into dat SEPARATED BY '/'.
    *TRANSLATE dat TO UPPER CASE.
    OPEN DATASET dat FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-SUBRC = 0.
      loop at itab into wa_itab.
         TRANSFER: wa_itab TO dat.
      endloop.
      CLOSE DATASET dat.
      write: / 'File uploaded!'.
    ELSE.
      write: / 'Not possible to open dataset'.
    ENDIF.
    at selection-screen on value-request for in_file.
      perform select_input_file_name.
      loop at l_file into g_tmp_file_path.
        move g_tmp_file_path to in_file.
        h_destin = ''.
        SPLIT g_tmp_file_path at '\' into table itab.
        loop at itab into g_tmp_file_path.
          h_destin = g_tmp_file_path.
        endloop.
      endloop.
    at selection-screen on value-request for destin.
      DATA: lt_dfies    TYPE TABLE OF dfies.
      DATA: lwa_dfies   TYPE dfies.
      CALL FUNCTION 'DDIF_FIELDINFO_GET'
        EXPORTING
          tabname    = '/BI0/PCO_AREA'
          lfieldname = 'CO_AREA'
        IMPORTING
          dfies_wa   = lwa_dfies.
      lwa_dfies-tabname = 'searchpoints'.
      lwa_dfies-REPTEXT   = 'Destination directory'.
      lwa_dfies-LENG      = 100.
      lwa_dfies-INTLEN    = 100.
      lwa_dfies-OUTPUTLEN = 100.
      lwa_dfies-fieldname = 'SP_NAME'.
      APPEND lwa_dfies TO lt_dfies.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD = 'SP_NAME'
          DYNPPROG = SY-REPID
          DYNPNR = SY-DYNNR
          DYNPROFIELD = 'destin'
          VALUE_ORG = 'S'
        TABLES
          VALUE_TAB = searchpoints
          FIELD_TAB = lt_dfies
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2
          OTHERS = 3.
    *&      Form  select_input_file_name
    *       text
    form select_input_file_name.
    *  call function 'F4_FILENAME'
    *       exporting
    *            program_name  = sy-repid
    *            dynpro_number = sy-dynnr
    *            field_name    = 'PATH'
    *       importing
    *            file_name     = g_tmp_file_path.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
      WINDOW_TITLE = 'Please choose a file'
      "default_extension = '*.TXT'
      "default_filename = 'C:\*.txt'
      initial_directory = 'C:\'
      file_filter = '*.*'
      CHANGING
      FILE_TABLE = l_file
      RC = l_RC
      EXCEPTIONS
      FILE_OPEN_DIALOG_FAILED = 1
      CNTL_ERROR = 2
      ERROR_NO_GUI = 3
      NOT_SUPPORTED_BY_GUI = 4
      OTHERS = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.                    "select_input_file_name
    *&      Form  WRITE_DB_HOME
    *       Write DB home directory
    *       no parameters
    FORM write_db_home.
      CASE sy-dbsys(3).
        WHEN 'ORA'.
          CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_ORAHOME'
                             ID 'VALUE' FIELD searchpoints-dirname.
    *--- C5056155 Start of ALV -------------------------------*
    *      PERFORM flip_flop(rsora000) USING cflag.
    *      WRITE: / 'DIR_ORAHOME',       30 searchpoints-dirname.
          MOVE: 'DIR_ORAHOME'        TO searchpoints-sp_name.
          APPEND searchpoints.
    *--- C5056155 End   of ALV -------------------------------*
        WHEN 'ADA'.
          CALL 'C_GETENV' ID 'NAME'  FIELD 'DBROOT'
                          ID 'VALUE' FIELD searchpoints-dirname.
    *--- C5056155 Start of ALV -------------------------------*
    *      PERFORM flip_flop(rsora000) USING cflag.
    *      WRITE: / 'DIR_ADA_DBROOT',    30 searchpoints-dirname.
          MOVE: 'DIR_ADA_DBROOT'     TO searchpoints-sp_name.
          APPEND searchpoints.
    *--- C5056155 End   of ALV -------------------------------*
        WHEN 'INF'.
          CALL 'C_GETENV' ID 'NAME'  FIELD 'INFORMIXDIR'
                          ID 'VALUE' FIELD searchpoints-dirname.
    *--- C5056155 Start of ALV -------------------------------*
    *      PERFORM flip_flop(rsora000) USING cflag.
    *      WRITE: / 'DIR_INF_INFORMIXDIR', 30 searchpoints-dirname.
          MOVE: 'DIR_INF_INFORMIXDIR' TO searchpoints-sp_name.
          APPEND searchpoints..
    *--- C5056155 End   of ALV -------------------------------*
        WHEN 'DB6'.
          CALL 'C_GETENV' ID 'NAME'  FIELD 'INSTHOME'
                          ID 'VALUE' FIELD searchpoints-dirname.
          IF sy-subrc = 0.
    *--- C5056155 Start of ALV -------------------------------*
    *        PERFORM flip_flop(rsora000) USING cflag.
    *        WRITE: / 'DIR_DB2_HOME',    30 searchpoints-dirname.
            MOVE: 'DIR_DB2_HOME'       TO searchpoints-sp_name.
            APPEND searchpoints.
    *--- C5056155 End   of ALV -------------------------------*
          ELSE.
            EXIT.
          ENDIF.
        WHEN OTHERS.
          EXIT.
      ENDCASE.
    ENDFORM.                    " WRITE_DB_HOME
    FORM get_directories.
    * get the name and aliases of ALL userdefined directories
      SELECT * FROM user_dir INTO isearchpoints
        WHERE svrname = sy-uname.
        MOVE isearchpoints-dirname to searchpoints-dirname.
        MOVE isearchpoints-aliass  to searchpoints-sp_name.
        APPEND searchpoints.
      ENDSELECT.
      SELECT * FROM user_dir INTO isearchpoints
        WHERE svrname = 'all'.
        MOVE isearchpoints-dirname to searchpoints-dirname.
        MOVE isearchpoints-aliass  to searchpoints-sp_name.
        APPEND searchpoints.
      ENDSELECT.
    * Get DB home
      IF sy-dbsys(3) = 'ADA'.
        PERFORM write_db_home.
      ENDIF.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_ATRA'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_ATRA'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_BINARY'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_BINARY'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory $DIR_CCMS
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_CCMS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_CCMS'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_CT_LOGGING'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_CT_LOGGING'     TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_CT_RUN'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_CT_RUN'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_DATA'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_DATA'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * Get DB home
      IF sy-dbsys(3) = 'DB6'.
        PERFORM write_db_home.
      ENDIF.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_DBMS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_DBMS'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_EXECUTABLE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_EXECUTABLE'     TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_EXE_ROOT'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_EXE_ROOT'       TO searchpoints-sp_name.
      APPEND searchpoints.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GEN'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GEN'            TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GEN_ROOT'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GEN_ROOT'       TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GLOBAL'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GLOBAL'         TO searchpoints-sp_name.
      APPEND searchpoints.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GRAPH_EXE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GRAPH_EXE'      TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GRAPH_LIB'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GRAPH_LIB'      TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_HOME'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_HOME'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * Get DB home
      IF sy-dbsys(3) = 'INF'.
        PERFORM write_db_home.
      ENDIF.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_INSTALL'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_INSTALL'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_INSTANCE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_INSTANCE'       TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_LIBRARY'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_LIBRARY'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_LOGGING'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_LOGGING'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the files written by the memory inspector
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_MEMORY_INSPECTOR'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_MEMORY_INSPECTOR' TO searchpoints-sp_name.
      APPEND searchpoints.
    * Get DB home
      IF sy-dbsys(3) = 'ORA'.
        PERFORM write_db_home.
      ENDIF.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PAGING'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PAGING'         TO searchpoints-sp_name.
      APPEND searchpoints.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PUT'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PUT'            TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PERF'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PERF'           TO searchpoints-sp_name.
      APPEND searchpoints.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PROFILE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PROFILE'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PROTOKOLLS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PROTOKOLLS'     TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_REORG'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_REORG'          TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_ROLL'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_ROLL'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_RSYN'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_RSYN'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * calculate directory for saphostagent (no sapparam available...)
      IF ( sy-opsys(3) = 'WIN' ) OR ( sy-opsys(3) = 'Win' ).
        DATA: windir_path(64),  programfiles_path(64).
    *   hoping that ProgramFiles is set in service user environment
        CALL 'C_GETENV' ID 'NAME'  FIELD 'ProgramFiles'
                        ID 'VALUE' FIELD programfiles_path.
        IF programfiles_path IS INITIAL.
    *     %ProgramFiles% not available. guess from windir
          CALL 'C_GETENV' ID 'NAME'  FIELD 'windir'
                          ID 'VALUE' FIELD windir_path.
    *     e.g. S:\WINDOWS ==> S:\Program Files
          CONCATENATE windir_path(3) 'Program Files' INTO programfiles_path.
        ENDIF.
        CONCATENATE programfiles_path '\SAP\hostctrl'
                                                 INTO searchpoints-dirname.
      ELSE.
    *   on UNIX, the path is hard coded
        searchpoints-dirname = '/usr/sap/hostctrl'.
      ENDIF.
      MOVE: 'DIR_SAPHOSTAGENT' TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SAPUSERS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      IF searchpoints-dirname = '.'.
        IF sy-opsys = 'Windows NT'.
          searchpoints-dirname = '.\'.
        ELSE.
          searchpoints-dirname = './'.
        ENDIF.
      ENDIF.
      MOVE: 'DIR_SAPUSERS'       TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SETUPS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_SETUPS'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SORTTMP'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_SORTTMP'        TO searchpoints-sp_name.
      APPEND searchpoints.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SOURCE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_SOURCE'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TEMP'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TEMP'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TRANS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TRANS'          TO searchpoints-sp_name.
      APPEND searchpoints.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TRFILES'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TRFILES'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TRSUB'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TRSUB'          TO searchpoints-sp_name.
      APPEND searchpoints.
    *  get the name of the current server.
      CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'rdisp/myname'
                         ID 'VALUE' FIELD searchpoints-dirname.
      data: h_ind type i.
      LOOP AT searchpoints.
        h_ind = sy-tabix.
        IF searchpoints-sp_name IS INITIAL.
          DELETE searchpoints INDEX h_ind.
        ENDIF.
      ENDLOOP.
    ENDFORM.

  • How to store multiple data in one aray at one go?

    Hi i am creating a Recipe Cooking Book and i have got a recipe class, ingredient class, equipment class and jFORM GUI. the gui form will have a list and it will contain couple of equipments. the user should be able to select more than 1 equipments which would use the pass- by - value to the recipe class and it will be passed to equipment class.
    The problem that encounter is that when i have to select multiple values from list, it should store all selected equipments to array.
    This is where i am stuck as i don't know how to store couple of equipment at one creation.
    This is my recipe constructor in recipe class
    public Recipe(int aRecipeID, String aRecipeName, String aCountryofOrigin,
                      String aType, String aPreparationTime, String aCookingTime,
                      String aRecipeDescription, String aProcedure,
                       ClsEquipment[] aequipment, String aImage1, String aImage2,
                      String aImage3) {
            Create(aRecipeID, aRecipeName, aCountryofOrigin, aType,
                   aPreparationTime, aCookingTime, aRecipeDescription, aProcedure,
                   aequipment, aImage1, aImage2, aImage3);
        public void Create(int aRecipeID, String aRecipeName,
                           String aCountryofOrigin, String aType,
                           String aPreparationTime, String aCookingTime,
                           String aRecipeDescription, String aProcedure,
                            ClsEquipment[] aequipment, String aImage1, String aImage2,
                           String aImage3) {
            RecipeID = aRecipeID;
            RecipeName = aRecipeName;
            CountryofOrigin = aCountryofOrigin;
            Type = aType;
            PreparationTime = aPreparationTime;
            CookingTime = aCookingTime;
            RecipeDescription = aRecipeDescription;
            Procedure = aProcedure;
            *equipment[j] = aequipment[k];*
            Image1 = aImage1;
            Image2 = aImage2;
            Image3 = aImage3;
    this is The command that i have in Jform gui
        public void jRcreateButton_actionPerformed(ActionEvent e) {
            int i=0;
    myRecipe.Create(Integer.parseInt(jRidTextField.getText()),jRnameTextField.getText(),jRcountryTextField.getText(),jRtypeTextField.getText(),jRptimeTextField.getText(),jRctimeTextField.getText(),jRdescriptionTextArea.getText(), jRprocedureTextArea.getText(),new ClsEquipment(jAEequipmentList.getSelectedValues()),jRimage1TextField.getText(),jRimage2TextField.getText(),jRimage3TextField.getText());
    Let me conclude what i am trying to do. Basically i want the user to select more than 1 equipments from the List and the user should also input other recipe data. once this is done, the should click on create.
    when creating one recipe, u need more than 1 equipment so that created recipe should store selected equipments, which i will later on retrieve  and display on screen.
    can u please guide me where i am goin wrong and how i could fix it.
    thank you in advance
    Edited by: JAVABABY on Feb 18, 2008 8:40 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

           *equipment[j] = aequipment[k];*JList's getSelectedValues() method returns an array of Objects, so if you wanted to store it into another Object[] reference, you'd just use
    equipment = aequipment;But, you are storing it as an Equipment array, so you'll need to loop over the Object array and cast each element to an Equipment reference, and store it into the Equipment array. Something like this:
    equipment = new Equipment[aequipment.length];
    for (each element x in aequipment) {
        equipment[x] = (Equipment)aequipment[x];
    }

  • Multiple selections in a ComboBox

    Hi there!
    Is it possible to make multiple selections in a ComboBox ?
    i.e. make n consecutive selections and store them in an array
    or make n selections in the open list of the CB by using (for
    example) the click-Shift Key keystroke
    Purpose is to allow the user to select multiple different
    issues of a magazine with a maximum ease of use...
    (Code I use is attached below)
    Many thanks for your help!
    Best regards,
    Gerry

    >>"May I do consecutive selections in a CB, store them
    in an Array and then
    compile this list to use labels and data the array contains
    to write an
    invoice
    (with the labels) and calculate its amount (with the data)?"
    Gotcha - and sure you can.
    OK, let's see - you have this (sort of):
    var CBBUYListener:Object = new Object();
    CBBUYListener.change = function(evt:Object) {
    I'd change that to something like this:
    var comboSelected = new Array();
    CBBUYListener= new Object();
    CBBUYListener.change = function(evt:Object){
    //first check to see if this item is already selected
    var didSelect = false;
    for(var i = 0; i < comboSelected.length; i++){
    if(comboSelected
    == evt.target.selectedIndex){
    trace("already selected this item");
    didSelect = true;
    break;
    //if not selected add this index
    if(!didSelect){
    comboSelected.push(evt.target.selectedIndex);
    CBBUY.addEventListener("change", CBBUYListener);
    What you get now is an array - comboSelected that will
    contain the selected
    indexes from the combo box - CBBUY.
    You want a sum of the data:
    function sumSelected(){
    var sum = 0;
    for(var i = 0; i < comboSelected.length; i++){
    sum += CBBUY.getItemAt(comboSelected).data;
    return sum;
    You just get each item's data from the comboBox, at the index
    specified in
    the comboSelected array.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How will i display the multiple select ids in the dashboard ?

    I have a form where there is a multiple select. When the form is submit, the ids for the multiple select is stored in the database as concatenate. For example, multiple select : 3,9,5,1.
    The ids of the multiple select is found in a table TABLE1 and the insertion is done in another table TABLE2.
    Now I have to display them in a dashboard.
    My question is how will i display the multiple select ids in the dashboard ?
    I have to do an innerjoin with TABLE1 to retrieve the names of the multiple select ids. I don't know how to do it because the column name for multiple select in TABLE2 is of type text and the column id in TABLE1 is of type int.
    Please help me solve this problem.
    Thanks in advance

    One general advice is, never store comma-delimited lists in the database. In fact, the reason is to avoid problems like the one you now face.
    The major suggestion here is to re-design your database. Make sure each selected item (for example 3, 9, 5 or 1) is stored in its own row.
    To solve the problem as it now stands, you could do something like
    <cfquery>
    select myItems
    from table2
    where id in (select id from table 1 where ...etc.)
    </cfquery>
    Then use ColdFusion's list functions to do what your dashboard requires you to do.

Maybe you are looking for