Skip to Content

How to add/Delete line to Table Control ?

How to add/Delete line to Table Control ?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2007 at 09:24 AM

    This message was moderated.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2007 at 09:24 AM

    Hi,

    To delete and add rows in the table control, first set the selection mode property and give a name to it (Say "SEL").

    Either u can select the rows in the table control and press the push button.

    Then in PAI write the module.

    CONTROLS TC1 TYPE TABLEVIEW USING SCREEN 9001.

    MODULE DeleteADDRecord INPUT.

    if SEL = 'X' AND sy-ucomm = 'DELETE'.

    delete it_purchase index tc1-Current_line.

    elseif SEL = 'X' AND sy-ucomm = 'ADD'.

    it_purchase-itemno = tc1-Current_line + 1.

    insert it_purchase index tc1-Current_line.

    endif.

    ENDMODULE. " DeleteRecord INPUT

    Also refer Program...

    <b>RSDEMO_TABLE_CONTROL</b>

    For More Information,

    Delete rows from Table Control->

    http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm

    Add rows in Table Control->

    http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm

    Regards,

    Padmam.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      The idea is to add or delete a line to the ITAB that corresponds to your TabCtrl. Adding is straight forward as all you have to do is append a blank line to the itab. For deletion, as you have to identify which row to delete, you must have some way to do this. One can be a radio box or the selection button functionality that the wizard provides. For this you should have a field of length 1 in the Internal which will be set to X. Now in the PAI module, all you need to do is delete that row which has this selection field set to X. Hope this helped. If you have more queries regarding this, feel free to get back.

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.