Skip to Content

How to add a table row in a table.Please help!

Hi Experts,

My requirement is,when the page is load then only one row should be generate in the Webdynpro ABAP table.There have a button "Add Row",after clicking on that button another row will be created and also there have a "Delete Row" button,after click on that the present will be deleted.Please refer the image.

This is done by in Webdynpro JAVA.Is there any way to create in ABAP. If possible please help me.

Thanks and Regards,

Amit Basak

Example.JPG (22.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 07, 2014 at 08:23 PM

    You can create an ALV and set the "read only mode" to false and the buttons "Append row", "Insert row" and "Delete row" will show up automatically in the toolbar of the ALV.

    Check this document or this wiki for more information.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 08, 2014 at 04:35 AM

    Hi Amit,

    There are many threads available on SCN similar to your requirement.

    To add an empty row initially, you need write logic in WDDOINIT( ) method of VIEW i.e

    Sample:

    DATA lt_material TYPE wd_this->Elements_material.

    DATA lo_nd_material TYPE REF TO if_wd_context_node.

    lo_nd_material = wd_context->get_child_node( name = wd_this->wdctx_material ).


    append initial line to lt_material.


    lo_nd_material->bind_table( new_items = lt_material

    set_initial_elements = abap_true ).

    Please refer the below document for add row & delete row functionality.

    How to make table cells as editable / non-editable dynamically in Web Dynpro ABAP

    Hope this helps you.

    Regards,

    Rama

    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.