Adding tab in tabstrip control dynamically..........

Hi ,
    I am using TabStrip control of PDK .NET. I want to add tab dynamically in tabstrip control.
But I am getting error for any postback when I switch in between tabs.
Error description is :
<b>"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"</b>
<b>Stack Trace:
[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index) +2382545
   SAP.Web.UI.Controls.TabCollection.get_Item(Int32 index) +6
   SAP.Web.UI.Controls.TabStrip.LoadPostData(String sPostData, NameValueCollection oPostCollection) +92
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +674
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2965</b>
Any help appreciated?
Regards,
Prashant

Hi Prashant,,
your index is less than zero, the postback will not store it unless you explicitly save it using 'enable view state' for the tree control, if it is already enabled and still not working: here is the work around :-
you can store it in a hidden input field, so that it can be retrived when you do a postback, and then reassign the current index
it should be a relatively simple fix
please let me know how you get along...
with respect,
amit

Similar Messages

  • 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

  • Tab in Tabstrip Control in display mode (Module Pool)

    Hi friends,
    I am trying to give authorization based on sy-uname, in runtime based on uname the particular tab should be opend in a display mode and some in change mode.  please help me out in this
    Edited by: shravan sonayila on Aug 12, 2008 8:06 AM

    Hi,
    when u creating tabstrip,while defining each tab in tabstrip , u have to
    create one subscreen for each tab.i think u want one tab for display
    mode and one tab for edit mode. if u want this way , in one tab try to
    give fields all in invisible mode this for display mode and goto second tab if u want all visible only keep like that only other wise u have create geoups.when u press enter ,groups will be change.it means visible , invisible modes.
    u have to give logic for screen in pbo.
    *&      Module  STATUS_0300  OUTPUT
          text
    module status_0300 output.
      set pf-status 'GUI_300'.
      set titlebar 'TITLE_300' with v_title.
      if i_aktyp = 'H'.
        if temp_flag = 1.
          loop at screen .
            if screen-group1 = 'GP2'.
              screen-input = 1.
              modify screen .
            else.
              screen-input = 0.
              modify screen.
            endif.
            temp_flag = 0.
          endloop.
        else.
          loop at screen.
            if screen-group1 = 'GP1'.
              screen-input = 1.
              modify screen.
            else.
              screen-input = 0.
              modify screen.
            endif.
            temp_flag = 1.
          endloop.
        endif.
      elseif i_aktyp = 'V'.
        loop at screen.
          if screen-group1 = 'GP1'.
            screen-input = 1.
            modify screen.
          else.
            screen-input = 0.
            modify screen.
          endif.
        endloop.
      endif.
    endmodule.                 " STATUS_0300  OUTPUT
    Try to give this logic.
    Regards,
    Ramya

  • Problem in navigatiion between Tabs in Tabstrip control

    Hi experts,
    I have an issue when working on tab strip. That is, i m having few text fields in Tab1 and a table control in Tab2. Now when i enter values in table control in Tab2 and again if i click Tab1, tab 1 is not getting displayed. Still Tab2 is displayed. Im not able to navigate between Tab1 and Tab2.
    I have written the following in the main program/
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_9000.
    module get_domain.
    call subscreen :sub1 including sy-repid '9001',
                              sub2 including sy-repid '9002'.
    PROCESS AFTER INPUT.
    call subscreen sub1.
    call subscreen sub2.
    MODULE USER_COMMAND_9000.
    Pls tell me how to solve this issue

    HI,
    Please try to use one one sub screen i.e. SUB1.
    in PBO write  : call subscreen: sub1 including sy-repid w_dynnr.
    In PAI write : call subscreen: sub1.
    and in coding.
    when 'SCR1'.
          ts101-activetab = 'SCR1'.
          clear w_dynnr.
          w_dynnr = '0102'.   " HERE 102 is normal screen. we are passing this screen to sub1
    when 'SCR2'.
          ts101-activetab = 'SCR2'.
          clear w_dynnr.
          w_dynnr = '0103'. " " HERE 103 is normal screen. we are passing this screen to sub1
    so try to create 3 screens i.e. 1 subscreen with 2 normal screens.
    Thanks,
    kat

  • Adding tabs dynamically at runtime for a tab navigator control

    Hi,
    Is it possible in flex builder 2 to dynamically add the tabs
    at runtime to the tab navigator control, if we can add plz tell the
    procedure to do that
    thanks in advance

    Given that you had a tab navigator declared in mxml like
    this:
    <mx:TabNavigator id="myTabber" selectedIndex="0">
    </mx:TabNavigator>
    you should just be able to call the addChild method, passing
    the child tab containers. So for example, in some ActionScript
    event handler:
    var newTab:Canvas = new Canvas();
    myTabber.addChild(newTab);
    bear in mind I haven't done this by adding tabs, but have
    done tons with adding controls to an application at runtime using
    this method (DataGrids, Grid, GridItems, etc...)
    Jason

  • Renaming the tabs on a tabstrip control for ME21N

    Hello SDNers,
    I am working on a screen enhancement for ME21N using user exit MM06E00.
    On ME21N a addiional tab called "Customer Data " has been added along with the standard tabstrip control.
    I wanted to rename this has "CFORM" now how do I do this.
    Please help me regarding this.
    Regards,
    Ranjith N

    Hi Nambiar,
    Go to the text symbols of Function Pool SAPLXM06 (function pool that contains the modules and includes and screens creatted using Enhancement MM06E005 ).
    Say you want to name the custom header tab (screen number 101) in PO as 'PO Header additonal data'.
    Then in the text symbols of Function Pool SAPLXM06 add '101' to "Sym" coulmn and 'PO Header additonal data' to "Text" column.
    Now after activating the text elements and the enhamcement project, if you run ME21N/ME22N/ME23N the name of the custom addtional header tab would be displaed as 'PO Header additonal data'.
    Hope this helps.
    Regards,
    Abhisek.

  • Dynamic addition of tabs to tabstrip

    hi gurus ,
    can ne1 plz tell me how can we hav dynamic tabs on the tabstrip control .
    one of the way is to have max no of tabs n making them visible n invisible .
    but wat the problem is dat the text on the tabs is also dynamic i don knw its value in advance .
    if any1 knws how to do dis then plzzz reply asap . its urgent
    pts wil b rewarded for sure ....

    1. Create program in SE38 type module pool and Activated
    2. Go to SE51 give the program name and screen number then Layout Editor in drags tabstrip with wizard.
    3. Automacaly code is generated.
    4. Subscreen(101) add the two Check Boxs (CH1,CH2).
    5. Changed the Tab1 properties on Program in Click check box <b>OUTPUT Field only</b>
    then tab text also you give Dynamic
    PROGRAM ZTAB1 .
    FUNCTION CODES FOR TABSTRIP 'TAB2'
    CONSTANTS: BEGIN OF C_TAB2,
                 TAB1 LIKE SY-UCOMM VALUE 'TAB2_FC1',
                 TAB2 LIKE SY-UCOMM VALUE 'TAB2_FC2',
                 TAB3 LIKE SY-UCOMM VALUE 'TAB2_FC3',
               END OF C_TAB2.
    DATA FOR TABSTRIP 'TAB2'
    CONTROLS:  TAB2 TYPE TABSTRIP.
    DATA:      BEGIN OF G_TAB2,
                 SUBSCREEN   LIKE SY-DYNNR,
                 PROG        LIKE SY-REPID VALUE 'ZTAB1',
                 PRESSED_TAB LIKE SY-UCOMM VALUE C_TAB2-TAB1,
               END OF G_TAB2.
    DATA:      OK_CODE LIKE SY-UCOMM.
    DATA:A(1),B(1).
    OUTPUT MODULE FOR TABSTRIP 'TAB2': SETS ACTIVE TAB
    MODULE TAB2_ACTIVE_TAB_SET OUTPUT.
      TAB2-ACTIVETAB = G_TAB2-PRESSED_TAB.
      CASE G_TAB2-PRESSED_TAB.
        WHEN C_TAB2-TAB1.
          G_TAB2-SUBSCREEN = '0101'.
        WHEN C_TAB2-TAB2.
          G_TAB2-SUBSCREEN = '0102'.
        WHEN C_TAB2-TAB3.
          G_TAB2-SUBSCREEN = '0103'.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.
    INPUT MODULE FOR TABSTRIP 'TAB2': GETS ACTIVE TAB
    MODULE TAB2_ACTIVE_TAB_GET INPUT.
      CASE OK_CODE.
        WHEN C_TAB2-TAB1.
          G_TAB2-PRESSED_TAB = C_TAB2-TAB1.
        WHEN C_TAB2-TAB2.
          G_TAB2-PRESSED_TAB = C_TAB2-TAB2.
        WHEN C_TAB2-TAB3.
          G_TAB2-PRESSED_TAB = C_TAB2-TAB3.
        WHEN OTHERS.
         DO NOTHING
      ENDCASE.
    ENDMODULE.
    <b>MAIN SCREEN 100</b>
    MODULE STATUS_0100 OUTPUT.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'TAB2_TAB2'.
       IF A = 1.
          SCREEN-ACTIVE = 1.
       ELSEIF A = 0.
          SCREEN-ACTIVE = 0.
       ENDIF.
    ENDIF.
    IF SCREEN-NAME = 'TAB2_TAB3'.
        IF B = 1.
          SCREEN-ACTIVE = 1.
        ELSEIF B = 0.
          SCREEN-ACTIVE = 0.
        ENDIF.
    ENDIF.
    MODIFY  SCREEN.
    ENDLOOP.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    <b>* SUBSCREEN 103</b>
    MODULE USER_COMMAND_0110 INPUT.
    CASE OK_CODE.
    WHEN 'CH1'.
        IF A = 0.
           A = 1.
        ELSEIF A = 1.
               A = 0.
        ENDIF.
    WHEN 'CH2'.
        IF B = 0.
           B = 1.
        ELSEIF B = 1.
               B = 0.
        ENDIF.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0110  INPUT
    Message was edited by:
            Durga Vinta

  • Tabstrip control  Tab line navigation button display issue

    I have a tabstrip that has more tabs than can be displayed at the top of the tabstrip control.  When this happens a navigation button appears on the far right of the tab line( the line that contains all the tabs).  This has been working fine for several years.  Recently I needed to increase the width of the tabstrip control so that it was 160 character wide.  Now when the tabstrip displays, the tab line stops displaying at around 130 characters so the navigation button no longer shows.  As it turns out, the button is still there and functions as normal, except that it cannot be seen even though there are still too many tabs to all be displayed. 
    This appears to me to be a bug in the tabstrip control, but before I start complaining to SAP I thought I would ask here to see if anyone else might know of a solution to this problem. 
    Thanks for looking.

    Hi,
    cresate a managed bean in viewScope within the parent page and pass it as an argument to the child task flow. The managed bean contains/exposes a method to hide the menu items you don't want to show (or just disable them). The child task flow then can call the managed bean (from its input parameter reference) and invoke the method (e.g. in a method call activity as the default activity of the task flow).
    See this blog entry for more details: http://one-size-doesnt-fit-all.blogspot.de/2010/09/master-child-btf-chaperone-contextual.html
    Frank

  • Table update problem in tabstrip control

    Hi experts.
    i have one tabstrip control having 4 tabs.
    in those tabs i am updating one table say ztable(database table).
    my problem is this is happening in pai of every tab.
    but what ever i am updateing table those changes will reflect in other tabs.
    where i have to write code like pbo or what i should do.
    what ever i am updateing in tab1 i have to see in tab2.what ever i have update i should see in tab3.
    but it is not showing the updates when we will go for other tabs.
    Thanks

    Hi,
    Please check the following things :
    1 . The Fucntion code type for each tab is blank
    2 . Same subscreen area is assigned to each tab
    3 . Corresponding subscreen is dynamically incorporated into the subscreen area CALL SUBSCREEN in the flow logic
    If you are not doing this, then you are scolling in SAP GUI, not in your program. In this case the values entered in TAB1 won't get reflected in TAB2.
    If this is the case in your program, fix the above three points. then it will work.

  • Regarding icon in tabstrip control

    Hi Friends,
       I've designed a tabstrip control with 3 tabs.In each tab, I'm populating different data in ALV format.I've used a custom container for the same.Now I've a requirement from business side that if any of the tabs is having the data, some icon should be displayed alongwith the name of the tab (may be ICON_OKAY). If there is no data in the tab, then no icon should be displayed.
    Please advise me in detail as how to do this.Is there any standard functionality or method available for the same.
    Thanks in advance!!!!!

    Hi,
    I dont think we can control icon on tabs dynamically. May be the below links will be useful to find the alternatives / solutions.
    [Tabstrip controls|http://help.sap.com/saphelp_nw04/helpdata/en/17/5bf1b52ba211d2954f0000e8353423/frameset.htm]
    [Tabstrips|http://help.sap.com/saphelp_sm32/helpdata/EN/d1/801bd2454211d189710000e8322d00/content.htm]
    http://www.sapdesignguild.org /resources/icon_cookbook/icon_cookbook.pdf
    Statically if you want to attach then you can use : Screen painter: attributes for the TAB2.
    Regards,
    ~Satya
    Edited by: Satya suresh Donepudi on Mar 28, 2009 8:31 PM

  • How can i hide a tabstrip control

    On my screen there are a pushbutton and a tabsrtip control which contain two tabs.
    initial,the tabstrip is visible,and the button with icon_collapse icon.
    then,i click the button ,and the tabstrip must be invisible,and the button's icon will change to icon_expand.
    if i use screen-name conditions to set the tab invisible,but the tabstrip has a shadow on the screen.the color of the space obtained by the tabstrip is different with other space's color.
    How can i set the color same with other if i want to hide the tabstrip.
    ths very much.

    see the example of custom tabstrip control for 0591 infotype
    MODULE ztab_strip_active_tab_set OUTPUT.
       IF  psyst-dsubt EQ 'BNPF'.
         g_ztab_strip-pressed_tab = c_ztab_strip-tab2.
         LOOP AT SCREEN.
           IF screen-group4 = '060'.
             screen-active = 0.
             MODIFY SCREEN.
           ENDIF.
         ENDLOOP.
       ELSEIF  psyst-dsubt EQ 'BNES'.
         g_ztab_strip-pressed_tab = c_ztab_strip-tab1.
         LOOP AT SCREEN.
           IF screen-group4 = '050'.
             screen-active = 0.
             MODIFY SCREEN.
           ENDIF.
         ENDLOOP.
       ENDIF.
       IF   psyst-dsubt NE 'BNPF' AND psyst-dsubt NE 'BNES'.
          LOOP AT SCREEN.
           IF screen-group4 = '050'.
             screen-active = 0.
             MODIFY SCREEN.
           ENDIF.
         ENDLOOP.
          LOOP AT SCREEN.
           IF screen-group4 = '060'.
             screen-active = 0.
             MODIFY SCREEN.
           ENDIF.
         ENDLOOP.
         g_ztab_strip-pressed_tab = ' '.
       ENDIF.
       ztab_strip-activetab = g_ztab_strip-pressed_tab.
       CASE g_ztab_strip-pressed_tab.
         WHEN c_ztab_strip-tab1.
           g_ztab_strip-subscreen = '0201'.
         WHEN c_ztab_strip-tab2.
           g_ztab_strip-subscreen = '0203'.
         WHEN OTHERS.
           g_ztab_strip-subscreen = '0202'.
       ENDCASE.
    ENDMODULE.                    "ZTAB_STRIP_ACTIVE_TAB_SET OUTPUT
    check this for hiding one tabstrip in one subtype and another in next subtype

  • How to insert tabstrip control in module pool screen painter

    Hi all!
    plz tell e how to use tabstrip control in module pool screen painter.Also plz give me an example program using tabstrip control.

    To insert tabstrip just open layout of screen and press on the tabstrip button there .
    Use this souce code further to activate it .
    CONTROLS tabstrip TYPE TABSTRIP.
    DATA: okcode TYPE sy-ucomm,
    dynnr TYPE sy-dynnr,
    flag type flag,
    active like tabstrip-activetab .
    call SCREEN 100.
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    data: lv_okcode type syucomm.
    lv_okcode = okcode.
    clear okcode.
    case lv_okcode.
    WHEN 'TAB1'.
    dynnr = '0110'.
    WHEN 'TAB2'.
    dynnr = '0120'.
    WHEN 'TAB3'.
    dynnr = '0130'.
    WHEN 'TAB4'.
    dynnr = '0140'.
    WHEN 'TAB5'.
    "check authorization, if authorization fails
    flag = 'X'. "set the global flag
    active = 'TAB1'. "store active tab in global variable
    dynnr = '0110'. "set the screen number
    WHEN 'BACK' or 'EXIT'.
    leave program.
    ENDCASE.
    IF lv_okcode(3) = 'TAB'.
    tabstrip-activetab = lv_okcode.
    ENDIF.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS 'MAIN'.
    SET TITLEBAR 'xxx'.
    IF tabstrip-activetab IS INITIAL OR
    dynnr IS INITIAL.
    tabstrip-activetab = 'TAB1'.
    dynnr = '0110'.
    ENDIF.
    "set the activetab explicilty here
    if flag eq 'X'. "from authorization failure
    tabstrip-activetab = active. "'TAB1'
    clear flag.
    endif.
    ENDMODULE. " STATUS_0100 OUTPUT

  • How to hide tabstrip Control at runtime?

    hi to all.
    i used a tabstrip control in my screen.
    i want to make my tabstrip visible or invisible based on t-code
    for my screen.
    it will be total based on t-code.
    if i will enter t-code zins11 it will show me tabstrip for screen 100.
    if i will enter t-code zins12 it will hide me tabstrip for screen 100.
    Reply me.
    thanks.

    If you don't mind seeing the blank grey Tab Strip control box and simply hiding the tabs, this code will help.
      LOOP AT SCREEN.
        IF screen-name CP 'TS_TEST1_TAB*'.
          screen-active = 0.
          modify screen.
        ENDIF.
      ENDLOOP.
    where my Tab Strip name was 'TS_TEST1

  • Query about TABSTRIP Control within Sub screen

    Hi Expert,
    I have requirement like follows:
    In IW32->Enhancement Tab screen is as subscreen and No: 0900.
    Now I want to have 2 different sub screen say 0910 and 0920 each of this for different purpose according to
    Order Type as per clients requirement.
    Actaully I have developed screen 0900 already for some order type and now clients requirement changed i.e.
    there are 2 different groups of Order types (say Grp1 and Grp2)
    So, I proposed a solution for this as follows:
    In Enhancement Tab of IW32 according to group of Order Type (either Grp1 or Grp2) only you will be able to
    see fields for that perticular Grp either of 2.
    Technical Solution is like...
    1) I thought that I will create 2 subscreens say 0910 and 0920.
    2) In 0910 i will insert all those fields which are designed already in 0900 which is for Grp1
    3) and for Grp2 i will design 0920
    4) according to Order Type only 0910 or 0920 client will be able to see.
    Now I got stuck in between the screen development for 0920 because there are so many fields and i said to
    client that they will be able to see those fields in different Tab strips.
    I never worked on Tab Strip concept, I search so many forums and sites for Lesson on Tab Strip but not
    understood how to proceed as per my specific requiment.
    Please can anyone suggest me how to proceed further.
    Thanks in advance.
    Regards,
    Jay.

    There's no reason why you couldn't do it.
    A tabstrip control is simply made of a subscreen area and a "tabstrip" above, where each tab corresponds to a button/function code. You have 2 ways to define/program it, "local" or "server", the difference being a better performance with the "local" (interesting in slow WAN).
    In ABAPDOCU demos, you have 2 programs DEMO_DYNPRO_TABSTRIP_LOCAL and DEMO_DYNPRO_TABSTRIP_SERVER.
    Sandra

  • Problem in Tabstrip Control

    Hi All,
    i had created an Custom Infotype.
    In that infotype i had created Tabstrip control with 2tabs.
    Each Tab contain 4 fields.
    When creating( F5) a record in transaction PA30, it allowing me create a record and the record is available in Data base table.
    1. My doubt is, when Display the Record through F7 and Change mode (F6), Still the fields are in editable mode. But not in Display Mode ( Editable Mode ).
    How to Disable the Fields for this Tab Strip Control. I have not used any Group Field for this. Can we need to Main tain anything.
    But SAVE option is automatically disabled.Iam not able to SAVE when i press F7 but in Editable is the My Problem.
    2. And one more query is, when press F5 or F6 or F7 it is show the following message at End screen,i.e.
    Protected tab titles are not supported (tab MENU_TABSTRIP title PUSH1) . But MENU_TABSTRIP is My Tab Strip control text Name and PUSH1 is my Tab1 , Function code.
    How to remove this message.
    Points will be rewarded.
    Thanks,
    N.L.

    Hi,
    Try this ....In the Table Control, double click on a field. In the attributes make that field as output only...
    Hope it helps,
    Swathi

