on 06-02-2016 10:43 AM
Hi,
i am new in WebDynpro ABAP.
I want to change the Output from an ALV which is specified on an selection by the Dropdown.
For Example:
DropdownList containing values like value1, value2...
For value1 the Output for the ALV will be temp1.
For value2 the Output for the ALV will be temp2
Method temp1.
DATA: lo_nd_temp1 TYPE REF TO if_wd_context_node,
lo_el_temp1 TYPE REF TO if_wd_context_element,
ls_temp1 TYPE wd_this->element_template,
lt_temp1 TYPE wd_this->elements_template,
...Code for filling lt_example
lo_el_temp1 = lo_nd_temp1->create_element( ).
lo_nd_temp1->bind_table( new_items = lt_temp1_).
Method temp2.
*The same like temp1 with different contant in it_temp1.
Method onaction.
lo_el_dropdownbykey->get_attribute(
EXPORTING
name = 'KEY'
IMPORTING
value = lv_value ).
CASE lv_value.
WHEN 'value1'.
*Show Content it_temp1.
WHEN 'value2'.
*Show Content it_temp2.
WHEN OTHERS.
Do I Need two different ALV like ALV_temp1 and ALV_temp2 or can i modify the displayed Content for one ALV?
Hi David Ka,
In your case only one context node is required.
while coming to your question, different method- what it means, whether you are talking about the method in view level or assistance class level.
If it is view level, you can access the method with view reference in Attributes tab.
If it is assistance class level, you can easily access the method with wd_assist.
Thanks
Ananda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David Ka,
Hope you got the clear idea. If yes,close the thread.
Thanks
Ananda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
At least I have used one alv bind with one context node were I change the Content in a seperate Methods and call it between the case - when - Statement. Thank you for your replies.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I guess the main question would be what is the structure - columns - in value1, and value2.
If they have the same structure, then you can use the same ALV with no big issues.
If they have different structures, then i guess you have two options:
a) Have two ALVs, and control the visibility of them (show/hide)
b) create a dynamic ALV with SALV_WD_TABLE and the structure definition based on the dropdown value, each time you change the dropdown value you reneder a new ALV.
Regards,
Michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried to search for an Event like onselect...I find the Eventhandler Method from the ALV.
But I don't now how and if this solves my Problem.
I think it is something with the bindings of the context nodes. It isn't possible to bind 2 context nodes to the DATA node of an ALV.
So I created 2 context nodes for each choose of Dropdown and 2 ALV that I bind to each context node.
Hi David,
David Ka wrote:
I have tried to search for an Event like onselect...I find the Eventhandler Method from the ALV.
But I don't now how and if this solves my Problem.
I think it is something with the bindings of the context nodes. It isn't possible to bind 2 context nodes to the DATA node of an ALV.
So I created 2 context nodes for each choose of Dropdown and 2 ALV that I bind to each context node.
I believe the OnSelect event mentioned here is not on the ALV, but on the DropDown element.
Regards,
Felipe
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.