How to delete a row from table control

I have created a push button on the screen for delete.
its getting stored in ok_code.
'FLAG' is the name of the mark on the table control.
I am getting probs in this line.
I am not getting anything in mark_field.
ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
The code is:
MODULE tablctrl2_user_command INPUT.
  PERFORM user_ok_tc USING    'TABLCTRL2'
                              'I_ZSKILLEMP'
                              'FLAG'
                     CHANGING ok_code.
ENDMODULE.
FORM user_ok_tc USING    p_tc_name TYPE dynfnam
                         p_table_name
                         p_mark_name
                CHANGING p_ok      LIKE sy-ucomm.
-BEGIN OF LOCAL DATA----
  DATA: l_ok              TYPE sy-ucomm,
        l_offset          TYPE i.
-END OF LOCAL DATA----
Table control specific operations                                    *
  evaluate TC name and operations                                    *
  SEARCH p_ok FOR p_tc_name.
  IF sy-subrc <> 0.
    EXIT.
  ENDIF.
  l_offset = strlen( p_tc_name ) + 1.
  l_ok = p_ok+l_offset.
execute general and TC specific operations                           *
  CASE l_ok.
    WHEN 'INSR'.                      "insert row
      PERFORM fcode_insert_row USING    p_tc_name
                                        p_table_name.
      CLEAR p_ok.
    WHEN 'DELE'.                      "delete row
      PERFORM fcode_delete_row USING    p_tc_name
                                        p_table_name
                                        p_mark_name.
      CLEAR p_ok.
FORM fcode_delete_row
              USING    p_tc_name           TYPE dynfnam
                       p_table_name
                       p_mark_name   .
-BEGIN OF LOCAL DATA----
  DATA l_table_name       LIKE feld-name.
  FIELD-SYMBOLS <tc>         TYPE cxtab_control.
  FIELD-SYMBOLS <table>      TYPE STANDARD TABLE.
  FIELD-SYMBOLS <wa>.
  FIELD-SYMBOLS <mark_field>.
-END OF LOCAL DATA----
  ASSIGN (p_tc_name) TO <tc>.
get the table, which belongs to the tc                               *
  CONCATENATE p_table_name '[]' INTO l_table_name. "table body
  ASSIGN (l_table_name) TO <table>.                "not headerline
delete marked lines                                                  *
  DESCRIBE TABLE <table> LINES <tc>-lines.
  LOOP AT <table> ASSIGNING <wa>.
  access to the component 'FLAG' of the table header                 *
    ASSIGN COMPONENT p_mark_name OF STRUCTURE <wa> TO <mark_field>.
    IF <mark_field> = 'X'.
      DELETE <table> INDEX syst-tabix.
      IF sy-subrc = 0.
        <tc>-lines = <tc>-lines - 1.
      ENDIF.
    ENDIF.
  ENDLOOP.
ENDFORM.

Hi...
i got the same prob...but got the solution too...
you have to take an internal table of same type of dbase table..and maintain a flag in it...which will be get filled automatically with 'X'.
here is the code..go throug it..
REPORT  YH642_DIALOG_TABLECONTROL.
CALL SCREEN 999.
DATA:
  W_INDEX TYPE I.
DATA:
  W_UCOMM LIKE SY-UCOMM.
***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'TAB'
*&SPWIZARD: DEFINITION OF DDIC-TABLE
TABLES:   YH642_RAM.
DATA:
  BEGIN OF DDTAB,
    TAB_FLAG  TYPE C,
    MANDT  LIKE YH642_RAM-MANDT,
    EID    LIKE YH642_RAM-EID,
    ENAME  LIKE YH642_RAM-ENAME,
    MOBILE LIKE YH642_RAM-MOBILE,
  END OF DDTAB.
*&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'TAB'
TYPES: BEGIN OF T_TAB,
         TAB_FLAG TYPE C,
         MANDT LIKE YH642_RAM-MANDT,
         EID LIKE YH642_RAM-EID,
         ENAME LIKE YH642_RAM-ENAME,
         MOBILE LIKE YH642_RAM-MOBILE,
       END OF T_TAB.
*&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'TAB'
DATA:     G_TAB_ITAB   TYPE T_TAB OCCURS 0,
          H_TAB_ITAB   TYPE T_TAB OCCURS 0,
          G_TAB_WA     TYPE T_TAB. "work area
DATA:     G_TAB_COPIED.           "copy flag
*&SPWIZARD: DECLARATION OF TABLECONTROL 'TAB' ITSELF
CONTROLS: TAB TYPE TABLEVIEW USING SCREEN 0999.
*&SPWIZARD: LINES OF TABLECONTROL 'TAB'
DATA:     G_TAB_LINES  LIKE SY-LOOPC.
DATA:     OK_CODE LIKE SY-UCOMM.
*&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: COPY DDIC-TABLE TO ITAB
MODULE TAB_INIT OUTPUT.
  IF G_TAB_COPIED IS INITIAL.
*&SPWIZARD: COPY DDIC-TABLE 'YH642_RAM'
*&SPWIZARD: INTO INTERNAL TABLE 'g_TAB_itab'
    SELECT * FROM YH642_RAM
       INTO CORRESPONDING FIELDS
       OF TABLE G_TAB_ITAB.
    G_TAB_COPIED = 'X'.
    H_TAB_ITAB[] = G_TAB_ITAB[].
    REFRESH CONTROL 'TAB' FROM SCREEN '0999'.
  ENDIF.
ENDMODULE.                    "TAB_INIT OUTPUT
*&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MOVE ITAB TO DYNPRO
MODULE TAB_MOVE OUTPUT.
  MOVE-CORRESPONDING G_TAB_WA TO DDTAB.
ENDMODULE.                    "TAB_MOVE OUTPUT
*&SPWIZARD: OUTPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: GET LINES OF TABLECONTROL
MODULE TAB_GET_LINES OUTPUT.
  G_TAB_LINES = SY-LOOPC.
ENDMODULE.                    "TAB_GET_LINES OUTPUT
*&SPWIZARD: INPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: MODIFY TABLE
MODULE TAB_MODIFY INPUT.
  MOVE-CORRESPONDING DDTAB TO G_TAB_WA.
  MODIFY G_TAB_ITAB
    FROM G_TAB_WA
    INDEX TAB-CURRENT_LINE.
