on 09-22-2009 4:22 PM
Hi All,
I have two tabs (TAB1 and TAB2) on a tabstrip. And on each of these tabs I have a table. Both tables are binded to the same context node.
The property selectedTab of the Tabstrip is binded to an attribute "TAB" of a context node "TABSTRIP".
I defined a supply function on this context node "TABSTRIP" in order to show the TAB1 by the first building up the view.
METHOD supply_tabstrip .
* local structure for the activ TAB
DATA: stru_tabstrip TYPE if_componentcontroller=>element_tabstrip.
CLEAR stru_tabstrip.
* set the default-value
* --> This is valid untill the user choose another Tab
MOVE 'TAB1' TO stru_tabstrip-tab.
* bind the filled structure to the context
node->bind_structure(
new_item = stru_tabstrip
set_initial_elements = abap_true ).
ENDMETHOD.
I also definded a supply function on the context node of the table (which is mentioned above) to fill it with content.
Now i need to define a query to fill the table with two different content and for this I need to know which tab is selected by the user. How can i find which tab is selected or which tab is active?
Thank you for any help
Best regards
Haleh
Hi,
I have a context attrinbute SELECTED to which the SelectedTab property of tabstrip is bound.
Implement action onSelect for Tabstrip - Use this code snippet -
***Variables
DATA:
lv_select_tab type string. "Selected tab value
***Structure and internal table for the Events and messages
DATA:
lt_events type WDR_EVENT_PARAMETER_LIST,
ls_events type WDR_EVENT_PARAMETER.
***Field symbols
field-symbols: <fs_value> type any. "Attribute value in events table
***Move the event table to lt_events
lt_events = wdevent->parameters.
*"Set to 'TAB' in lt_events
read table lt_events into ls_events with key name = wd_assist->GC_TAB. "TAB
if sy-subrc eq 0.
assign ls_events-value->* to <fs_value>.
if sy-subrc eq 0.
lv_select_tab = <fs_value>.
endif. "IF sy-subrc eq 0.
endif. "IF sy-subrc eq 0.
***Set the selected tab value
CALL METHOD WD_CONTEXT->SET_ATTRIBUTE
EXPORTING
VALUE = lv_select_tab
NAME = wd_assist->GC_SELECT_TAB. "Set the selected tab Id "SELECTED
**Call additional data if tab selected
if lv_select_tab eq 'TAB1'.
*/Have your code here......
else
endif.
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lekha,
thanks a lot for your prompt reply. I used your coding in the onSelect event of the tabstrip.
On this line:
read table lt_events into ls_events with key name = wd_assist->GC_TAB. "TAB
I get this syntaxerror:
Field "GC_TAB" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement.
I tried to find the right phrase but couldn't.
Would you help me please?
thanks
Haleh
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.