cancel
Showing results for 
Search instead for 
Did you mean: 

drop down in web dynpro abap

Former Member
0 Kudos

HI !

I have query that i have one drop down in screen, which is working fine. I have to retrieve table depends on the drop down value. The table should be displayed after the drop down value selected. Any one guide me with necessary screens and code to acheive this.

Thanks in advance

indiranjithn

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Fairly easy to do.

The drop down control has an event called 'onSelect'. Create an action and assign that event property to the created action. In the action, you can put whatever code you like.

For your problem perhaps binding the table visibility to a context attribute and then setting that attribute value to if_wdl_core=>visibility_visible or if_wdl_core=>visibility_none based on input might do the trick.

There are quite a few ways you could do this, but the most important detail for you to resolve is setting up the event handler for the drop down control.

Former Member
0 Kudos

HI

While the user clicks on the drop down then only the table should be displayed else it should not be displayed ( It should be displayed drop down only ). If we can do this in setttings, Kindly explain me where to do and what to do?

Thank you for your Quick responds.

Regards

indiranjithn

Former Member
0 Kudos

Hi Indiaran,

You want to display Table when select value from dropdown right??

Create Transparent Container and place your table in TC.

Create one attribute say VISIBILE of type WDUI_VISIBILITY and bind this attribute to Transparent containers visible property.

And in onaction of Dropdown use set_attribute.

* set single attribute
      lo_el_context->set_attribute(
           name =  `VISIBLE`
           value = '2' ).  // 2 for visible, 0 - none.

Cheers,

Kris.

Former Member
0 Kudos

hi sir,

I think this will be working, i did what you suggested me but i am getting run time error like could not find visible attribute .

I have created one attribue in component controller context but i could not drag and drop to the view context to bind that attribute.

And also tried like this i have created one node and added visible attribute and binded that attribure to Transparent container.

But no use the same dump getting. Please suggest me how to create attribute to bind in TC.

Thanks

Indiranjithn

Former Member
0 Kudos

Hi

Create attribute inView context and do binding

Cheers,

Kris.

Former Member
0 Kudos

hi

i have created attribute in view context and did binding. But the same dump could not find the attribute VISIBLE. I just debug my program it got dump while it excutes the code

context_node->set_attribute(

name = `VISIBLE`

value = '2' ). "// 2 for visible, 0 - none.

Please help me to solve this problem.

Regards

indiranjithn

Edited by: indiranjithn on Sep 9, 2011 9:36 AM

saravanan_narayanan
Active Contributor
0 Kudos

Hello Indiranjithn,

in which context node did you create the attribute. Did you create it directly under the CONTEXT node (Root node)? if so then you need to get the context element of this node and then call set_attribute


data lo_el_root type ref to if_wd_context_element.
lo_el_root = wd_context->get_element( ).
lo_el_root->set_attribute(
name = <NAME OF THE CONTEXT_ATTRIBUTE IN UPPER CASE>
value = '2' ). 2 for visible, 0 - none.

BR, Saravanan

Former Member
0 Kudos

Hi,

Create attribute under view context. attribute name 'VISIBILE' of type WDUI_VISIBILITY.

and add this code to your dropdown onaction.

DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->Element_context.
      DATA lv_visible TYPE wd_this->Element_context-visible.

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

* set single attribute
      lo_el_context->set_attribute(
           name =  `VISIBLE`
           value = '2' ). // 0 - for none

Cheers,

Kris.

Former Member
0 Kudos

hi

I just generated the code through code wizard so i got the same code. But the result is Could not find attribute VISIBLE .

Can u just suggest me the Transparant container should be binded with the attribute VISIBLE, if so i did the same . What about table properties?...

Thanks in advance

indiranjithn

Former Member
0 Kudos

hi

Thank you very much for the quick response me. I got the solution and it is working fine.

I have another doubt. How to add check box as column in table without using ALV ?

Can i continue the quries same post or need to be post as new?

Thanks in advance

indiranjithn

Former Member
0 Kudos

hi

good.

close this and post in new thread.

Cheers,

Kris.

Former Member
0 Kudos

Issue resolved and getting closed.

Answers (0)