ENDMODULE.                    "TAB_MODIFY INPUT
*&SPWIZARD: INPUT MODULE FOR TC 'TAB'. DO NOT CHANGE THIS LINE!
*&SPWIZARD: PROCESS USER COMMAND
MODULE TAB_USER_COMMAND INPUT.
  OK_CODE = SY-UCOMM.
  PERFORM USER_OK_TC USING    'TAB'
                              'G_TAB_ITAB'
                              'TAB_FLAG'
                     CHANGING OK_CODE.
  SY-UCOMM = OK_CODE.
ENDMODULE.                    "TAB_USER_COMMAND INPUT
  INCLUDE TABLECONTROL_FORMS                                         *
*&      Form  USER_OK_TC                                               *
FORM USER_OK_TC USING    P_TC_NAME TYPE DYNFNAM
                         P_TABLE_NAME
                         P_MARK_NAME
                CHANGING P_OK      LIKE SY-UCOMM.
&SPWIZARD: BEGIN OF LOCAL DATA----
  DATA: L_OK              TYPE SY-UCOMM,
        L_OFFSET          TYPE I.
&SPWIZARD: END OF LOCAL DATA----
*&SPWIZARD: Table control specific operations                          *
*&SPWIZARD: evaluate TC name and operations                            *
  SEARCH P_OK FOR P_TC_NAME.
  IF SY-SUBRC <> 0.
    EXIT.
  ENDIF.
  L_OFFSET = STRLEN( P_TC_NAME ) + 1.
  L_OK = P_OK+L_OFFSET.
  L_OK = 'DELE'.
*&SPWIZARD: execute general and TC specific operations                 *
  CASE L_OK.
    WHEN 'INSR'.                      "insert row
      PERFORM FCODE_INSERT_ROW USING    P_TC_NAME
                                        P_TABLE_NAME.
      CLEAR P_OK.
    WHEN 'DELE'.           "delete row
     MESSAGE 'Are you really going to delete??' type 'I'.
      PERFORM FCODE_DELETE_ROW USING    P_TC_NAME
                                        P_TABLE_NAME
                                        P_MARK_NAME.
      CLEAR P_OK.
    WHEN 'P--' OR                     "top of list
         'P-'  OR                     "previous page
         'P+'  OR                     "next page
         'P++'.                       "bottom of list
      PERFORM COMPUTE_SCROLLING_IN_TC USING P_TC_NAME
                                            L_OK.
      CLEAR P_OK.
    WHEN 'L--'.                       "total left
      PERFORM FCODE_TOTAL_LEFT USING P_TC_NAME.
    WHEN 'L-'.                        "column left
      PERFORM FCODE_COLUMN_LEFT USING P_TC_NAME.
    WHEN 'R+'.                        "column right
      PERFORM FCODE_COLUMN_RIGHT USING P_TC_NAME.
    WHEN 'R++'.                       "total right
      PERFORM FCODE_TOTAL_RIGHT USING P_TC_NAME.
    WHEN 'MARK'.                      "mark all filled lines
      PERFORM FCODE_TC_MARK_LINES USING P_TC_NAME
                                        P_TABLE_NAME
                                        P_MARK_NAME   .
      CLEAR P_OK.
    WHEN 'DMRK'.                      "demark all filled lines
      PERFORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                          P_TABLE_NAME
                                          P_MARK_NAME .
      CLEAR P_OK.
    WHEN 'SASCEND'   OR
         'SDESCEND'.                  "sort column
      PERFORM FCODE_SORT_TC USING P_TC_NAME
                                  l_ok.
  ENDCASE.
ENDFORM.                              " USER_OK_TC
*&      Form  FCODE_INSERT_ROW                                         *
FORM FCODE_INSERT_ROW
              USING    P_TC_NAME           TYPE DYNFNAM
                       P_TABLE_NAME             .
&SPWIZARD: BEGIN OF LOCAL DATA----
  DATA L_LINES_NAME       LIKE FELD-NAME.
  DATA L_SELLINE          LIKE SY-STEPL.
  DATA L_LASTLINE         TYPE I.
  DATA L_LINE             TYPE I.
  DATA L_TABLE_NAME       LIKE FELD-NAME.
  FIELD-SYMBOLS <TC>                 TYPE CXTAB_CONTROL.
  FIELD-SYMBOLS <TABLE>              TYPE STANDARD TABLE.
  FIELD-SYMBOLS <LINES>              TYPE I.
&SPWIZARD: END OF LOCAL DATA----
  ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc                     *
  CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
  ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
*&SPWIZARD: get looplines of TableControl                              *
  CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_LINES_NAME.
  ASSIGN (L_LINES_NAME) TO <LINES>.
*&SPWIZARD: get current line                                           *
  GET CURSOR LINE L_SELLINE.
  IF SY-SUBRC <> 0.                   " append line to table
    L_SELLINE = <TC>-LINES + 1.
*&SPWIZARD: set top line                                               *
    IF L_SELLINE > <LINES>.
      <TC>-TOP_LINE = L_SELLINE - <LINES> + 1 .
    ELSE.
      <TC>-TOP_LINE = 1.
    ENDIF.
  ELSE.                               " insert line into table
    L_SELLINE = <TC>-TOP_LINE + L_SELLINE - 1.
    L_LASTLINE = <TC>-TOP_LINE + <LINES> - 1.
  ENDIF.
*&SPWIZARD: set new cursor line                                        *
  L_LINE = L_SELLINE - <TC>-TOP_LINE + 1.
*&SPWIZARD: insert initial line                                        *
  INSERT INITIAL LINE INTO <TABLE> INDEX L_SELLINE.
  <TC>-LINES = <TC>-LINES + 1.
*&SPWIZARD: set cursor                                                 *
  SET CURSOR LINE L_LINE.
ENDFORM.                              " FCODE_INSERT_ROW
*&      Form  FCODE_DELETE_ROW                                         *
FORM FCODE_DELETE_ROW
              USING    P_TC_NAME           TYPE DYNFNAM
                       P_TABLE_NAME
                       P_MARK_NAME   .
