cancel
Showing results for 
Search instead for 
Did you mean: 

Scroll bar in table web dynpro abap

Former Member
0 Kudos

Hi

How to get scroll bar option in table. If the records exceeded 5 rows then the scroll bar should be enabled else the table should be showed how many records it has. Please guide me to achieve this.

Thanks in advance

Indiranjithn

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

If table have more than 5 rec, scrollbar get automatically.

Go to application- go to parametrs tab.

in parameter give WDTABLENAVIGATION and value is - SCROLLBAR

Cheers,

Kris.

Former Member
0 Kudos

Hi

If i defined table row as 5 then the table has only 2 rows then the remaining 3 rows will be empty. Is this possible to eliminate the empty rows?.

Thanks in advance

Indiranjithn

Former Member
0 Kudos

Hi

You have to do this by coding.

create one attribute of type i.

Bind this table visiblerowcount property.

and in coding.. you have to findout total no of records in table.

for example..

data count type i.
count = LINES( lt_data).  // it_data is internal table which is binded to table.
now count contains total no of records.

  DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->Element_context.
  DATA  lv_countTYPE wd_this->Element_context-count.

* get element via lead selection
  lo_el_context = wd_context->get_element( ).

 lv_count = count.

* set single attribute
  lo_el_context->set_attribute(
    name =  `COUNT`
    value = count).

Cheers,

Kris.

Former Member
0 Kudos

HI kris,

Where should i include this code?..

Thanks in advance

Indiranjithn

farooq_basha
Active Participant
0 Kudos

Hi indrajith,

As kisnass suggested, follow the step.

Include your code in WDDOINIT method.

Regards,

Farooq

saravanan_narayanan
Active Contributor
0 Kudos

Move this logic to a separate method and call this method in the following placess

1. While populating the initial data for the table

2. while adding new records into the table.

3. while deleting records from the table

Since you want only 5 records max, then you should do the following check


 if count > 5 .
count = 5. 
endif. 

BR, Saravanan

Former Member
0 Kudos

Issue resolve so thread is closed.