cancel
Showing results for 
Search instead for 
Did you mean: 

Blank Row in table control

Former Member
0 Kudos

Hi,

Could anybody tell me how to add a n number of blank lines to the table control UI element on some event. I have tried with the method CREATE_ELEMENT but its clearing the table control.

I have two nodes called "lines" and "table". "Lines" node contains attribute "Count". and this attribute is binded to inputfiled "INP".

When i click on button , based on inputfield value (INP) that many blank rows should get appended to the table control.

Can anybody advice me how can i get this ?

Can anybody send me the sample code of CREATE_METHOD if its correct approach.

Thanks and Regards

Sireesha.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos
DATA lo_nd_cn_try TYPE REF TO if_wd_context_node.
DATA ls_cn_try TYPE wd_this->element_cn_try.
DATA lt_cn_try TYPE wd_this->elements_cn_try.
lo_nd_cn_try = wd_context->get_child_node( name = wd_this->wdctx_cn_try ).

if lv is not initial.
do lv times.
clear ls_cn_try.
append ls_cn_try to lt_cn_try.
enddo.

lo_nd_cn_try->bind_table( 
  new_items            =  lt_cn_try
    set_initial_elements = abap_false ).
endif.

Here cn_try is my node binded to table.

lv is a variable which holds the value of the input field which will tell how many rows to add.

Former Member
0 Kudos

Hi Saurav,

Thanks a lot for your reply. I am very Sorry to miss one point in my first thread. With the CREATE_ELEMENT its adding the blank rows to the table control but its adding in the second page. I thought its clearing the table control entries but in fact the blank rows are getting added in the second page.

My doubt is how to add blank rows only in the first page. I have unchecked the "footerVisible" property for the table control. so when i add rows to the table i cannt see the new rows.

How to add blank rows only in the first page...?

Thanks for your help.

Regards

Sireesha.

Former Member
0 Kudos

Check out this property of Table :visibleRowCount.

Set this property as you want. You can even bind it with an Attribute of type I and decide at runtime how many rows to be visible for that tabl in one page.

Former Member
0 Kudos

Thank you saurav.

Its working fine.

Regards

Sireesha.

Answers (0)