Maybe you are looking for

  • Its not letting me go past the agreement

    i just got my iPod touch last weekend and ive been working on my computer trying to figure out how to get it synced with my iTunes. i had an iPod video. everytime i plug in the touch it asks to register or register later and i pressed register then i

  • Loading transparent background gif on an image

    Hello everyone! I am trying to load a transparent background gif([http://www.aoml.noaa.gov/hrd/tcfaq/graphics/animehurr.gif]) on another image (which is a map). My way is adding two JPanels, each of them will load an image as an ImageIcon, however, t

  • ISE Deployment Problem

    I have two Cisco ISE in my infrastructure with a two-node deployment. Due to some problems, the secondary node was disconnected. When was reconnected the node the license had expired. I tried to perform a resync, but the option was disabled. I tried

  • ChaRM: Cross object lock-error /warning

    Hi Team, I have confgured CSOL in Sol Man ChaRM. The CSOL is working fine. I have set the conflict scenario as "Cross-Project, Client Specific" in /TMWFLOW/CONFIG_SERVICES. And i have activated the project lock in the all the satellite systems (DEV,

  • CRM Mobile installation

    Hi. I am wondering if I can install and run CRM 5.0 on the same server as the Mobile Repository Server and the Communication Station? I need to define the landscape for the development, test and production system. Can anyone shed some light on this i