Active tab in a tabstrip
Is it possible to manually set the active tab in a tabstrip?
Thank you,
Bogdan
Hi,
I will give u some sample code to do that
PROCESS BEFORE OUTPUT.
MODULE status_9000.
MODULE main_tab_active_tab_set.
CALL SUBSCREEN main_tab_sca
INCLUDING i_main_tab-prog i_main_tab-subscreen.
PROCESS AFTER INPUT.
MODULE user_command_9000.
MODULE main_tab_active_tab_get.
MODULE main_tab_active_tab_set.
DATA FOR TABSTRIP 'MAIN_TAB'
CONTROLS: main_tab TYPE TABSTRIP.
DATA: BEGIN OF i_main_tab,
subscreen LIKE sy-dynnr,
prog LIKE sy-repid VALUE
'ZCSVO_COGNOS_EXTRACT',
pressed_tab LIKE sy-ucomm VALUE c_main_tab-tab1,
END OF i_main_tab.
<b>MODULE main_tab_active_tab_set OUTPUT.</b>
main_tab-activetab = i_main_tab-pressed_tab.
CASE i_main_tab-pressed_tab.
WHEN c_main_tab-tab1.
To display open orders report
i_main_tab-subscreen = '9100'.
CALL METHOD o_alvgrid1->set_table_for_first_display
EXPORTING
is_variant = w_variant
i_save = c_lay
is_layout = w_layout
CHANGING
it_outtab = i_output1[]
it_fieldcatalog = i_fieldcat[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i000 WITH text-e06."Error in ALV report display
LEAVE LIST-PROCESSING.
ENDIF.
WHEN c_main_tab-tab2.
To display due for biling report
i_main_tab-subscreen = '9200'.
CALL METHOD o_alvgrid2->set_table_for_first_display
EXPORTING
is_variant = w_variant2
i_save = c_lay
is_layout = w_layout
CHANGING
it_outtab = i_output2[]
it_fieldcatalog = i_fieldcat3[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i000 WITH text-e06."Error in ALV report display
LEAVE LIST-PROCESSING.
ENDIF.
WHEN OTHERS.
DO NOTHING
ENDCASE.
ENDMODULE. " MAIN_TAB_ACTIVE_TAB_SET OUTPUT
*& Module MAIN_TAB_ACTIVE_TAB_GET INPUT
text
<b>MODULE main_tab_active_tab_get INPUT.</b>
CASE sy-ucomm.
WHEN c_main_tab-tab1.
i_main_tab-pressed_tab = c_main_tab-tab1.
WHEN c_main_tab-tab2.
i_main_tab-pressed_tab = c_main_tab-tab2.
WHEN OTHERS.
DO NOTHING
ENDCASE.
ENDMODULE. " MAIN_TAB_ACTIVE_TAB_GET INPUT
*& Module USER_COMMAND_9000 INPUT
text
<b>MODULE user_command_9000 INPUT.</b>
CASE sy-ucomm.
WHEN 'BACK'.
PERFORM exit_program.
SET SCREEN '0'.
WHEN 'EXIT' OR 'CANC'.
PERFORM exit_program.
LEAVE PROGRAM.
ENDCASE.
ENDMODULE. " USER_COMMAND_9000 INPUT
*& Module MAIN_TAB_ACTIVE_TAB_SET INPUT
text
<b>MODULE main_tab_active_tab_set INPUT.</b>
main_tab-activetab = i_main_tab-pressed_tab.
CASE i_main_tab-pressed_tab.
WHEN c_main_tab-tab1.
i_main_tab-subscreen = '9100'.
WHEN c_main_tab-tab2.
i_main_tab-subscreen = '9200'.
WHEN OTHERS.
DO NOTHING
ENDCASE.
ENDMODULE. " MAIN_TAB_ACTIVE_TAB_SET INPUT
Try this out.
Thanks & Regards,
Judith.
Similar Messages
-
Get the selected or active tab on a tabstrip to show different content
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
HalehHi,
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. -
Active tab in the tabstrip..
hi,
i created a screen with a tabstrip and 2 tabs.
code is generated automatically. I created two table controls, one for each of the subscreens for the tabs.
following code was generated:
MODULE BDATA_ACTIVE_TAB_SET.
MODULE BDATA_ACTIVE_TAB_SET OUTPUT.
BDATA-ACTIVETAB = G_BDATA-PRESSED_TAB.
CASE G_BDATA-PRESSED_TAB.
WHEN C_BDATA-TAB1.
G_BDATA-SUBSCREEN = '0125'.
WHEN C_BDATA-TAB2.
G_BDATA-SUBSCREEN = '0126'.
WHEN OTHERS.
*&SPWIZARD: DO NOTHING
ENDCASE.
ENDIF.
ENDMODULE.
It so happend that the value in G_BDATA-PRESSED_TAB.
is always the Function code of the first tab !! Isn't SAP supposed to set this variable with the function code of the tab selection by the user ??
Why is this behaving so ??
I need to somehow set this variable G_BDATA-PRESSED_TAB.
to the correct function code of the tab selected.
how to achieve this ?
thksresolved...when the tabstrip is created, in the wizard we have to choose scrolling in application server and not scrolling in sap gui !!!
thks -
Active tab in Tabstrip on Report screen
Hi.
I developed a Report which has a tabstrip on its selection screen. After user press F8 and execute the report and it writes the result. When it come back to selection screen, it always come back to first tab. I want to back to last selected tab.
I want to define the active tab. How to do that ?
thanks.
GlaucoSolved by myself.
AT SELECTION-SCREEN
IF sy-ucomm(5) = 'UCOMM'.
g_active_tab = sy-ucomm. "tabs-activetab.
g_active_dynnr = 9000.
g_active_dynnr+3(1) = sy-ucomm+5(1)."tabs-dynnr.
EXPORT ztab = g_active_tab TO MEMORY ID 'ztab'.
EXPORT zdyn = g_active_dynnr TO MEMORY ID 'zdyn'.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
IMPORT ztab = g_active_tab FROM MEMORY ID 'ztab'.
IMPORT zdyn = g_active_dynnr FROM MEMORY ID 'zdyn'.
IF g_active_tab IS NOT INITIAL.
tabs-activetab = g_active_tab.
tabs-dynnr = g_active_dynnr.
ENDIF. -
TabStrip: Know wich tab is the active tab
Hi all,
How can i know wich tab is the active tab in runtime?
Could you put a sample code?
Thanks in advance.Hi,
Create one context node with 1 attriute of type string. let's say it's name is "Active_Tab". Bind this attribute with property "selectedTab" . You must have assigned some names to all the tabls in tab strip.
At run time, when you will read this attribute, it will give you the name of currently selected tab.
Thanks
Vishal -
Determine the active tab in a selection screen
Hello,
is it possible to determine which tab is currently activated in a selection screen with several tabs?
I will include different code in different tabs. When pressing the "execute" button the program should return the active tab (as a value).
Thanks
Florian SchwaigerHi florain,
Before you can use a tabstrip control in your ABAP program, you must create a control for each control in the declaration part of your program using the following statement:
CONTROLS <ctrl> TYPE TABSTRIP.
where <ctrl> is the name of the tabstrip area on a screen in the ABAP program. The control allows the ABAP program to work with the tabstrip control. The statement declares a structure with the name <ctrl> . The only component of this structure that you need in your program is called ACTIVETAB.
Use in the PBO event
Before the screen is displayed, you use the control to set the tab page that is currently active. To do this, assign the function code of the corresponding tab title to the component ACTIVETAB:
<ctrl>-ACTIVETAB = <fcode>.
When you page at the SAPgui, you only need to do this once before the screen is displayed. This initializes the tabstrip control. The default active tab page is the first page. After this, the page activated when the user chooses a tab title is set within SAPgui.
When you page on the application server, you must assign the active page both before the screen is displayed for the first time, and each time the user pages. At the same time, you must set the required subscreen screen.
You can suppress a tab page dynamically by setting the ACTIVE field of table SCREEN to 0 for the corresponding tab title.
Use in the PAI event
In the PAI event, ACTIVETAB contains the function code of the last active tab title on the screen.
When you page in the SAPgui, this allows you to find out the page that the user can currently see. When you page at the application server, the active tab page is controlled by the ABAP program anyway.
The OK_CODE field behaves differently according to the paging method:
Paging in the SAPgui
When you page in the SAPgui, the PAI event is not triggered when the user chooses a tab title, and the OK_CODE field is not filled. The OK_CODE field is only filled by user actions in the GUI status or when the user chooses a pushbutton either outside the tabstrip control or on one of the subscreens.
Paging on the application server
If you are paging at the application server, the PAI event is triggered when the user chooses a tab title, and the OK_CODE field is filled with the corresponding function code.
To page through the tabstrip control, you must assign the function code to the ACTIVETAB component of the control:
<ctrl>-ACTIVETAB = <ok_code>.
This statement overwrites the function code of the last active tab page with that of the new tab title. At the same time, you must ensure that the correct subscreen is inserted in the subscreen area.
Otherwise, tabstrip controls are handled like normal subscrens in ABAP programs, that is, the ABAP program of a subscreen screen must contain the dialog modules called from the flow logic of the subscreen.
Examples
Tabstrip control, paging at SAPgui
REPORT DEMO_DYNPRO_TABSTRIP_LOCAL.
CONTROLS MYTABSTRIP TYPE TABSTRIP.
DATA: OK_CODE TYPE SY-UCOMM,
SAVE_OK TYPE SY-UCOMM.
MYTABSTRIP-ACTIVETAB = 'PUSH2'.
CALL SCREEN 100.
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'SCREEN_100'.
ENDMODULE.
MODULE CANCEL INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE USER_COMMAND INPUT.
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
IF SAVE_OK = 'OK'.
MESSAGE I888(SABAPDOCU) WITH 'MYTABSTRIP-ACTIVETAB ='
MYTABSTRIP-ACTIVETAB.
ENDIF.
ENDMODULE.
thanks
nagendra -
How to get active tab strip name using standard function ?
Dear all,
I have 5 Tab strip in my view, how can i know which tab strip is active during runtime ?
Best Regards
FernandHI
I hope you may be looking at this thread , hope its a similar requirement as yours
How to get the selected Tab from a TabStrip.
Thanks -
Changing activ tab with button click
Hello,
I have a tabstrip with several tabs. On Tab2 I have a list of invoices. If the user clicks on the copy button I want to copy several fields into a form on tab1. That is working well. I also want to change the activ tab from Tab2 to Tab1 so that the user is facing the formular but I do not know how to do it.
regards
stefanHi Stefan,
There is property for TabStrip UI element "selectedTab" (http://help.sap.com/saphelp_nw2004s/helpdata/en/f0/e5a8411fdbcc46e10000000a155106/frameset.htm). Bind it to context attibute and change in action handler accordingly.
Best regards, Maksim Rashchynski. -
When I click on the tab with a + on it, located next to the active tab a new page does not open. If I click on "New Tab" in the File menu a new tab does not open.
Hi jcatx2013, we don't really have enough information on your system to make specific suggestions...
Could you test in Firefox's Safe Mode? That's a standard diagnostic tool to bypass interference by extensions (and some custom settings). More info: [[Troubleshoot Firefox issues using Safe Mode]].
You can restart Firefox in Safe Mode using
Help > Restart with Add-ons Disabled
In the dialog, click "Start in Safe Mode" (''not'' Reset)
Any difference? -
The only URL that I ever see in the location bar is the last one I typed there. No matter which tab I activate, the last typed URL is displayed. When I need to copy the URL of an active tab to paste into an email or something I can't see it.
The location bar used to display the URL of each active tab and you could simply click in the address field and the URL would be highlighted so you could edit/copy it or jump to the end of a very long URL to see the final file name.
I can't get this feature to work and I really need this feature as I need to copy URL's quite often. When I have multiple tabs active I sometimes forget which one is for which domain and need to see the URL. It is very annoying to surf blind.
Please help me with this issue as quickly as possible so I can once again do my work easily and with the firefox browser instead of chrome. :(A couple of possible causes.
The first is the file that stores details of browsing history and bookmarks is corrupt. For details on how to fix that see http://kb.mozillazine.org/Locked_or_damaged_places.sqlite
Another possible cause is an add-on interfering with the location bar. To test this, use the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes -
Error while creating activities from Account application (Activity tab page
Hi Experts,
We are using CRM 5.0 with PCUI ( EP 7.0 version). We are getting below error when try to create activities from Account application in PCUI ( from activity tab page):
Error : Activity contains error.
Diagnosis
This transaction has errors.
Procedure
To correct the errors, go to the maintenance interface of the transaction.
To navigate to there, use the link to the account application
Pls suggest how to proceed with this error & helpful solutions would be rewrded generously.
Regards,
Basavaraj PatilHi Experts,
We are getting this error when try to create Activity from Account application in PCUI. But the same thing is working fine in at GUI level & actions profile assigned to Activity transaction is also working fine at GUI level. But in PCUIit is throwing this below error.
Diagnosis
You have attempted to create a follow-up transaction for an incorrect transction 2000764. This is not possible. You can only create follow-up transactions for error-free transactions.
System Response
The follow-up transaction is not created.
Procedure
Correct the errors in the source transaction 2000764. The error messages resulting from processing the error can be read in the application log in the source transaction.
Pls suggest solution for this.
Thanks in Advance.
Regards,
Basavaraj Patil -
<blockquote>Locking duplicate thread.<br>
Please continue here: [/questions/819008]</blockquote><br>
I don't know if it's a glith with mine, a change in the software, or a setting that isn't set, but my tabs don't have an "x" to close them.
Also, my previous version of Firefox opened a new tab adjacent to the active tab. Version 4.0.1 seems to have returned to the older standard of opening tabs at the end of the list. Is there a way to switch where new tabs open?You can reset the tab prefs on the about:config page in case they have been changed.
* browser.tabs.insertRelatedAfterCurrent
* browser.tabs.closeButtons
If you want a close X on the first tab if only one tab is open then set browser.tabs.closeWindowWithLastTab to false.
* http://kb.mozillazine.org/about:config
* http://kb.mozillazine.org/Resetting_preferences
If you have tab related extensions then check their settings (Options).
* Tools > Add-ons > Extensions -
How to change the text for the tabs of a tabstrip control dynamically
Hi Guys,
I am having two screens in a transaction.
1. 1st screen has material number as an input and submit push button
2. 2nd screen has two tabs in a tabstrip control.
I want to display material description and plant number as heading for the two tabs based on the material number entered by the user in the 1st screen. Means i want to change the text dynamically. Is there any possible way? If it is there please help me. Very urgent...
Thanks in advance
James.Hi,
If you set the "Output field" attribute for a pushbutton/tab, you can also set its text dynamically in the ABAP program. To do this, you must create a field in the ABAP program with the same name as the pushbutton/tab. You must then assign the required text to the field before the screen is displayed.
For example define a global field in your program called MATNUM(20) and use this as the name for the material number tab on the tabstrip. Then you can assign a text MATNUM = 'Material Number' and this will appear as the tab title. Don;t forget to set the "Output field" attribute on the tab.
Hope it helps -
I want to display a url link in only one tab of the tabstrip in webdynpro ?
I want to display a url link in only one tab of the tabstrip in webdynpro view? How do we do this?
so in that tab of the tabstrip use LinkToUrl UI
The LinkToURL UI element is a hypertext link. When you choose this link, you are directed to a user-defined Web resource (URL).
The LinkToUrl is used to exclusively to open URLs in a separate window. To leave the Web Dynpro application and display a new URL use an exit plug.
1.in ur UI create tabs as u desire
2. In each TAB , add ViewContainer . ViewContainer you would be able to add inside tab.
3. Now create as many views as you have created Tabs.
4. Embed views into the corresponding ViewContainers , in ur first view embed link to URL
refer SAP online help for tabstrip :
http://help.sap.com/saphelp_erp2005/helpdata/EN/e8/ac884118aa1709e10000000a155106/content.htm -
How to Make the label of the active tab-page BOLD?
Hi All
I am working on forms 10g(version 10.1.2.0.2 ) with Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 on windows 2000 platform.
My requirement is to make the label of the active tab-page either in italics or with a different color or make it BOLD than the other pages of the canvas.
Any suggestions ?
Regards
Mohanthere are no properties for those requirements on tab-pages. You can't do it.
Setting italic for all Tabpage-Labels is possible, when you change it in the canvas-properties. But you can't change only one tabpage.
One Solution is, what Jeneesh said: Active-Style. But only "Bold" and for the active tab.
Gerd
Maybe you are looking for
-
Open Sales Order Migration - LSMW (Guide)
Hello I search for some guide how to migrate with LSMW open orders. I have earlier migrated with LSMW other data, but not open sales orders. Should I use Batch or BAPI? If BAPI, which Methode and Bisness-Object use? Can someone send me instruction
-
Has anyone tried to use the Java Plug-in 1.3.1 with IE 6 on Win 2000 or Win XP? If so, does it still work. I'm wondering whether Sun is gonna have to make it's plugin an ActiveX component like Apple had to with its Quicktime plugin.
-
FileAdapter write mode - Dynamic filename, write down simple text structure
Hi, I tried to use the FileAdapter in a BPEL Process to write down and existing structure as String, comming from Database (CLOB), which has a defined structure. My first problem is, that I assign an output filename through the output message header
-
Exception-handling in a block (integration process)
Hi, I have created an error handling in a block, but I want to send the information of the exception from xi to our software clix that is connected to xi via jms adapter. Is it possible?? I'm new in XI, so can you give my a detailed hint? Thanks for
-
When attempting to download the Firefox browser, I click on the big green button to download, then I am taken to the next page which says it should begin in a few seconds. Nothing happens. I click where it says to click if nothing happens and nothing