Skip to Content

Adding Empty row to table

Hi All

In my requirement, when user click on add button i want to add empty rec as first record, then user enters data and save. i wrote some code for this. record is adding after last record in the table. how to add at first?? any help.

Thanks

kris.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 20, 2010 at 07:08 AM

    Hi ,

    Please create a blank structure of type your table and insert the structure into the internal table that is binded to context at index 1. For more details please see the code below,

    node = wd_context->get_child_node( name = wd_This->wdctx_n_sflight ).

    node->get_static_attributes_Table(

    IMPORTING

    table = itab ).

    INSERT ls_Sfl into itab index 1. " ls_Sfl is the structure or line that is being inserted.

    node->bind_table( itab ).

    With Regards,

    Shridhar

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 20, 2010 at 05:00 AM

    Hi,

    Can u post the way you followed to add a new row at the end??

    Aditya.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Krishna Reddy B

      Hi,

      The bind_structure() method has a paramater called index , try giving a value of 1(or 0..not sure) to that and check.

      Aditya.

  • avatar image
    Former Member
    Sep 20, 2010 at 05:01 AM

    HI,

    Check this thread:

    Adding/delete/copy a row in table in web dynpro

    While binding a new element to the context, make sure that index parameter is passed as 0 ( With the standard value 0 the new element is added as the first element ).

    Regards

    Manas Dua

    Add comment
    10|10000 characters needed characters exceeded