Scenario on displaying listbox (Multiple selections) using WebDynpro for ABAP

By Twinkal Patel, Yash Technologies

Scenario:

To create a Web DynPro application with a List Box (Multiple selections).

Steps :

1.       Go to transaction SE80.

2.        Select “WebDynpro Comp./Intf” from the list.

3.       Create a new WebDynpro component by the name ZWD_LISTBOX.

4.       Double-click on the View. Select Context Tab.

5.       Create a NODE as shown below.

 

6.      Create an attribute ID as shown below:

7.   Create another node SFLIGHT like below.

Select components from structure

8.Select AIRLINE node as below and double click on FILL_LIST supply function.

.

Here code will be generated automatically just uncomment following code and add select query like below.

method fill_list .
** data declaration
  data lt_airline type wd_this->elements_airline.
data ls_airline like line of lt_airline.
select distinct carrid 
           from sflight 
     into table lt_airline.
* @TODO compute values
* e.g. call a data providing FuBa
* bind all the elements
  node->bind_table(
    new_items            =  lt_airline
    set_initial_elements = abap_true ).
*
endmethod.

9. Double click on View. We would be designing the screen of our application with the following elements:

  1. ITEMLISTBOX
  2. BUTTON
  3. TABLE

10.  Right click on ROOTUIELEMENTCONTAINER create element ITEMLISTBOX.

Set element ITEMLISTBOX’s Property as below:

Multiple Selections: Checked.

Bind DATASOURCE property of ITEMLISTBOX with AIRLINE node.

Bind TEXT property of ITEMLISTBOX with ID attribute of AIRLINE node.

Click here to continue....

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image