&SPWIZARD: BEGIN OF LOCAL DATA----
  DATA L_TABLE_NAME       LIKE FELD-NAME.
  FIELD-SYMBOLS <TC>         TYPE CXTAB_CONTROL.
  FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
  FIELD-SYMBOLS <WA>.
  FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
  ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc                     *
  CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
  ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
*&SPWIZARD: delete marked lines                                        *
  DESCRIBE TABLE <TABLE> LINES <TC>-LINES.
  LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header         *
    ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
    IF <MARK_FIELD> = 'X'.
      W_INDEX = SYST-TABIX.
      DELETE <TABLE> INDEX SYST-TABIX.
      IF SY-SUBRC = 0.
        <TC>-LINES = <TC>-LINES - 1.
      ENDIF.
    ENDIF.
  ENDLOOP.
  READ TABLE H_TAB_ITAB INDEX W_INDEX INTO G_TAB_WA.
  IF SY-SUBRC EQ 0.
    MOVE-CORRESPONDING G_TAB_WA TO YH642_RAM.
    DELETE YH642_RAM.
  ENDIF.
ENDFORM.                              " FCODE_DELETE_ROW
*&      Form  COMPUTE_SCROLLING_IN_TC
      text
     -->P_TC_NAME  name of tablecontrol
     -->P_OK       ok code
FORM COMPUTE_SCROLLING_IN_TC USING    P_TC_NAME
                                      P_OK.
&SPWIZARD: BEGIN OF LOCAL DATA----
  DATA L_TC_NEW_TOP_LINE     TYPE I.
  DATA L_TC_NAME             LIKE FELD-NAME.
  DATA L_TC_LINES_NAME       LIKE FELD-NAME.
  DATA L_TC_FIELD_NAME       LIKE FELD-NAME.
  FIELD-SYMBOLS <TC>         TYPE CXTAB_CONTROL.
  FIELD-SYMBOLS <LINES>      TYPE I.
&SPWIZARD: END OF LOCAL DATA----
  ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get looplines of TableControl                              *
  CONCATENATE 'G_' P_TC_NAME '_LINES' INTO L_TC_LINES_NAME.
  ASSIGN (L_TC_LINES_NAME) TO <LINES>.
*&SPWIZARD: is no line filled?                                         *
  IF <TC>-LINES = 0.
*&SPWIZARD: yes, ...                                                   *
    L_TC_NEW_TOP_LINE = 1.
  ELSE.
*&SPWIZARD: no, ...                                                    *
    CALL FUNCTION 'SCROLLING_IN_TABLE'
         EXPORTING
              ENTRY_ACT             = <TC>-TOP_LINE
              ENTRY_FROM            = 1
              ENTRY_TO              = <TC>-LINES
              LAST_PAGE_FULL        = 'X'
              LOOPS                 = <LINES>
              OK_CODE               = P_OK
              OVERLAPPING           = 'X'
         IMPORTING
              ENTRY_NEW             = L_TC_NEW_TOP_LINE
         EXCEPTIONS
             NO_ENTRY_OR_PAGE_ACT  = 01
             NO_ENTRY_TO           = 02
             NO_OK_CODE_OR_PAGE_GO = 03
              OTHERS                = 0.
  ENDIF.
*&SPWIZARD: get actual tc and column                                   *
  GET CURSOR FIELD L_TC_FIELD_NAME
             AREA  L_TC_NAME.
  IF SYST-SUBRC = 0.
    IF L_TC_NAME = P_TC_NAME.
*&SPWIZARD: et actual column                                           *
      SET CURSOR FIELD L_TC_FIELD_NAME LINE 1.
    ENDIF.
  ENDIF.
*&SPWIZARD: set the new top line                                       *
  <TC>-TOP_LINE = L_TC_NEW_TOP_LINE.
ENDFORM.                              " COMPUTE_SCROLLING_IN_TC
*&      Form  FCODE_TC_MARK_LINES
      marks all TableControl lines
     -->P_TC_NAME  name of tablecontrol
FORM FCODE_TC_MARK_LINES USING P_TC_NAME
                               P_TABLE_NAME
                               P_MARK_NAME.
&SPWIZARD: EGIN OF LOCAL DATA----
  DATA L_TABLE_NAME       LIKE FELD-NAME.
  FIELD-SYMBOLS <TC>         TYPE CXTAB_CONTROL.
  FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
  FIELD-SYMBOLS <WA>.
  FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
  ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc                     *
  CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
  ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
*&SPWIZARD: mark all filled lines                                      *
  LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header         *
    ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
    <MARK_FIELD> = 'X'.
  ENDLOOP.
ENDFORM.                                          "fcode_tc_mark_lines
*&      Form  FCODE_TC_DEMARK_LINES
      demarks all TableControl lines
     -->P_TC_NAME  name of tablecontrol
FORM FCODE_TC_DEMARK_LINES USING P_TC_NAME
                                 P_TABLE_NAME
                                 P_MARK_NAME .
&SPWIZARD: BEGIN OF LOCAL DATA----
  DATA L_TABLE_NAME       LIKE FELD-NAME.
  FIELD-SYMBOLS <TC>         TYPE CXTAB_CONTROL.
  FIELD-SYMBOLS <TABLE>      TYPE STANDARD TABLE.
  FIELD-SYMBOLS <WA>.
  FIELD-SYMBOLS <MARK_FIELD>.
&SPWIZARD: END OF LOCAL DATA----
  ASSIGN (P_TC_NAME) TO <TC>.
*&SPWIZARD: get the table, which belongs to the tc                     *
  CONCATENATE P_TABLE_NAME '[]' INTO L_TABLE_NAME. "table body
  ASSIGN (L_TABLE_NAME) TO <TABLE>.                "not headerline
*&SPWIZARD: demark all filled lines                                    *
  LOOP AT <TABLE> ASSIGNING <WA>.
*&SPWIZARD: access to the component 'FLAG' of the table header         *
    ASSIGN COMPONENT P_MARK_NAME OF STRUCTURE <WA> TO <MARK_FIELD>.
    <MARK_FIELD> = SPACE.
  ENDLOOP.
ENDFORM.                                          "fcode_tc_mark_lines
*&      Module  STATUS_0999  OUTPUT
      text
MODULE STATUS_0999 OUTPUT.
  SET PF-STATUS 'SS_STD'.
  SET TITLEBAR 'TITLE'.
