Skip to Content
author's profile photo Former Member
Former Member

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2006 at 06:59 AM

    check this program , u will come to know where is the probs.

    DEMO_DYNPRO_TABCONT_LOOP_AT

    regards

    Prabhu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2006 at 07:01 AM

    Hello,

    Add one more field in the database table as MARK of character length 1. Then while creating the table in the screen, in the table properties at the below there will be one option with check box (W/selcolumn). Click that and mention the value ITAB-MARK in the text box next to it.

    Now automatically when you select the row in the table control, the particular row will be marked as 'X' in the internal table.

    So now you can delete the value from the internal table where MARK = 'X'.

    I hope this help.

    Regs,

    Venkat

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2006 at 07:03 AM

    Hi

    You have to insert the MARK colunm in your table control and assign this field to a flag field of your internal table:

    PROCESS PBO.

    LOOP AT ITAB....

    MODULE SHOW_ITAB.

    ENDLOOP.

    PROCESS PAI.

    LOOP AT ITAB....

    MODULE MODIFY_ITAB.

    ENDLOOP.

    MODULE USER_COMMAND.

    MODULE SHOW_ITAB.

    <TABLE CONTROL FIELD FOR MARK> = ITAB-MARK.

    ENDMODULE.

    MODULE MODIFY_ITAB.

    ITAB-MARK = <TABLE CONTROL FIELD FOR MARK>.

    MODIFY ITAB INDEX <TABLE CONTROL>-CURRENT_LINE.

    ENDMOFULE.

    MODULE USER_COMMAND.

    CASE OK_CODE.

    WHEN 'DELE'.

    DELETE ITAB WHERE MARK = 'X'

    ENDCASE.

    ENDMODULE.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 27, 2006 at 07:21 AM

    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.

    anversha.shahul@wipro.com

    Message was edited by: Anversha s

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2006 at 07:24 AM

    hi,

    1. in SE51, choose LAYOUT button on application tool bar. 2. in layout, double click on table control. u get attributes wondow opened.

    3. at the bottom of the window, u have an option

    <b>w/SelColumn</b>. give a name for ex. SEL in the box.

    4. now in ur code write like this

    <b> data selcol(1).

    if selcol = 'X'.

    delete itab.

    endif.</b>

    reward if useful...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 27, 2006 at 07:33 AM

    Yes manasee,

    DATA :BEGIN OF int_factor OCCURS 0,

    modecode TYPE zmpets_mode-modecode,

    rangeid TYPE zmpets_range-rangeid,

    factor TYPE zmpets_servfacto-factor,

    chk(1),

    END OF int_factor.

    In the screenlayout also u have to do some things.

    Double click the table control.

    In the screen painter-> go to bottom-> tick that w/selectcolumn -> on the right hand text of that give LINE

    rgds

    anver

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.