on 07-04-2016 12:45 PM
Hi,
I have 2 windows. Window1 has ALV table with one of its fields having user name in the form of buttons. Once this button is clicked there will be a pop up (from Window 2) with list of user names. The user can choose any user name. Once he chooses the user name from Window 2, the same name must appear as button text in Window 1. As of now I get the index of the line which the user clicked in Window 1 and also the pop up with the user name list in Window 2. But the button text does not change.
I do not know how to achieve the change of button text for the index i have. Please help.
Hi Deepak,
You can use the Index of the selected element to read the text of user name from the context:
data: l_node type ref to IF_WD_CONTEXT_NODE,
l_element type ref to IF_WD_CONTEXT_ELEMENT,
l_my_string type string.
l_node = wd_context->get_child_node( wd_this->wdctx_node_1 ).
l_element = l_node->get_element( 2 ).
l_element->get_attribute(
exporting name = 'ATTR1_1'
importing value = l_my_string ).
"l_my_string" will have the user name string. Then you can dynamically set the button text to this element or you can bind the Text property of the button to a Context Attribute and modify this attribute after the user selects a element from the second window.
Regards,
Felipe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepak,
You can create a Context Attribute, named 'MY_CXT_ATTRIBUTE' of cardinality 1..1 with type STRING and bind it to Text property of the Button UI element. Then, after you get the text selected by user, just access this context attribute and modify it to the value selected by the user:
data: l_node type ref to IF_WD_CONTEXT_NODE,
l_my_string type string.
l_node = wd_context->get_child_node( wd_this->wdctx_node_1 ).
l_node->SET_ATTRIBUTE(
EXPORTING
NAME = 'MY_CXT_ATTRIBUTE'
VALUE = l_my_string ).
Regards,
Felipe
Hi,
Why don't you read the selected value and set it back to the window1 value as required.
Hope this helps you.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi KH,
Thankyou for the response. Reading and setting the value works for input fields because once we modify bind the whole table, the changes will be visible. But when the button text has to be changed, the binding property does not work as expected.
CALL METHOD lo_column->set_cell_editor
EXPORTING
value = lo_button.
The above code changes all the button text instead of a particular row where i want to see the change.
Thanks,
Deepak M S
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.