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

adding/removing rows in TABLEVIEW

Hi. I've got a TABLEVIEW in one of my subscreens. But when load itab into that tableview with 'LOOP AT...' tableview appears but I can't add rows to it. I can't delete existing rows too. What should I add to my programm to have possibility of adding/removing rows from my tablewiev? Greetings. P.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Jan 29, 2008 at 12:56 PM

    Hi Friend,

    To add/delete rows in your table view.

    You have to add/delete rows from internal table fro where you are displaying values.

    You have to write code in PAI..

    In LOOP ... ENDLOOP check the OK_CODE if it is ADD (for eg.) you have to add a blank row to internal table by just passing a blank work area.

    And if it is DELETE (for eg.) delete the row of that index (TABLEVIEW-CURRENT_LINE)...

    for these two excersies you have to readjust lines of tableview...after taking number of lines from internal table (DESCRIBE TABLE INT_EX LINES WS_LINES

    TABLEVIEW-LINES = WS_LINES) write this piece of code in Intialization.

    Hope it will solve the problem.

    Regards

    Krishnendu

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 29, 2008 at 12:52 PM

    Just add a few empty lines to your internal table and set the number of lines for the table control accordingly.

    e.g.

    itab has 5 lines with data

    append 3 empty lines to itab

    Set TABLECONTROL-LINES to 8 where TABLECONTROL is the name of your table control.

    Hope that helps,

    Michael

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 29, 2008 at 12:59 PM

    You can place buttons for add and subtract..

    when clicking add:

    describe table <itab> lines < line>.

    <tblctrl>-lines = line + 1.

    when clicking subtract:

    dealete <itba> index <index of the row>.

    describe table <itab> lines < line>.

    <tblctrl>-lines = line .

    itab : internal table used for populating data.

    line : is a variable type i.

    tblctrl : is the anme of table control.

    regards.

    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.