‎2007 Mar 13 1:22 PM
Hi people,
I'm creating a dialog program that has a tabstrip with a set of 4 tabs, which (excepting the last one in the right side, which remains active permanently) must activate or deactivate given some conditions (values exist on internal tables).
My problem is, when activating the first tab in the Tabstrip (the one on the left side), the screen <a href="http://img246.imageshack.us/img246/1640/26008729du2.jpg">appears like this</a> ("Cuenta de Mayor" is the tab that never deactivates, the activated tab is behind it).
Once selected, <a href="http://img155.imageshack.us/img155/2429/75553586xs2.jpg">it returns to normal status</a>. Is there a solution to this <u>other than getting the tab that never deactivates as first in the Screen painter, or selecting the first tab programatically once activated</u> (i've tried the first of this solutions and it solves the problem but i'd rather prefer a better solution)?
This is my code to activate or deactivate tabs (in PBO of main screen 100 which has the tabstrip control with a subscreen area inside it):
MODULE m_estado_tabs OUTPUT.
LOOP AT SCREEN.
IF screen-name EQ 'TAB_SER' OR
screen-name EQ 'TAB_UNI' OR
screen-name EQ 'TAB_REP'.
CASE screen-name.
WHEN 'TAB_SER'.
READ TABLE i_datospedidos WITH KEY kalsm = k_esq_ser.
WHEN 'TAB_UNI'.
READ TABLE i_datospedidos WITH KEY kalsm = k_esq_uni.
WHEN 'TAB_REP'.
READ TABLE i_datospedidos WITH KEY kalsm = k_esq_rep.
ENDCASE.
IF sy-subrc = 0.
screen-invisible = 0. " Hay pedido: Activar tab
ELSE.
screen-invisible = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE. " m_estado_tabs OUTPUT
Thank you very much in advance for any help.
‎2007 Mar 13 3:38 PM
hi,
i didn't understand your problem exactly,
but you can use <tabstrip controlname>-ACTIVETAB = <tabname>.
for ex:MYTABSTRIP-ACTIVETAB = 'PUSH2'.
in my example, push2 means 2nd tab is active by default.
in that way u can activate whatever tab you want but at anytime either of the tab shud and will be active.
Regards,
‎2007 Mar 13 3:38 PM
hi,
i didn't understand your problem exactly,
but you can use <tabstrip controlname>-ACTIVETAB = <tabname>.
for ex:MYTABSTRIP-ACTIVETAB = 'PUSH2'.
in my example, push2 means 2nd tab is active by default.
in that way u can activate whatever tab you want but at anytime either of the tab shud and will be active.
Regards,
‎2007 Mar 13 3:49 PM
Hi sowjanya s,
I understand what you suggest. That would be my second alternative solution, quoting myself: "Is there a solution to this other than getting the tab that never deactivates as first in the Screen painter, <b>or selecting the first tab programatically once activated</b>"
What i want is to them to appear or dissapear regardless of which the active tab is at the moment, maybe i've been confusing in saying activate /deactivate, i'd rather say showing / hiding.
This is working now as it is but the problem is when showing the first tab, since it gets showed behind the other tabs as you can see in the first screen.
Any other suggestions? Many thanks to you anyways, i'm awarding points.
<b>UPDATE: it happens whatever the showed tabs is/are, it doesn't necesarily has to be the first one.</b>
To be more precise in explaining the problem: When setting any tab visible, the tabstrip shows <a href="http://img246.imageshack.us/img246/1640/26008729du2.jpg">like this</a>. I need it to be <a href="http://img155.imageshack.us/img155/2429/75553586xs2.jpg">like this</a> but without setting "Gastos Serie" as active.
I don't even know if that's possible, or if this is the normal, expected and unique tabstrip behaviour.
Closing thread: I've solved because I had to put an aditional fixed tab as the first.
‎2007 Aug 13 4:51 AM
I realise you've marked this as solved, but I was curious - when I have wanted tabs to disappear, I have used something like:
firstly, to ensure the tab I want is at the "front":
gtab_9999_01-activetab = g_gtab_9999-pressed_tab.and the following to make the unwanted tab disappear - notice the "active = '0'" as well as the invisibility indicator set.
if sy-uname = 'ABC123'.
loop at screen.
if screen-name = 'GS_9999_TS-TAB_06'. "
screen-active = gc_screen_off. "prevent it displaying
screen-invisible = gc_screen_on.
modify screen.
endif.
endloop.
endif.Did this not give the result you wanted?