cancel
Showing results for 
Search instead for 
Did you mean: 

Any ACTION possible while doing tab selections ?

Former Member
0 Kudos

Hi,

I have a view with tabstrip and multiple tabs associated with it. I wish to call an function module while an tab is getting selected and the table within it needs to be populated with records. But, i donot find an ACTION while a tab is getting selected. Can someone please help me on this ? sorry, if i would had missed the solution in some other thread or if it is so simple to be identified.

Thanks & Regards,

Gaurav.

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi,

There is an OnSelect event assocaited with every tab. You can call any FM in the event handler of this event. Refer this online help: http://help.sap.com/saphelp_nw70ehp1/helpdata/en/e8/ac884118aa1709e10000000a155106/content.htm Also refer the standard component WDR_TEST_EVENTS.

Regards

Arjun

Answers (2)

Answers (2)

Former Member
0 Kudos

We have the onSelect event for tabstrip.

Check this [https://help.sap.com/saphelp_nw70/helpdata/EN/e8/ac884118aa1709e10000000a155106/content.htm]

Former Member
0 Kudos

HI,

There is an event associate with the tabstrip for tab selection. Impelement that event and get the parameters.

On selected_tab is there the property that you need to get.

Check out this code -

Create a context attribute select_tab as stirng and bind it to the selected_tab property of the tabe strip.

Impelement the action OnSelect to get the selected tab.

***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 = 'TABSTRIPID'.
  if sy-subrc eq 0.
    assign ls_events-value->* to <fs_value>.         
    if sy-subrc eq 0.
      lv_select_tab = <fs_value>.                    "Tab selected
    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  = `SELECT_TAB`.  "Set the selected tab Id

**Call additional data if tab selected
  if lv_select_tab eq 'TAB1'.

elseif v_select_tab eq 'TAB2'. 

endif. .

Regards,

Lekha