ENDMODULE.                 " STATUS_0999  OUTPUT
*&      Module  USER_COMMAND_0999  INPUT
      text
MODULE USER_COMMAND_0999 INPUT.
  DATA:
    H_TAB_WA LIKE G_TAB_WA.
  CASE W_UCOMM.
    WHEN 'BACK'.
      LEAVE PROGRAM.
    WHEN 'TAB_MODI' OR 'SAVE'.
      LOOP AT G_TAB_ITAB INTO G_TAB_WA.
      FORMAT   INPUT OFF.
        MOVE-CORRESPONDING G_TAB_WA TO YH642_RAM.
        READ TABLE H_TAB_ITAB WITH KEY EID = G_TAB_WA-EID INTO H_TAB_WA.
        IF SY-SUBRC EQ 0.
          IF G_TAB_WA NE H_TAB_WA.
            MODIFY YH642_RAM.
          ENDIF.
        ELSE.
          INSERT  YH642_RAM.
        ENDIF.
      ENDLOOP.
SORT  G_TAB_ITAB.
  ENDCASE.
*CALL SCREEN 700.
ENDMODULE.                 " USER_COMMAND_0999  INPUT

Similar Messages

  • How to delete the row in table control with respect to one field in module pool programming?

    Hi,
    Can I know the way to delete the row in table control with respect to one field in module pool programming
    Regards
    Darshan MS

    HI,
    I want to delete the row after the display of table control. I have created push button as delete row. If I click on this push button, the selected row should get deleted.
    I have written this code,
    module USER_COMMAND_9000 input.
    DATA OK_CODE TYPE SY-UCOMM.
    OK_CODE = SY-UCOMM.
    CASE OK_CODE.
         WHEN 'DELETE'.
            LOOP AT lt_source INTO ls_source WHERE mark = 'X'.
                APPEND LS_SOURCE TO LT_RESTORE.
                DELETE TABLE LT_SOURCE FROM LS_SOURCE.
                SOURCE-LINES = SOURCE-LINES - 1.
            ENDLOOP.
    But I'm unable to delete the selected rows, It is getting deleted the last rows eventhough I select the other row.
    So I thought of doing with respect to the field.

  • How to delete a row in table control?

    Hi All,
    I have a empty table control which is only use for data input(this data will then be use to store information to a custom table).  I have two buttons, Create Entry and Delete Entry.
    In my screenPainter for the table control, I have the checkbox w/SelColumn ticked and assign variable T_DATA-MARK on it.
    In my code:
    TOP Include
    CONTROLS: tc_data      TYPE TABLEVIEW USING SCREEN 9001.
    PBO
    PROCESS BEFORE OUTPUT.
      LOOP WITH CONTROL TC_ID.
        MODULE LOAD_TABLECTRL.
      ENDLOOP.
    module LOAD_TABLECTRL output.
      READ TABLE T_DATA INTO WA_DATA INDEX TC_DATA-current_line.
      IF SY-SUBRC EQ 0.
        MOVE-CORRESPONDING T_DATA TO WA_DATA.
      ENDIF.
    endmodule. 
    PAI
    PROCESS AFTER INPUT.
       LOOP WITH CONTROL TC_ID.
       ENDLOOP.
    MODULE GET_USER_ACTION.
    module GET_USER_ACTION input.
      WHEN 'DEL'.
        LOOP AT T_DATA INTO WA_DATA WHERE MARK EQ 'X'.
          DELETE T_DATA.
        ENDLOOP.
    In my debug, the internal table T_DATA-MARK does not have any value(s) even if I selected a particular row in my table control. 
    Am I missing something here?
    Thanks

    Hi All,
    Please see the actual screenshots and code below:
    The aim of the table control is just to accept inputs, so the internal table in the PBO is always empty.
    Table Control Screen Painter ScreenShot and Actual SAP Output: http://img710.imageshack.us/img710/4751/tablecontrolrowdelete.jpg
    PBO
    PROCESS BEFORE OUTPUT.
      LOOP WITH CONTROL TC_ID.
        MODULE LOAD_TABLECTRL.
      ENDLOOP.
    module LOAD_TABLECTRL output.
      READ TABLE T_ID_CHECK INTO WA_ID_CHECK INDEX TC_ID-current_line.
      IF SY-SUBRC EQ 0.
        MOVE-CORRESPONDING T_ID_CHECK TO TC_ID.
      ELSE.
          "EXIT FROM STEP-LOOP.
          CLEAR ZQID_CHECK.
      ENDIF.
    PAI
    PROCESS AFTER INPUT.
       LOOP WITH CONTROL TC_ID.
         CHAIN.
          MODULE CHECK_ENTRIES     ON CHAIN-INPUT.     
          MODULE MODIFY_T_ID_CHECK ON CHAIN-INPUT.
          MODULE DELETE_ROW        ON CHAIN-INPUT
         ENDCHAIN.
       ENDLOOP.
    module CHECK_ENTRIES input.
      CASE ok_code.
        WHEN 'DEL'.
            PERFORM F_FILL_ITABCREATE USING ZQID_CHECK-MATNR
                                            ZQID_CHECK-LICHA
                                            ZQID_CHECK-LIFNR.
      ENDCASE.
    endmodule.    
    module MODIFY_T_ID_CHECK input.
    DATA W_TEMPMARK(1) TYPE C.
      MOVE: T_ID_CHECK-MARK TO W_TEMPMARK,
            W_TEMPMARK TO T_ID_CHECK-MARK.
    MODIFY T_ID_CHECK INDEX SY-TABIX TRANSPORTING MARK.
    endmodule.
    module DELETE_ROW input.
      LOOP AT T_ID_CHECK WHERE MARK EQ 'X'.
        DELETE T_ID_CHECK.
      ENDLOOP.
    endmodule.   
    form F_FILL_ITABCREATE  using    us_zqid_check_matnr LIKE MARA-MATNR
                                     us_zqid_check_licha LIKE MCHA-LICHA
                                     us_zqid_check_lifnr LIKE LFA1-LIFNR.
      MOVE: us_zqid_check_matnr TO WA_ID_CHECK-MATNR,
            us_zqid_check_licha TO WA_ID_CHECK-LICHA,
            us_zqid_check_lifnr TO WA_ID_CHECK-LIFNR.
      APPEND WA_ID_CHECK TO T_ID_CHECK.
      CLEAR WA_ID_CHECK.
    endform.
    In my debug, I can now delete the internal table that has a 'X' mark on its respective row but on the SAP screen output, all of my entries are being deleted contrary to what the ABAP debugger is telling me.
    Thanks

  • How to delete a row in table control(accepts only input)?

    Hi All,
    I have an empty table control which is only use for data input(this data will then be use to store information to a custom table). I have two buttons, Create Entry and Delete Entry.
    In my screenPainter for the table control, I have the checkbox w/SelColumn ticked and assign variable T_DATA-MARK on it.
    Please see the actual screenshots and code below:
    The aim of the table control is just to accept inputs, so the internal table in the PBO is always empty.
    Table Control Screen Painter ScreenShot and Actual SAP Output:
    http://img710.imageshack.us/img710/4751/tablecontrolrowdelete.jpg
    PBO
    PROCESS BEFORE OUTPUT.
      LOOP WITH CONTROL TC_ID.
        MODULE LOAD_TABLECTRL.
      ENDLOOP.
    module LOAD_TABLECTRL output.
      READ TABLE T_ID_CHECK INTO WA_ID_CHECK INDEX TC_ID-current_line.
      IF SY-SUBRC EQ 0.
        MOVE-CORRESPONDING T_ID_CHECK TO TC_ID.
      ELSE.
          "EXIT FROM STEP-LOOP.
          CLEAR ZQID_CHECK.
      ENDIF.
    PAI
    PROCESS AFTER INPUT.
       LOOP WITH CONTROL TC_ID.
         CHAIN.
          MODULE CHECK_ENTRIES     ON CHAIN-INPUT.     
          MODULE MODIFY_T_ID_CHECK ON CHAIN-INPUT.
          MODULE DELETE_ROW        ON CHAIN-INPUT
         ENDCHAIN.
       ENDLOOP.
    module CHECK_ENTRIES input.
      CASE ok_code.
        WHEN 'DEL'.
            PERFORM F_FILL_ITABCREATE USING ZQID_CHECK-MATNR
                                            ZQID_CHECK-LICHA
                                            ZQID_CHECK-LIFNR.
      ENDCASE.
    endmodule.    
    form F_FILL_ITABCREATE  using    us_zqid_check_matnr LIKE MARA-MATNR
                                     us_zqid_check_licha LIKE MCHA-LICHA
                                     us_zqid_check_lifnr LIKE LFA1-LIFNR.
      MOVE: us_zqid_check_matnr TO WA_ID_CHECK-MATNR,
            us_zqid_check_licha TO WA_ID_CHECK-LICHA,
            us_zqid_check_lifnr TO WA_ID_CHECK-LIFNR.
      APPEND WA_ID_CHECK TO T_ID_CHECK.
      CLEAR WA_ID_CHECK.
    endform.
    module MODIFY_T_ID_CHECK input.
    DATA W_TEMPMARK(1) TYPE C.
      MOVE: T_ID_CHECK-MARK TO W_TEMPMARK,
            W_TEMPMARK TO T_ID_CHECK-MARK.
    MODIFY T_ID_CHECK INDEX SY-TABIX TRANSPORTING MARK.
    endmodule.
    module DELETE_ROW input.
      LOOP AT T_ID_CHECK WHERE MARK EQ 'X'.
        DELETE T_ID_CHECK.
      ENDLOOP.
    endmodule.   
    Edited by: Jaime Cabanban on Jan 7, 2010 8:46 PM

    Debugging the PBO part after deletion will help you know why the rows are getting deleted
    This is the sap doc answer for you question regarding LINE.
    Controls the scroll bar of the table control. At LOOP without internal table, LINES has the initial value zero and must be set in the program so that the scroll bar can be used. At LOOP AT <itab> the system sets this component to the number of rows of the internal table, whenever the table control is processed for the first time. The initialization event of a table control is not determined uniquely. If the corresponding internal table is not fully created at this event, then the LINES variable receives an incorrect value. If LINES in the LOOP loop is smaller as the number of rows of the internal table, then the table control contains blank rows at the end.
    Therefore you should always set the LINES component explicitly in the ABAP program, including at LOOP AT <itab>. In this way you have full control over the dimensions of the vertical scroll bar and so can control the number of rows that are ready for input. Initialization should usually occur at PBO directly before the LOOP statement for the table control.

  • How to delete selected row in table control

    Hi all,
    here is my coding for deleting selected row.
    But it is not working correctly.
    I am not able to delete seleced row.
    If i press delete button it automatically delete from beginning instead of selected rows.
    Can anyone can help me plz...
    CONTROLS rowdeleting TYPE TABLEVIEW USING SCREEN 100.
    TABLES zdetails.
    data : begin of itab occurs 0,
    NAME TYPE ZDETAILS-NAME,
    ADDRES TYPE ZDETAILS-ADDRES,
    CONTACTNO TYPE ZDETAILS-CONTACTNO,
    INIT TYPE C,
    end of itab .
    DATA OK_CODE LIKE SY-UCOMM.
    CALL SCREEN 100.
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'BACK'.
    IF ITAB-INIT IS INITIAL.
    SELECT NAME ADDRES CONTACTNO FROM ZDETAILS
    INTO CORRESPONDING FIELDS OF TABLE ITAB.
    DESCRIBE TABLE ITAB LINES rowdeleting-LINES.
    ITAB-INIT = 'X'.
    ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    MODULE CHANGE_SDYN_CONN OUTPUT.
    READ TABLE itab INTO ZDETAILS INDEX rowdeleting-current_line.
    ENDMODULE. " CHANGE_SDYN_CONN OUTPUT
    MODULE READ_TABLE_CONTROL INPUT.
    IF ITAB-INIT = 'X' AND OK_CODE = 'DELETE'.
    DELETE ITAB index rowdeleting-current_line ."FROM ZDETAILS.
    DESCRIBE TABLE ITAB LINES rowdeleting-LINES.
    ENDIF.
    ENDMODULE. " READ_TABLE_CONTROL INPUT
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
    WHEN 'BACK'.
    LEAVE PROGRAM.
    WHEN 'DELETE'.
    IF ITAB-INIT = 'X' AND OK_code = 'DELETE'.
    DELETE ITAB index rowdeleting-current_line .
    ENDIF.
    ENDCASE.
    ENDMODULE.
    regards ,
    ranjith.

    Hi,
    Check the following code:
    CONTROLS TABLE_CONTROL TYPE TABLEVIEW USING SCREEN 100.
    TABLES SDYN_SDW4.
    DATA SDYN_ITAB LIKE STANDARD TABLE OF SDYN_SDW4.
    DATA INIT.
    DATA OK_CODE LIKE SY-UCOMM.
    DATA SAVE_OK LIKE SY-UCOMM.
    DATA MARK.
    DATA  COL TYPE CXTAB_COLUMN.
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'GRUND'.
      SET TITLEBAR '100'.
      IF INIT IS INITIAL.
    Datenbeschaffung
       SELECT CARRID CONNID CITYFROM AIRPFROM CITYTO AIRPTO DEPTIME ARRTIME
                DISTANCE DISTID
                FROM SPFLI
                INTO CORRESPONDING FIELDS OF TABLE SDYN_ITAB.
        DESCRIBE TABLE SDYN_ITAB LINES TABLE_CONTROL-LINES.
        INIT = 'X'.
      ENDIF.
    ENDMODULE.                             " STATUS_0100  OUTPUT
    *&      Module  FILL_TABLE_CONTROL  OUTPUT
          text
    MODULE CHANGE_SDYN_CONN OUTPUT.
    you can change the content of current table control line via
    sdyn_conn
    READ TABLE sdyn_itab INTO sdyn_conn INDEX table_control-current_line.
    ENDMODULE.                             " FILL_TABLE_CONTROL  OUTPUT
    *&      Module  READ_TABLE_CONTROL  INPUT
          text
    MODULE READ_TABLE_CONTROL INPUT.
    Check input values
      IF MARK = 'X' AND SAVE_OK = 'DELETE'.
        DELETE TABLE SDYN_ITAB FROM sdyn_sdw4.
        DESCRIBE TABLE SDYN_ITAB LINES TABLE_CONTROL-LINES.
      ENDIF.
    ENDMODULE.                             " READ_TABLE_CONTROL  INPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      SAVE_OK = OK_CODE.
      CLEAR OK_CODE.
      CASE SAVE_OK.
        WHEN 'SORT'.
          DATA: FLDNAME(100),HELP(100).
          READ TABLE TABLE_CONTROL-COLS INTO COL WITH KEY SELECTED = 'X'.
          SPLIT COL-SCREEN-NAME AT '-' INTO HELP FLDNAME.
          SORT SDYN_ITAB BY (FLDNAME).
      ENDCASE.
    ENDMODULE.                             " USER_COMMAND_0100  INPUT
    *&      Module  EXIT  INPUT
          text
    MODULE EXIT INPUT.
    LEAVE PROGRAM.
    ENDMODULE.                 " EXIT  INPUT
    Regards,
    Bhaskar

  • How to delete certain rows from Table view

    Hi Experts,
    I need to display result on the basis of certain process type. So i have used code like below.
           lv_iterator =   me->typed_context->searchresult->collection_wrapper->get_iterator( ).
           lv_entity = lv_iterator->get_first( ).
           WHILE lv_entity IS BOUND.
             CLEAR:lv_object.
             lv_object = lv_entity->get_property_as_string( iv_attr_name = 'PROCESS_TYPE' ).
             IF lv_object <> 'XXX'.
               lr_entity ?= lv_entity.
              me->typed_context->searchresult->collection_wrapper->remove( lv_entity ).
              lr_entity->delete( ).
             ENDIF.
             lv_entity = lv_iterator->get_next( ).
           ENDWHILE.
    But only some of the entities from the collection are getting removed. Still some wrong entities exists which i cant even able to delete it by using ,
              me->typed_context->searchresult->collection_wrapper->remove( lv_entity ).
              lr_entity->delete( ).
    Am i missing anything here?
    Regards,
    Santhosh

    Hi Santhosh,
    Maybe that is happening because you're removing elements from an object (collection_wrapper) inside your loop.
    Can you try to create an collection wrapper copy by using GET_COPY method, and then use and loop the iterator on your copied object, and remove the unwanted entities on your main object?
    Kind regards,
    Garcia

  • How to Delete certain rows from table view collection

    Hi Experts,
    I need to display result on the basis of certain process type. So i have used code like below.
           lv_iterator =   me->typed_context->searchresult->collection_wrapper->get_iterator( ).
           lv_entity = lv_iterator->get_first( ).
           WHILE lv_entity IS BOUND.
             CLEAR:lv_object.
             lv_object = lv_entity->get_property_as_string( iv_attr_name = 'PROCESS_TYPE' ).
             IF lv_object <> 'XXX'.
               lr_entity ?= lv_entity.
              me->typed_context->searchresult->collection_wrapper->remove( lv_entity ).
              lr_entity->delete( ).
             ENDIF.
             lv_entity = lv_iterator->get_next( ).
           ENDWHILE.
    But only some of the entities from the collection are getting removed. Still some wrong entities exists which i cant even able to delete it by using ,
              me->typed_context->searchresult->collection_wrapper->remove( lv_entity ).
              lr_entity->delete( ).
    Am i missing anything here?
    Regards,
    Santhosh

    Hi Santhosh,
    Maybe that is happening because you're removing elements from an object (collection_wrapper) inside your loop.
    Can you try to create an collection wrapper copy by using GET_COPY method, and then use and loop the iterator on your copied object, and remove the unwanted entities on your main object?
    Kind regards,
    Garcia

  • Reg:How to delete the column in table control also from database table.

    Hi Experts,
    Once again thank u all for giving the responses.
    one more doubt is how to delete the columns of table control and also the record shold delete from ztable.
    With Regards,
    Saroja.P.

    Hi,
    If you want to delete the rows in the table control and simultaneously delete it from the database table, then you can implement a 'DELETE' functionality specific to your table control. Have a MARK field (you will find that in the screen attributes of the table control -> give a name for the MARK field, you will find an additional MARK column at the beginning of your table control). You can check whatever rows you want to delete from the table control, call the delete module.
    "This portion of code inside the LOOP...ENDLOOP.
    IF sy-ucomm eq 'F_DELETE'.
       gt_itab2-check = mark.  " Store the MARK field status into your internal table's correspoding field 'check'
      MODIFY gt_itab INDEX tabcontrol-current_line.
    ENDIF.
    iF sy-ucomm eq 'DELETE1'.
      DELETE gt_itab WHERE check eq 'X'. "Your internal table does not have rows that you want to delete
    ENDIF.
    Now you can modify your database table using the MODIFY statement.
    MODIFY ZDB FROM TABLE gt_itab.

  • How to delete multiple rows from ADF table

    How to delete multiple rows from ADF table

    Hi,
    best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
    Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
    Frank

  • Unable to delete a row in table control

    Hi,
    I'm unable to delete a row in table control.
    I have defined a selection column for my table control but it is not getting value 'X' when i'm selecting a row for deletion.
    Also, when I press enter, some of the columns in table control are getting initialized. I'm passing these values to the internal table along with other columns.
    Please help.
    Regards,
    Manasee
    Message was edited by: Manasee Chandorkar

    hi,
    kindly chk this.
    PROCESS BEFORE OUTPUT.
    MODULE status_9010.
    LOOP WITH CONTROL tab_control.
    MODULE move_data_to_table.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP WITH CONTROL tab_control.
    MODULE move_data_from_table.
    ENDLOOP.
    *& Module move_data_to_table OUTPUT
    This is to move the data from the internal table to the table control
    MODULE move_data_to_table OUTPUT.
    This is to move the data from the internal table to the table control
    zmpets_mode-modecode,zmpets_range-rangeid,zmpets_servfacto-factor are column name of table control
    READ TABLE int_factor INDEX tab_control-current_line.
    IF sy-subrc = 0.
    zmpets_mode-modecode = int_factor-modecode.
    zmpets_range-rangeid = int_factor-rangeid.
    zmpets_servfacto-factor = int_factor-factor.
    ENDIF.
    ENDMODULE. " move_data_to_table OUTPUT
    *& Module move_data_from_table INPUT
    Date is moved from the table control to the Internal Table
    MODULE move_data_from_table INPUT.
    To move the data from the table control to internal table 'INT_FACTOR'.
    int_factor-modecode = zmpets_mode-modecode.
    int_factor-rangeid = zmpets_range-rangeid.
    int_factor-factor = zmpets_servfacto-factor.
    int_factor-chk = line.
    *here if the data is there, it will modify
    MODIFY int_factor INDEX tab_control-current_line.
    IF sy-subrc NE 0. "data not exixting in table control . ie new data, then append it
    APPEND int_factor.
    CLEAR int_factor.
    ENDIF.
    ENDMODULE. " move_data_from_table INPUT
    *delete a line from table control
    MODULE user_command_9010 INPUT.
      CASE sy-ucomm.
    When an entry is deleted, and the entry is removed from the table
    control.
        WHEN 'DELETE'.
          PERFORM f_del_frm_tab_cntrl.
      ENDCASE.
    ENDMODULE.
    FORM f_del_frm_tab_cntrl .
      LOOP AT int_factor WHERE chk = 'X'.
        DELETE int_factor WHERE chk = 'X' .
        CONTINUE.
      ENDLOOP.
      CLEAR int_factor.
    ENDFORM.
    for any clarifiaction pls mail me.
    pls reward points, if this helped u.
    regards,
    anversha.
    [email protected]
    Message was edited by: Anversha s

  • How To Delete a Row From a TableView !!!!

    Hi,
    Does any know how to delete a row from a table view model.
    I have a TableViewModel being displayed, when the user select the particular row and click delete i want that particular row to be deleted.
    Any Suggestions How.
    Thanks,
    Emmanuel.

    If u want to delete single row, then set the property of TableView - selectionMode="SINGLESELECT". Select the radio button and click on delete button. In the main program, you can get the row value like...
    public void onDeleteButtonClicked(Event event) throws PageException {
    TableView table = (TableView) this.getComponentByName ("idTableView");
    DefaultTableViewModel dmodel = myBean.beanModel;
    String pid = "", row_selected;
    // Get the first visible row
    int firstVisibleRow = table.getVisibleFirstRow();
    // Get the last visible row
    int lastVisibleRow = table.getVisibleLastRow();
    for (int i = firstVisibleRow; i <= lastVisibleRow; i++) {
    if (table.isRowSelected(i)) {
      row_selected = i;
      pid = dmodel.getValueAt(i, 1).toString();
    "i" will give you the row no, pid has the value of the row at first column.
    Hope this helps.
    Thanks,
    Praveen

  • Deleting the values from table control

    HI,
    I need to remove the selected line from the Table control on my screen.
    The point is that the Internal table does not have any records,.
    for example in the Customer Create screen,
    while entering the bank details we will enter it in a tbale contraol.
    but the records doesnt exist in the database. but the record gets deleted from the table control only if we press delete button.
    please guide me.
    please note : I want to delete the record from Table Control on the screen and I dont have any corresponding database records..
    regards

    Hi..
    The solution to your problem - deleting values from table control.
    Here: it_wizard is the internal table which is holding the value of table control.
             wa_wizard is the work are of the internal table it_wizard.
             it_delete is the internal table which holds the deleted record of table control.
             wa_delete is the work area of the internal table it_delete
    Also here the field ZSEL is the character field which is used to select the entire record in the table control.
    LOOP AT it_wizard into wa_wizard WHERE zsel = 'X'.
           MOVE-CORRESPONDING wa_wizard TO wa_delete.
           APPEND wa_delete TO it_delete.
           delete table it_wizard from wa_wizard.
    DELETE  FROM zfin_goods WHERE ZFG = WA_delete-ZFG.
    ENDLOOP
    if sy-subrc eq 0.
    Message 'Delete Successful' type 'S'.
    endif.
    The above code will delete the record from both the table control.internal table and the database table.
    I think this will help you to great extent.
    Ward regards,
    Bhuvaneswari
    Edited by: BHUVANESWARI THIRUNAVUKKARASU on Jan 7, 2009 10:39 AM

  • How to delete a row of table in Word using powershell.

    I want to search for a word which is present in Table. If that word is present than I want to delete that row from table.
    Can anybody help me with that. The script I am using is:
    $objWord = New-Object -ComObject word.application
    $objWord.Visible = $True
    $objDoc = $objWord.Documents.Open("C:\temp\Recipe.docx")
    $FindText = "DP1"
    $objSelection.Find.Execute($FindText)
    $objWord.Table.Cells.EntireRow.Delete()
    $objDoc.SaveAs("C:\Temp\P.docx")
    $Doc.Close()

    Maybe try this:
    $objWord = New-Object -ComObject word.application
    $objWord.Visible = $True
    $objWord.Documents.Open("C:\temp\Recipe.docx")
    $FindText = "DP1"
    $objWord.Selection.Find.Execute($FindText) | Out-Null
    $objWord.Selection.SelectRow()
    $objWord.Selection.Cells.Delete()
    $objWord.Documents.SaveAs("C:\Temp\P.docx")
    $objWord.Close()
    $objWord.Quit()
    [System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$objWord) | Out-Null
    This definitely assumes the text you're trying to find only exists in a table, per your specified requirements.  If it exists anywhere else, or in multiple tables, the code above is inadequate.
    I hope this post has helped!

  • How to update duplicate row from table

    Hi,
    how to update duplicate row from table?
    First to find duplicate row then update duplicate row with no to that duplicate row in oracle.
    can you give me suggestion on it?
    Thanks in advance.
    your early response is appreciated...

    In order to find a duplicate row, see:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1224636375004
    (or search this forum, your question has been asked before)
    In order to update it, just create and use an Oracle sequence, have it start and increment at a value that doesn't exist in your table.
    If that doesn't get you going, post some CREATE TABLE + INSERT INTO statements, and the results you want from them, in other words: a complete testcase.

  • HOW TO DELETE THE ROW FROM DATABASE

    hI,
    Iam pasting my code below.My problem isi retrieve rows from database and display them in jsp page in rows.For each row there is delete hyperlink.Now when i click that link i should only delete the row corresponding to that delete link temporarily but it should not delete the row from database now.It should only delete the row from database when i click the save button.How can i do this can any one give some code.
    thanks
    naveen
    [email protected]
    <%@ page language="java" import="Utils.*,java.sql.*,SQLCon.ConnectionPool,java.util.Vector,java.util.StringTokenizer" %>
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>Item Details</title>
    <script>
    function submitPage()
    document.details.action = "itemdetails.jsp" ;
    document.details.submit();
    </script>
    </head>
    <body>
    <form name="details" action="itemdetails.jsp" method="post">
    <%
    ConnectionPool pool;
    Connection con = null;
    Statement st;
    ResultSet rs =null;
    %>
    <table border="0" cellpadding="0" cellspacing="0" width="328">
    <tr>
    <td width="323" colspan="4"><b>Reference No :</b> <input type="text" name="txt_refno" size="14">
    <input type="submit" value="search" name="search" ></td>
    </tr>
    <tr>
    <td width="81" bgcolor="#000099"><font color="#FFFFFF"><b>Item Code</b></font></td>
    <td width="81" bgcolor="#000099"><font color="#FFFFFF"><b>Item No</b></font></td>
    <td width="81" bgcolor="#000099"><font color="#FFFFFF"><b>Amount </b></font></td>
    <td width="80" bgcolor="#000099"> </td>
    </tr>
    <%
    pool= new ConnectionPool();
    Utils utils = new Utils();
    double total =0.00;
    String search =utils.returnString(request.getParameter("search"));
    if(search.equals("search"))
    try
    String ref_no =utils.returnString(request.getParameter("txt_refno"));
    String strSQL="select * from ref_table where refno='" + ref_no + "' ";
    con = pool.getConnection();
    st=con.createStatement();
    rs = st.executeQuery(strSQL);
    while(rs.next())
    String itemcode=rs.getString(2);
    int item_no=rs.getInt(3);
    double amount= rs.getDouble(4);
    total= total + amount;
    %>
    <tr>
    <td width="81"><input type=hidden name=hitem value=<%=itemcode%>><%=itemcode%></td>
    <td width="81"><input type=hidden name=hitemno value=<%=item_no%>><%=item_no%></td>
    <td width="81"><input type=hidden name=hamount value=<%=amount%>><%=amount%></td>
    <td width="80"><a href="delete</td>
    </tr>
    <%
    }catch(Exception e){}
    finally {
    if (con != null) pool.returnConnection(con);
    %>
    <tr>
    <td width="323" colspan="4">
    <p align="right"><b>Total:</b><input type="text" name="txt_total" size="10" value="<%=total%>"></td>
    </tr>
    <tr>
    <td width="323" colspan="4">                   
    <input type="button" value="save" name="save"></td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    You mean when you click on the hyperlink you want that row to disappear from the page, but not delete the row from the database until a commit/submit button is pressed?
    Personally, I think I'd prefer that you have a delete checkbox next to every row and NOT remove them from the display if I was a user. You give your users a chance to change their mind about their choice, and when they're done they can see exactly which rows will be deleted before they commit.
    You know your problem, of course, so you might have a good reason for designing it this way. But I'd prefer not removing them from the display. JMO - MOD

Maybe you are looking for

  • How to implement this?

    I have a master table (contracts table) with about 20 variables. (about 20 records/ contracts in it) the records are static, they only chage once every 5 years. The idea is that a user queries a customer, if the customer does not have a contract assi

  • RMAN archive logs backup and restore in RAC environment.

    Hello All, I have a 8 node RAC using ASM production database and a single node standby database using ASM. I have archive log gap on the standby database and the archive logs on the primary database is backed up and removed. I need to resync the stan

  • Flashplayer 11.3 Bug - Fullscreen from ContextMenu doesn't work anymore!

    Hi, with the latest Flashplayer 11.3 version, switching to Fullscreen Mode isn't possible anymore when done from the Contextmenu! Here a simple example plus the Actionscript 3 source code of it: http://krpano.com/flashplayer/bugs/contextmenufullscree

  • IWork Import

    Anyone know of plans to add import filters for Pages/Numbers files, we are using and receiving more and more of them. Derek

  • Unable to find files younger than 7 Days old in FINDER

    When I save a file I can't find it until it is about a week or so old - or so it seems. I have just save several screen shots to my iMac to illustrate this point but I can't find them. When opening my HDD to find them (either in Desktop or a special