Inserting a Row to a Specific Position in a  Sorted JTable

Hello,
I am currently writing an application that will be a network alerting tool. Periodically it will query a database, and if alerts are found, display them on a JTable for a user to see. However, my problem is the following. If the user sorts the table by a column, new alerts are entering the table in their sorted position. This could cause the table to rearrange and be confusing to the user, also causing them to possibly miss alerts. So, what I would like to happen is that new alerts get inserted at the top of the table, while all previous alerts will stay in their sorted order. For example, say alerts received in the order D A C B . The user then sorts the table, so that the alerts are now in the order A B C D. If alert E comes in, I want the table to show as E A B C D. Then, if the user sorts again, the table would become A B C D E, and so on.
I have attempted multiple ways to achieve this. My most recent being using the table.setRowSorter(null), inserting into the model, and then re-enabling sorting. However, switching to null appears to make all the rows go back to their previously unsorted position. Any help would be greatly appreciated as to what I am missing.

You can implement your own RowSorter, such that rows that have been added since the latest explicit sort are ranked first (override RowSorter.rowsInserted() to know them).
You'll have to override methods convertRowIndexToModel(int) and convertRowIndexToView(int) . This is easy if you used the rowsInserted() events to, e.g., maintain one atrribute latestUnsortedRow.

Similar Messages

  • In Logic Pro or Pro X Meta Events don't work correctly; for example inserting Stop Playback number 52 in a specific position the playhead stops wrongly several ticks before. Then the button play does not start.

    In Logic, Pro or Pro X Meta Events don't work correctly; for example inserting Stop Playback number 52 in a specific position the playhead stops wrongly several ticks before. Then the button play does not start.

    Curious if what your describing is similar to issue 4 which starts around 9:15 in video...
    https://youtu.be/q93jdOhi4Oc
    If so this started for me, or at least I noticed it for the first time in LPX 10.1.1. What version of logic are you running?
    I've recently found that this issue also affects note timing on instrument tracks that use the "External Instrument" plugin.

  • New inserted detail row is not showing through accessor

    I have to insert master and detail row. I insert row in master view  and then I get detail row using getAttribute on master view. Then I insert row into detail row. Result is one inserted master row and no data display in detail view.
    How ever in managed bean when I get master view using finditerator and then get detail row also using finditerator on the specific page then rows inserted on master and detail view appear.
    DCIteratorBinding dcIter =             ADFUtils.findIterator("PlotMst1Iterator");
    ViewObject mvo = dcIter.getViewObject();
    mvo.insertRowAtRangeIndex(0, row);
    mvo.setCurrentRow(row);
    Row row = mvo.createRow();
    // DETAIL ACCESSOR  not working
      //  RowSet Pd = (RowSet) row.getAttribute("PlotDtl");
    DCIteratorBinding dcIter2 =       ADFUtils.findIterator("PlotDtl2Iterator");      
    ViewObject dvo = dcIter2.getViewObject();
    nvp.setAttribute("FabricCode",r.getAttribute("FabricCode"));
    Row drow = dvo.createAndInitRow(nvp);      
    dvo.insertRow(drow);   

    Hi,
    its a classical programming mistake you do. You create a new row on the model layer and not the binding layer. The proper way of doing this would be to
    1) either create a method binding for the "CreateInsert" operation in the PageDef file and call it from there
    or
    2) DCIteratorBinding dcIter = ADFUtils.findIterator("PlotMst1Iterator");
        Row rw = dcIter.getRowSetIterator().createRow();
    Same for your attempt to create the detail row. Again you can expose the createInsert operation in the PageDef file or use the RowSetIterator. As you create a master and detail row at the same time, be aware of a constraint problem that may arise from this as you have no guarantee that the master is inserted first. Read this http://docs.oracle.com/cd/E35521_01/web.111230/e16182/bcentities.htm#CEGJAFCF to learn about the problem.
    Note that use case often matters. While I can see where your coding goes wrong, I can't tell if your approach in general could be chosen better
    Frank

  • How to eliminate inserting  Duplicate rows into database using JDBC Adapter

    File->Xi->JDBC
    In above Scenario if the file has two rows their values are identical, then how can we eliminated inserting  Duplicate rows into database using JDBC Adapter

    Database is a consumer of a SERVICE (SOA!!!!!!).
    Database plays a business system role here!!!!
    Mapping is part of an ESB service
    Adaptor is a technology adapted to ESB framework to support specific protocol.
    ESB accomplish ESB duties such as transformation, translation, routing. Routing use a protocol accepted by the consumer. In a JDBC consumer it is JDBC protocol and hence it a JDBC adaptor.
    There is clear separation on responsibilities among business system and ESB. ESB do not participate in business decision or try to get into business system data layer.
    So who ever are asking people to check duplicate check as part of mapping (an ESB service) may not understand integration practice.
    Please use an adaptor module which will execute the duplicate check with business system in a plug and play approach and separate that from ESB service so that people can build integration using AGILE approach.
    Thanks

  • Prepare statement to insert a row that contains Blob column. Which way is correct?

    When we make prepare statement to insert a row that contains Blob column. Which way is correct? And what is the difference? Does anyone know?
         1.  Preparestatement.setBlob(parameter number, blob type object)
         2. Preparestatement.setBlob(parameter number, inputstream type object)
    This link show the test I made.
    https://community.oracle.com/thread/3680185?sr=inbox&customTheme=otn

    When we make prepare statement to insert a row that contains Blob column. Which way is correct? And what is the difference? Does anyone know?
         1.  Preparestatement.setBlob(parameter number, blob type object)
         2. Preparestatement.setBlob(parameter number, inputstream type object)
    I answered that in your other thread and provided a link to the JDBC Dev Guide section that discusses how to work with LOBs and BFILEs.
    Did you read that doc section?
    Did you read my reply in your other thread?
    In java a BLOB is just the locator that gives you access to the actual content. In your case you got access by selecting an existing BLOB locator and getting its inputstream. That inputstream is what gives you access to the actual blob content.
    The locator is just that; it specifies the LOCATION of the blob content but it is NOT the content.

  • Update ProductTrees_Lines - specific position

    Hi everybody,
    I want to update a specific position in ProductTrees_Lines with B1if scenario. For example I have a product tree for masteritem with 3 entries.
    masteritem
    1. detail item1, 2 pcs
    2. detail item2, 3 pcs
    3. detail item3, 4 pcs
    Now I want to update position 2 with 100 pcs.
    So my update structure for B1 object call (object id 66) looks like this:
    <QueryParams>
         <Code>masteritem</Code>
    </QueryParams>
    <ProductTrees>
         <row />
    </ProductTrees>
    <ProductTrees_Lines>
         <row/>
         <row>
              <ItemCode>detail item2</ItemCode>
              <Quantity>100.0</Quantity>
         </row>
         <row/>
    </ProductTrees_Lines>
    In fact I need to list the <row>-tags proper to the positions. Isn´t there a easier way by using something like <childnum> (which is the name of the field in the database describing the position of the productTree_line), so I don´t have to list all <row>-tags (reducing the xml I need to write)?
    Using <childnum> leads to an error. And I can´t find a adequate field in the object description for object id 66.
    Any suggestions?
    Best regards
    Benjamin

    Hello Benjamin,
    no, unfortunately not (I do not know). the Object help from b1iF says:
    <BOM>
        <!--DB Table Name: -->
        <BO>
            <!--multiple such elements are allowed-->
            <AdmInfo>
                <Object>long</Object>
                <Version>long</Version>
            </AdmInfo>
            <QueryParams>
                <TreeCode>string</TreeCode>
            </QueryParams>
            <ProductTrees>
                <row>
                    <!--multiple such elements are allowed-->
                    <TreeCode>string</TreeCode>
                    <TreeType>string</TreeType>
                    <Quantity>double</Quantity>
                    <DistributionRule>string</DistributionRule>
                    <Project>string</Project>
                    <DistributionRule2>string</DistributionRule2>
                    <DistributionRule3>string</DistributionRule3>
                    <DistributionRule4>string</DistributionRule4>
                    <DistributionRule5>string</DistributionRule5>
                    <PriceList>long</PriceList>
                    <Warehouse>string</Warehouse>
                </row>
            </ProductTrees>
            <ProductTrees_Lines>
                <row>
                    <!--multiple such elements are allowed-->
                    <ItemCode>string</ItemCode>
                    <Quantity>double</Quantity>
                    <Warehouse>string</Warehouse>
                    <Price>double</Price>
                    <Currency>string</Currency>
                    <IssueMethod>string</IssueMethod>
                    <Comment>string</Comment>
                    <ParentItem>string</ParentItem>
                    <PriceList>long</PriceList>
                    <DistributionRule>string</DistributionRule>
                    <Project>string</Project>
                    <DistributionRule2>string</DistributionRule2>
                    <DistributionRule3>string</DistributionRule3>
                    <DistributionRule4>string</DistributionRule4>
                    <DistributionRule5>string</DistributionRule5>
                    <WipAccount>string</WipAccount>
                    <ItemType>long</ItemType>
                    <LineText>string</LineText>
                    <AdditionalQuantity>double</AdditionalQuantity>
                </row>
            </ProductTrees_Lines>
        </BO>
    </BOM>
    theres no LineNum or other primary key

  • Database trigger to insert duplicated rows on audit table

    Hi
    It is possible to insert duplicate rows (at the moment database generate PK violation constraint for one specific table) within an audit table ?
    Certain code like this is not working, always the whole transaction makes a rollback and audit table will be empty:
    CREATE OR REPLACE TRIGGER USER.audit_TABLE_TRG
    before INSERT ON USER.TABLE
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    BEGIN
    declare
    V_conteo number(1) := 0;
    duplicate_record EXCEPTION;
    begin
    select count(*)
    into V_conteo
    from USER.TABLE
    where <PK conditions>
    if V_conteo > 0 then
    begin
    INSERT INTO USER.AUDIT_TABLE
    (<>)
    VALUES
    (<>);
    raise duplicate_record;
    exception
    when duplicate_record then
    INSERT INTO USER.AUDIT_TABLE
    (<>)
    VALUES
    (<>);
    raise_application_error(-20019,'Duplicated column1/column2:'||:NEW.column1||'/'||:NEW.column2);
    when others then
    dbms_output.put_line('Error ...'||sqlerrm);
    end;
    end if;
    end;
    END;
    /

    >
    Exactly this is my problem , one only transaction (insert into audit table and try to insert into target table), the reason of this post is to know whether exists another way to insert all the intent duplicate records on target table into one audit table, you right ,maybe I can add one date column and modify the PK on audit table but my main problem still happens.
    >
    Can I ask you why you want to go trigger route for this if your intention is only to capture the duplicate records? Assuming that you are on at least on 10gR2, you can look at DML error table. If you go this route, there is no need for additional overhead of trigger, code failures, etc.
    Oracle can automatically store the failed records in an error table which you could later on investigate and fix it or ignore it.
    Simple example:
    SQL> create table emp (empno number primary key, ename varchar2(10), sal number);
    Table created.
    SQL> insert into emp values(1010, 'Venkat', 100);
    1 row created.
    SQL> commit;
    Commit complete.
    Create error table to log the failed records
    BEGIN
          DBMS_ERRLOG.create_error_log (dml_table_name => 'emp');
    END;
    Now let's insert a duplicate record
    SQL> insert into emp values(1010, 'John', 200) ;
    insert into emp values(1010, 'John', 200)
    ERROR at line 1:
    ORA-00001: unique constraint (VENKATB.SYS_C002813299) violated
    Now use the log table to capture
    SQL> insert into emp values(1010, 'John', 200) LOG ERRORS INTO err$_emp ('INSERT') REJECT LIMIT UNLIMITED;
    0 rows created.
    Now check the error log table and do whatever you want
    SQL> r
      1* select ORA_ERR_MESG$, empno, ename, sal from err$_EMP
    ORA_ERR_MESG$
    EMPNO
    ENAME
    SAL
    ORA-00001: unique constraint (VENKATB.SYS_C00
    2813467) violated
    1010
    John
    200
    1 row selected.This will also capture when you do
    INSERT INTO EMP SELECT * FROM EMP_STAGE LOG ERRORS INTO err$_emp ('INSERT') REJECT LIMIT UNLIMITED;
    You can capture the whole record into the log table. All columns.
    Regards
    Edited : Code

  • Can not insert a row to a table from Oracle DBA Studio

    Hi,
    I try to use the Oracle DBA Studio to create a table and put some test data in it. Here is what I found:
    I start Oracle DBA Studio on the client machine by connecting to an Oracle server 8i (8.1.7). I create a simple table called Test with two columns: one is USER, VARCHAR2, 10; and the other is USER2, CHAR, 2. After that, I right click on the table name and select "Table Data Editor" from the popup menu. The table editor window shows up. I type in the value 'AA' and 'BB' in the grid of two columns. Then I click the Apply button. An error message box popped up:
    ORA-00928 missing SELECT keyword.
    I click Show SQL button. The SQL statement is as following:
    INSERT INTO "TASYS"."TEST" (USER ,USER2 ) VALUES ('AA' ,'BB').
    I copy the statement to SQL Plus and run it. The same error is generated. But if I remove (USER, USER2) from the statement, it inserts a row without complaint. In other word, the database will not allow to insert if individual columns are list. I realize something must wrong with the new server and client installed and could not figure out what happening. Hope someone can help.
    Thanks.
    null

    I am not sure, but could it be that USER is a keyword or predefine word. Check Oracle'slist of predefine/keyword

  • Insert a row in ALV

    Hi ,
    I need to insert a row in ALV output. On click of a Inser Row button a pop up should show with a parameter.Once the value in entered in the parameter enter is hit , the first column of the new row should have value put in that parameter as non editable field.
    The Insert row of standard toolbar inserts a blank row . Is there any way to incorporate the above logic in the standard toolbar?
    I'm using CL_GUI_ALV_GRID to display the ALV.
    It would be helpful if you provide sample coding.
    Thanks.
    Ajith
    Edited by: Ajith  Krishna on Oct 28, 2008 8:01 PM

    Hello Ajith
    The enhanced version of sample report ZUS_SDN_ALVGRID_EDITABLE_8A demonstrates how to implement your requirement.
    *& ZUS_SDN_ALVGRID_EDITABLE_8A
    *& Thread: Insert a row in ALV
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1105097"></a>
    *& Thread: Blanking values on ALV Grid Row Duplicate
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1057161"></a>
    *& Thread: Delete line event in ALV
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="945471"></a>
    REPORT  zus_sdn_alvgrid_editable_8a.
    TYPES: BEGIN OF ty_s_outtab.
    INCLUDE TYPE knb1.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab    TYPE STANDARD TABLE OF ty_s_outtab
                          WITH DEFAULT KEY.
    DATA:
      gd_okcode        TYPE ui_func,
      gd_repid         TYPE syst-repid,
      gt_fcat          TYPE lvc_t_fcat,
      go_docking       TYPE REF TO cl_gui_docking_container,
      go_grid          TYPE REF TO cl_gui_alv_grid.
    DATA:
      gt_outtab        TYPE ty_t_outtab.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-DATA:
          mt_sel_rows     TYPE lvc_t_row.
        CLASS-METHODS:
          handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
            IMPORTING
              e_object
              sender,
          handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
            IMPORTING
              e_ucomm
              sender.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_toolbar.
    * define local data
        DATA: ls_button     TYPE stb_button.
        LOOP AT e_object->mt_toolbar INTO ls_button.
          CASE ls_button-function.
            when cl_gui_alv_grid=>MC_FC_LOC_INSERT_ROW.
              ls_button-function = 'INSERT_ROW'.
              MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
            WHEN cl_gui_alv_grid=>mc_fc_loc_delete_row.
              ls_button-function = 'DELETE_ROW'.
              MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
            WHEN cl_gui_alv_grid=>mc_fc_loc_copy_row OR
                 cl_gui_alv_grid=>mc_fc_loc_copy.
              ls_button-function = 'COPY_ROW'.
              MODIFY e_object->mt_toolbar FROM ls_button INDEX syst-tabix.
            WHEN OTHERS.
              CONTINUE.
          ENDCASE.
        ENDLOOP.
      ENDMETHOD.                    "handle_toolbar
      METHOD handle_user_command.
    * define local data
        DATA: lt_rows       TYPE lvc_t_row,
              ls_row        TYPE lvc_s_row.
        REFRESH: mt_sel_rows.
        CASE e_ucomm.
          when 'INSERT_ROW'.
          WHEN 'DELETE_ROW'.
          WHEN 'COPY_ROW'.
          WHEN OTHERS.
            RETURN.
        ENDCASE.
        "   User wants to delete or copy rows => store them in class attribute
        "   and trigger PAI afterwards where we actually delete /copy the rows
        "   and do the recalculations (in case of deletion)
        CALL METHOD sender->get_selected_rows
          IMPORTING
            et_index_rows = mt_sel_rows
    *        et_row_no     =
    *   Trigger PAI
        CALL METHOD cl_gui_cfw=>set_new_ok_code
          EXPORTING
            new_code = e_ucomm
    *      IMPORTING
    *        rc       =
      ENDMETHOD.                    "user_command
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    PARAMETERS:
      p_bukrs      TYPE bukrs  DEFAULT '2000'  OBLIGATORY.
    START-OF-SELECTION.
      SELECT  * FROM  knb1 INTO CORRESPONDING FIELDS OF TABLE gt_outtab
             UP TO 15 ROWS
             WHERE  bukrs  = p_bukrs.
      PERFORM init_controls.
      SET HANDLER:
        lcl_eventhandler=>handle_toolbar      FOR go_grid,
        lcl_eventhandler=>handle_user_command FOR go_grid.
      " Used to replace standard toolbar function code with custom FC
      go_grid->set_toolbar_interactive( ).
    * Link the docking container to the target dynpro
      gd_repid = syst-repid.
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = gd_repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    **      CALL METHOD go_grid1->refresh_table_display
    ***        EXPORTING
    ***          IS_STABLE      =
    ***          I_SOFT_REFRESH =
    **        EXCEPTIONS
    **          FINISHED       = 1
    **          others         = 2
    **      IF sy-subrc <> 0.
    ***       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    ***                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    **      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'END'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN 'INSERT_ROW'.
          perform INSERT_ROW.
        WHEN 'DELETE_ROW'.
          PERFORM delete_rows.
        WHEN 'COPY_ROW'.
          PERFORM copy_rows.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
      CALL METHOD go_grid->refresh_table_display
    *      EXPORTING
    *        IS_STABLE      =
    *        I_SOFT_REFRESH =
        EXCEPTIONS
          finished       = 1
          OTHERS         = 2
      IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG_KNB1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog_knb1 .
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = 'KNB1'
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Only non-key fields are editable
      ls_fcat-edit = 'X'.
      MODIFY gt_fcat FROM ls_fcat
        TRANSPORTING edit
        WHERE ( key NE 'X' ).
    ENDFORM.                    " BUILD_FIELDCATALOG_KNB1
    *&      Form  INIT_CONTROLS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM init_controls .
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent = cl_gui_container=>screen0
          ratio  = 90
        EXCEPTIONS
          OTHERS = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid
        EXPORTING
          i_parent = go_docking
        EXCEPTIONS
          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.
    * Build fieldcatalog and set hotspot for field KUNNR
      PERFORM build_fieldcatalog_knb1.
    * Display data
      CALL METHOD go_grid->set_table_for_first_display
        CHANGING
          it_outtab       = gt_outtab
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      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.                    " INIT_CONTROLS
    *&      Form  delete_rows
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM delete_rows .
    * define local data
      DATA: ls_row    TYPE lvc_s_row.
      SORT lcl_eventhandler=>mt_sel_rows BY index DESCENDING. " !!!
      LOOP AT lcl_eventhandler=>mt_sel_rows INTO ls_row.
        DELETE gt_outtab INDEX ls_row-index.
      ENDLOOP.
      " After deleting rows do RE-CALCULATION
    *  perform RECALCULATION.
    ENDFORM.                    " delete_rows
    *&      Form  COPY_ROWS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM copy_rows .
    * define local data
      DATA: ld_next   TYPE i,
            ls_row    TYPE lvc_s_row,
            ls_outtab TYPE ty_s_outtab.
      SORT lcl_eventhandler=>mt_sel_rows BY index DESCENDING. " !!!
      LOOP AT lcl_eventhandler=>mt_sel_rows INTO ls_row.
        READ TABLE gt_outtab INTO ls_outtab INDEX ls_row-index.
        CLEAR: ls_outtab-akont. " In your case: clear GUID
        ld_next = ls_row-index + 1.
        INSERT ls_outtab INTO gt_outtab INDEX ld_next.
      ENDLOOP.
    ENDFORM.                    " COPY_ROWS
    *&      Form  INSERT_ROW
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form INSERT_ROW .
    * define local data
      DATA: ld_value1  type SPOP-VARVALUE1,
            ls_outtab  TYPE ty_s_outtab.
      CALL FUNCTION 'POPUP_TO_GET_ONE_VALUE'
        EXPORTING
          textline1            = 'Enter Value (4 Chars):'
    *     TEXTLINE2            = ' '
    *     TEXTLINE3            = ' '
          titel                = 'Enter Value'
          valuelength          = 4
        IMPORTING
    *     ANSWER               =
          VALUE1               = ld_value1
        EXCEPTIONS
          TITEL_TOO_LONG       = 1
          OTHERS               = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ls_outtab-kunnr = ld_value1.
      ls_outtab-bukrs = ld_value1.
      append ls_outtab to gt_outtab.
    endform.                    " INSERT_ROW
    Regards
      Uwe

  • Insert  Blank row  After every Row  in alv report

    How to insert blank  row After every row  in Alv report

    what do you mean by a 'blank row'? ALV displays tabular data with 'any' number of columns. Now if you actually want a blank row (no columns at all, just a row), then that is just not possible. If I'm not mistaken, this question was posted before, so try to do a search on SCN. See what is says.

  • ODI - SCD Type 2 - Insert new row error

    Hi All,
    For Dimension I have a surrogate key, a natural key, and a column with "overwrite on change", start_date, end_date, current_record_ind. When I run the interface with the default SCD Type 2 for SQl server, this runs fine. But when I change that one column from "overwrite on change" to "insert new row", it fails on the update step. What should I be looking for anf fixing.
    Thanks for your time and help.

    DB: SQL Server 2008.
    IKM = IKM MSSQL Slowly Changing Dimension
    Error Message: ODI-1228 - Incorrect syntax near the keyword from.
    Code: update T
    set
    from database.dbo.Dim_type as T,
    database.dbo.I$_Dim_type as S
    where T.Cd = S.Cd
    and T.Current_rec_ind = 1
    and IND_UPDATE = 'U'
    To overcome the issue, I have commented the update code in the Knowledge module and the insert works, but for this one it is ok, but I have requirements where one column needs to be overwritten and other column changes will require to add a new record. How to handle both?
    Thanks for your time.

  • How to identify date & time of insertion of rows in a table

    Hi,
    Is it possible to identify the date & time of insertion of rows in a table?
    for example:
    Table name: emp
    I have rows like this
    emp_code name dept
    pr01 ram edp
    ac05 gowri civil
    pr02 sam pro
    i want to know the date and time of the insertion this( ac05 gowri civil).
    Could you please help me.....
    Thanks in advance....

    psram wrote:
    sorry for the confusion. I dont want to store date and time. I said that for example only.
    I have table which consists of thousands of rows. I want to know the insertion date & time of a particular row.
    Is it possible?So, if I have a table that stores a load of employee numbers, do you think I could get the database to tell me their names?
    If you don't store the information, you can't query the information.
    Ok, there are some dribbs and drabbs of information available from the back end of the database via the SCN's, Archive Logs etc., but those sort of things disappear or get overwritten as time goes by. The only way to know the information it to ensure you store it in the first place.
    So, in answer to your question, No, there isn't a true and reliable way to get the data/time that rows were inserted into the table, unless you have chosen to store it alongside the data.

  • How do I insert multiple rows from a single form ...

    How do I insert multiple rows from a single form?
    This form is organised by a table. (just as in an excel format)
    I have 20 items on a form each row item has five field
    +++++++++++ FORM AREA+++++++++++++++++++++++++++++++++++++++++++++++++++++
    +Product| qty In | Qty Out | Balance | Date +
    +------------------------------------------------------------------------+
    +Item1 | textbox1 | textbox2 | textbox3 | date +
    + |value = $qty_in1|value= &qty_out1|value=$balance1|value=$date1 +
    +------------------------------------------------------------------------+
    +Item 2 | textbox1 | textbox2 | textbox4 | date +
    + |value = $qty_in2|value= $qty_out1|value=$balance2|value=$date2 +
    +------------------------------------------------------------------------+
    + Item3 | textbox1 | textbox2 | textbox3 | date +
    +------------------------------------------------------------------------+
    + contd | | | +
    +------------------------------------------------------------------------+
    + item20| | | | +
    +------------------------------------------------------------------------+
    + + + SUBMIT + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Database Structure
    +++++++++++++++++
    + Stock_tabe +
    +---------------+
    + refid +
    +---------------+
    + item +
    +---------------+
    + Qty In +
    +---------------+
    + Qty Out +
    +---------------+
    + Balance +
    +---------------+
    + Date +
    +++++++++++++++++
    Let's say for example user have to the use the form to enter all 10 items or few like 5 on their stock form into 4 different textbox field each lines of your form, however these items go into a "Stock_table" under Single insert transaction query when submit button is pressed.
    Please anyone help me out, on how to get this concept started.

    Hello,
    I have a way to do this, but it would take some hand coding on your part. If you feel comfortable hand writing php code and doing manual database calls, specificaly database INSERT calls you should be fine.
    Create a custom form using the ADDT Custom Form Wizard that has all the rows and fields you need. This may take a bit if you are adding the ability for up to 20 rows, as per your diagram of the form area. The nice thing about using ADDT to create the form is that you can setup the form validation at the same time. Leave the last step in the Custom Form Wizard blank. You can add a custom database call here, but I would leave it blank.
    Next, under ADDT's Forms Server Behaviors, select Custom Trigger. At the Basic tab, you enter your custom php code that will be executed. Here you are going to want to put your code that will check if a value has been entered in the form and then do a database INSERT operation on the Stock_table with that row. The advanced tab lets you set the order of operations and the name of the Custom Trigger. By default, it is set to AFTER. This means that the Custom Trigger will get executed AFTER the form data is processed by the Custom Form Transaction.
    I usually just enter TEST into the "Basic" tab of the Custom Trigger. Then set my order of operations in the "Advanced" tab and close the Custom Trigger. Then I go to the code view for that page in Dreamweaver and find the Custom Trigger function and edit the code manually. It's much easier this way because the Custom Trigger wizard does not show you formatting on the code, and you don't have to keep opening the Wizard to edit and test your code.
    Your going to have to have the Custom Trigger fuction do a test on the submitted form data. If data is present, then INSERT into database. Here's a basic example of what you need to do:
    In your code view, the Custom Trigger will look something like this:
    function Trigger_Custom(&$tNG) {
    if($tNG->getColumnValue("Item_1")) {
    $item1 = $tNG->getColumnValue("Item_1");
    $textbox1_1 = $tNG->getColumnValue("Textbox_1");
    $textbox1_2 = $tNG->getColumnValue("Textbox_2");
    $textbox1_3 = $tNG->getColumnValue("Textbox_3");
    $date1 = $tNG->getColumnValue("Textbox_3");
    $queryAdd = "INSERT INTO Stock_table
    (item, Qty_In, Qty_Out, Balance, Date) VALUES($item1, $textbox1_1, $textbox1_2, $textbox1_3, $date1)"
    $result = mysql_query($queryAdd) or die(mysql_error());
    This code checks to see if the form input field named Item_1 is set. If so, then get the rest of the values for the first item and insert them into the database. You would need to do this for each row in your form. So the if you let the customer add 20 rows, you would need to check 20 times to see if the data is there or write the code so that it stops once it encounters an empty Item field. To exit a Custom Trigger, you can return NULL; and it will jump out of the function. You can also throw custom error message out of triggers, but this post is already way to long to get into that.
    $tNG->getColumnValue("Item_1") is used to retrieve the value that was set by the form input field named Item_1. This field is named by the Custom Form Wizard when you create your form. You can see what all the input filed names are by looking in the code view for something like:
    // Add columns
    $customTransaction->addColumn("Item_1", "STRING_TYPE", "POST", "Item_1");
    There will be one for each field you created with the Custom Form Wizard.
    Unfortunately, I don't have an easy way to do what you need. Maybe there is a way, but since none of the experts have responded, I thought I would point you in a direction. You should read all you can about Custom Triggers in the ADDT documentation/help pdf to give you more detailed information about how Custom Triggers work.
    Hope this helps.
    Shane

  • How do I insert multiple pages in a specific order?

    I create reports in Word and convert them to Adobe before sending them out to customers. I often need to insert additional (Adobe) pages into the report before sending it out; sometimes I need to insert mulitple (20 or 30) pages. Does anyone know how I can insert these pages in a specific order? A few times in the past, Adobe gave me the option to select the order, but lately that option has not come up. HELP!

    Hello Try67,
    I go to Document>Insert Pages then select the files I need to insert. The order in which the pages are inserted is important because they are results of pressure tests (e.g. Sample 1 thru sample 10). I just ran a trial; I tried to select them from top to bottom and bottom to top and it did not seem to make a difference...they went into the document in reverse order. As I mentioned earlier I used to get a pop-up screen that would ask what order I wanted the inserted pages in...I don't get that pop-up anymore.

  • How to insert multiple rows in a single insert statement in MaxDB?

    hi,
    I was looking at syntax but i could not get it right.. may be some could help me.
    // Insert single row works fine
    INSET INTO test_table(column_name) values (value1) IGNORE DUPLICATES
    // Insert multiple rows, doesn't
    INSET INTO test_table(column_name) values (value1), (value2), (value3) IGNORE DUPLICATES
    Can somebody help me with this.
    thanks,
    sudhir.

    Multiple inserts do only work with parametrized statements, usually used in interfaces like JDBC, ODBC etc.
    With static SQL statements it is not possible.
    Regards Thomas

Maybe you are looking for

  • After upgrading to Windows 8, FireFox only brought in A-C. Bookmarks were arranged in folders. How do I import?

    After upgrading one of our PCs to Windows 8, not all of the bookmarks were in FireFox upon opening the browser for the first time after the upgrade. Only A-C were brought in. We've tried several methods of getting the rest back into the browser with

  • How to choose diffetent PO types in R/3 from a SC in Classic Scenario

    Hello everyone, I am working with SRM 5.0 in a classic scenario and I have a problem. I create a SC, then it is sent to sourcing cockpit where I assign it a vendor to create a PO, but I can't choose what kind of PO I want to create. In PPOMA_BB, the

  • Where do I declare my objects?

    I've never understood where to instantiate/construct/declare? my objects. For example when making a JFrame I could put JFrame frame; at the top of the program and the in the main class put frame = new Frame(); or I could just put JFrame frame = new J

  • How to download hierarchy from production system & recreate it development.

    Hi Gurus, I am working on a requirement where the updated hierarchy is present in production system & I have to create the same hierarchy with the same data in development system. Could you please suggest me the best way to download the same hierarch

  • Need help with rollOver

    I am trying to get an image to move when a user hovers over the image. My movie is called ball_mc i have added this code but get some errors. what am i doing wrong please? myButton_btn.onRollOver = function() { tweenBall(mx.transitions.easing.Bounce.