Web Dynpro Tree in the Component Controller

Hi!!!
I made a tree in the view. But to separating the view and the model I would like to create the tree in the component controller. Therefor I copy the code from the view to the controller and adapt them, but it doesn`t work. I get the first node and that`s it. I can`t add children, although I called the responsible method.
Some ideas????
Greets
Roman

Check your mapping between view & controller (actually, view controller & custom / interface / component controller) -- it seems that you have mapped only top-level node but not children.
VS

Similar Messages

  • Assistance class not instantiated in the component controller of an ABAP WD

    I have a very weird problem when trying to launch an ABAP webdynpro I get a short dump, looking into it the assitance class does not get instantiated properly so it falls over.  It used to work, but I don't think I have substantially changed anything with the assitance class just on the layout, although something must have changed.
    In the constructor of the component controller it trys to cast (I think that is the correct term)  the assistance class from the compoent controller as below, Me->f_Alter_Ego->assistance_class is initial so that fails, it then tries to create the assistance class and falls over on create object Me->f_Assist.
      try.
        Me->f_Assist ?= Me->f_Alter_Ego->assistance_class.
      catch cx_sy_move_cast_error.    "#EC NO_HANDLER
      endtry.
      if not Me->f_Assist is bound.
        create object Me->f_Assist.
      endif.
    Extract from the short dump below.
    What happened?
        Error in the ABAP Application Program
        The current ABAP program "/1BCWDY/4LYS0NWZ8L8ENKKA93YQ==CP" had to be
         terminated because it has
        come across a statement that unfortunately cannot be executed.
        The following syntax error occurred in program
         "ZCL_WD_USER_MAINT=============CP " in include
         "ZCL_WD_USER_MAINT=============CM004 " in
        line 7:
        "You can only use "class=>method" with static methods."
    Other ABAP web dynpros in our system are fine.
    I have tried the obvious stuff like removing the assitance class from the WD component and putting it back in again.
    There is obviously somehting I am missing can anyone point me in the right direction or has experienced this before?
    Thanks,
    Tim

    Thanks Thomas,
    I could not see the wood for the trees on that one, I had syntax checked the assitance class ZCL_WD_USER_MAINT, however, that error would have been raised at runtime.
    Anyway all sorted now.
    Cheers,
    Tim

  • Restrict simultaneous login to a web dynpro application by the same user

    I have a stand alone web dynpro application and used the sap.authentication for user to login into the application. How can i restrict a user from accessing the application from two different browsers using the same userid?

    Hi,
       You can try the following approach:
    1. Create an outbound plug to some dummy view which shows the message to the user that he/she is already logged in. Let's call this plug "ToMessageView".
    2. In the "wdDoInit" method of the component controller write the following code:
    String loggedInUserID = WDClientUser.getLoggedInClientUser().getClientUserID();
    String[] apps = WDServerState.getActualApplications(loggedInUserID);
    //All entries of apps will look like <application-name>/<application-id>
    boolean isRunningParallely = false;
    for (String app : apps) {
         if(app.split("/")[0].equals(wdComponentAPI.getApplication().getName())){
              isRunningParallely = true;
              break;
    if(isRunningParallely)
    //fire the plug to message view here
    FYI, I haven't tested this but do try it out.
    Regards,
    Satyajit

  • Reference to the component controller in the window

    Hello All,
    Can we get the reference of the component controller in the method of the window..
    Warm Regards,
    Smita

    Vinod..hard luck ...!!!...
    This is what i get..!!!...The interface IF_POWL_TABLE has no such method to retrieve the reference for the component controller...:-(....
    Web Dynpro Comp. / Intf. POWL_TABLE_COMP,Web Dynpro Window POWL_TABLE
    Pre-Exit PST46K50FS40BKOKLYAGE0SR3P6M for HANDLEDEFAULT
    Method "GET_COMPONENTCONTROLLER_CTR" is unknown or PROTECTED or
    PRIVATE.
    Web Dynpro Comp. / Intf. POWL_TABLE_COMP,Web Dynpro Window POWL_TABLE
    Pre-Exit PST46K50FS40BKOKLYAGE0SR3P6M for HANDLEDEFAULT
    Method "GET_COMPONENTCONTROLLER" is unknown or PROTECTED or
    PRIVATE.
    Web Dynpro Comp. / Intf. POWL_TABLE_COMP,Web Dynpro Window POWL_TABLE
    Pre-Exit PST46K50FS40BKOKLYAGE0SR3P6M for HANDLEDEFAULT
    Method "GET_COMPONENTCONTROLLE_CTR" is unknown or PROTECTED or
    PRIVATE.

  • NW2004s: Assigning a custom theme to a web dynpro running in the portal

    The situation is as follows:
    Some web-dynpros (for java) have a custom theme, a theme which is <b>not</b> the default theme of the portal or  the default theme for web-dynpros in general.
    In NW2004 this worked as follows:
    When starting a web-dynpro in the portal it checked if it was started with the right theme. If <b>not</b> the exit plug of the WD interface view was called with an Url of the WD application plus a parameter for the right theme.
    This is the famous parameter sap-cssurl.
    For that parameter there are some values possible:
    1) sap-cssurl=http://<host>:<port>/irj/portalapps/com.sap.portal.design.urdesigndata/themes/portal/mytheme
    2) sap-cssurl=http://<host>:<port>/irj/portalapps/com.sap.portal.design.portaldesigndata/themes/portal/mytheme
    3) sap-cssurl=http://<portal>:<host>/webdynpro/resources/sap.com/tcwddispwda/global/SSR/themes/mytheme
    The first 2 are locations of the portal environment, the last one is a location of the WD runtime environment.
    As I noticed this must be a full qualified absolute Url including host and port.
    This works in NW2004 for web dynpro's running standalone <b>AND</b> in the portal.
    Now for NW2004s:
    The 3 variants of the parameter sap-cssurl work for web dynpro's running standalone.
    But now for web dynpro's which are integrated in the portal:
    The exit-plug with an Url is not possible anymore, this leads to the runtime error:
    <i>com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Exit-Plug must no be triggered with an URL when running in portal. Use portal navigation instead to navigate to another application!</i>
    Okay, as a first workaround I tried the portal navigation,
    but somehow the supplied parameter sap-cssurl has no effect.
    The code for that in the on-startup plug of the WD component:
    WDPortalNavigation.navigateAbsolute(
      PCD_ID,
      WDPortalNavigationMode.SHOW_INPLACE,
      null,
      null,
      WDPortalNavigationHistoryMode.NO_HISTORY,
      null,
      null,
      "theme_set=X&" + theme,
       theme,
       false,
       true
    I used there absolute portal navigation and the  parameter (sap-cssurl=...) is part of the <b>launcher parameter</b> and the <b>business parameter</b> in the call to <b>WDPortalNavigation.navigateAbsolute</b>.
    But as I wrote above, this has no effect on the theme.
    In the I-View the parameter "Supply portal theme" is set to <b>NO</b>, otherwise the parameter "sap-cssurl" is supplied twice (this can be seen in the poroperties of the web-page in Internet Explorer).
    What I tried afterwards was setting the parameter sap-cssurl hardcoded in the "Application parameters" of the I-View. This doesn't work either.
    My question is: Should this be anyway possible for a NW2004s portal?
    Did anyone successfully implement this?
    Kind regards,
                Erich Lind

    Hi Erich,
    I am facing the same problem. I am on 04 s and couldnot implement the custom theme to a web dynpro running in the portal. When I run the web dynpro app as stand alone, the custom theme applies fine. But when in portal, it takes the standard theme.
    Was wondering if you figured this out.
    Thanks

  • Problems with tutorial: "Creating a Web Dynpro Tree"

    Hi!
    I'm a rookie and therefore I'm practicing on compleating some tutorials like "Creating a Web Dynpro Tree" (https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0ec6622-8da5-2a10-349b-868b6a553efa)
    I did just as the tutorial told me to (I think) but still I get a java.lang.NullPointerException when I deploy and run my application.
    In the bold line is where it is something wrong:
    public static void wdDoModifyView(IPrivateTreeView wdThis, IPrivateTreeView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
        //@@begin wdDoModifyView
           if (firstTime) {
                IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TreeNodeType");
                /* parameter mapping from parameter "path" to
    parameter "selectedElement"
                treeNode._mappingOfOnAction()._addSourceMapping("path", "selectedElement");
                /* parameter mapping from parameter "path" to
    parameter "element".
                treeNode._mappingOfOnLoadChildren()._addSourceMapping("path","element");
        //@@end
    What I don't understand is what the function/meaning of the parameter path is. The parameters selectedElement and element I do recognize and have written. And I don't understand why there is a difference between the two underscored line of code (see above) even though the comments claim that it does the same kind of mapping.
    Best regards
    /Johan

    I tried to get "addSourceMapping()." underscored so people would better understand what I was referring to but it didn't work and that's why it looked weired.
    Thanks for your help Armin, now it works fine.
    It was as you said.
    if (firstTime) {
    IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TreeNodeType");
    When I changed "TreeNodeType" to it's real ID, "TheNode" I didn't get a nullPointerException. I think it must be wrong in the tutorial because I followed the instructions which said to name it "TheNode" but then the author mus have forgot to change it from the default ID ("TreeNodeType").
    Best Regards!
    /Johan

  • Web Dynpro Tree expanding

    Hi there!
    I am using the tree element in web dynpro.
    Not the tree in the table.
    I need to expand a part of the tree during loading
    I do not find an example.
    Any help is warmly appreciated.
    Thanks in advance, Frank

    Hi,
    the "dynamic" tree expansion depends on who you populate the tree content e.g. how you load the data to your tree.
    In my application, I have choosen to load the root nodes, first - all over sub-nodes (including items) are loaded "on demand" that means the user clicks on the node. This click will trigger the the action onLoadChildren which pulls the data from a data provider and binds the retrieved data to the corresponding
    context node.
    This expansion can be perfomed automatically by a recursive method which is called when a user pushes a button called "Expand all"....
    I don't have much time to explain the details, but I will provided the source code..., hope it helps!
    Darko
    Source Code -
    Import to the Method:
    i_node_ref type IF_WD_CONTEXT_NODE = Reference to the context node
    METHOD nav_tree_expand_all.
    Data declaration
      DATA node_elements TYPE wdr_context_element_set.
      DATA node_element  LIKE LINE OF node_elements.
      DATA child_node    TYPE REF TO if_wd_context_node.
      DATA ls_tree_attr  TYPE zlm_str_tree_gen.
      DATA lt_tree       TYPE zlm_tty_tree_gen.
    Get all node elements
      node_elements = i_node_ref->get_elements( ).
    Loop over each element
      LOOP AT node_elements INTO node_element.
        " Get Static attributes
        node_element->get_static_attributes( IMPORTING static_attributes = ls_tree_attr ).
        " Check if data has already been loaded
        IF ls_tree_attr-children_loaded = abap_true.
          " now we know that the data has been loaded, only the elements have to be declared as expanded
          ls_tree_attr-is_expanded = abap_true.
          node_element->set_static_attributes( EXPORTING static_attributes = ls_tree_attr ).
          " get possible other nodes recursively
          child_node = node_element->get_child_node( 'SUBTREE' ).
          me->nav_tree_expand_all( EXPORTING i_node_ref      = child_node
                                             i_screen_id     = i_screen_id
                                             i_component_id  = i_component_id ).
        ELSE.
          " data has not been loaded yet...
          " First load the nodes...
         clear lt_tree.
          me->get_nav_tree_nodes( .....importing lt_tree.). Custom specific data retrieval
          IF lt_tree IS NOT INITIAL.
            child_node = node_element->get_child_node( 'SUBTREE' ).
            child_node->bind_table( lt_tree ).
            " Update Attributes of the node
            ls_tree_attr-is_expanded     = abap_true.
            ls_tree_attr-children_loaded = abap_true.
            node_element->set_static_attributes( EXPORTING static_attributes = ls_tree_attr ).
            " Call the method again recursively...
            me->nav_tree_expand_all( EXPORTING i_node_ref      = child_node
                                               i_screen_id     = i_screen_id
                                               i_component_id  = i_component_id ).
          ENDIF.
          " ... then load the items
          CLEAR lt_tree.
          me->get_nav_tree_items( .....importing lt_tree.).  Custom specific data retrieval
          IF lt_tree IS NOT INITIAL.
            " Update Attributes of the node
            ls_tree_attr-is_expanded     = abap_true.
            ls_tree_attr-children_loaded = abap_true.
            node_element->set_static_attributes( EXPORTING static_attributes = ls_tree_attr ).
            child_node = node_element->get_child_node( 'ITEM' ).
            child_node->bind_table( lt_tree ).
          ENDIF.
        ENDIF.
      ENDLOOP.
      RETURN.
    Edited by: Darko Mocelj on May 7, 2008 8:57 PM

  • Calling a method in the view controller from the component controller

    Hi
    Is there anyway to call a method in the view implementation from the component controller??
    Thanks
    jack

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • How-to add a custom Web Dynpro iView to the MSS Employee Profile

    Hello everybody,
    i have created a small How-to guide of how to add a custom iView/Web Dynpro application to the standard MSS Employee Profile for ECC 6.0.
    The How-to guide can be found <a href="https://wiki.sdn.sap.com/wiki/display/profile/2007/04/15/How-toaddacustomWebDynproiViewtotheMSSEmployee+Profile">here</a>
    I hope its of any value.
    cheers,
    Markus

    Hello Luca,
    unfortunatelly it wont work. A WDA Application does not have access to the Floorplan Manager for XSS Applications. So until SAP develop an interface, you have to stick for such a task to WDJ.
    regards,
    Markus

  • Methods in the Component controller

    Hello,
    When is better call a method in the component controller, than run only a viewu2019s method?
    In other words, what kind of methods should to be in the component controller and what kind of methods should to be in the view?
    Could you give me some examples?
    Regards
    Janeth

    hi
    The EventHandler methods like on Action<actionname>() and methods to fire plugs we will generally used in view controllers.
    If we want to intialise any attributes we will do it in WdDoInit() method of view Controller.
    Generally its not preferrable to write business logic which is used by many components like service contoller generated methods in a view.
    Its a good way to use Service Controller methods like execute<bapiname> in Component Controller.
    For Dynamic Generation of UiElements we will use the WdDoModifyView(..) we use it in View.
    Regards
    sowmya.

  • What is the Web Dynpro tab on the portal page?

    Newbie here...
    I am confused between NDWS and the Web Dynpro tab on the portal page.  As I don't have access to either right now, I need to know what is required by a Portal Content Admin to maintain an application.  The Basis people do the JCO setup.  Those are the only tabs I have seen when using the Web Dynpro tab from the portal, not NDWS.  Seeing as I don't have access to either tool, and I have to ask for what I need and I don't know what I need...  Been there?
    I guess my question is the use of the two tools.
    Thanks,
    Amy Smith
    Haworth, Inc.

    Thanks so much for a quick response!
    So, the Web Dynpro Content Admin is normally a part of the content admin role.  Hmm... I get a "you are not authorized" when I click that tab, even though I can do iViews, etc. and was told I have the content admin role.  So if no one edited the rights of the content admin, I should be able to get into Web Dynpro Content Admin tool.  Is this so?  Is there any special user config, check box, etc in addition to the role?
    Is the Dynpro content admin tool useful for content admins or content developers?
    My Basis person does not want the content admin to be able to change JCO settings.  Is there a way to give the content admin rights to everything in the WDCA   except that? 
    Thanks again.  I am a J2EE developer who volunteered to take content admin and content development roles and am trying to figure out what has been done here and what needs to be done.  On top of that anyone who has been involved claims "I know nothing..."  until I ask specific questions.  It's just hard to know what the specific questions are.
    I know, training...  No money. Sigh...  I am good at doing tutorials and reading manuals and experimenting, however, I need access to the right tools and permissions first.
    Thanks again.
    --Amy Smith   Haworth, Inc.

  • Migrating Local Web Dynpro Projects to the JDI -- labels missing

    Hi all
    I am trying to Migrating Local Web Dynpro Projects to the JDI .But the labels are missing..?.
    The runtime output is coming well. Any suggestions.Do any of you come accross this problem before?.help appreciated and I promise to award full points for best solution
    Thank you
    Regards
    Maruti

    Hi Maruthi,
    Please look at this link,
    Re: How to modify ESS  ii views code which are imported from NWDI to NWDS
    Thanks,
    Raj.

  • Hey how to upload ABAP web dynpro's in the EP server?

    Hi Folks,
    please let me know how to deploy the created ABAP Web Dynpro's into the Enterprise Portal.
    thanks ,
    NKumar

    Hi NKumar,
    You can put your web dynpro application on portal.
    We can publish web dynpro application on portal through "iviews".
    Portal eventing is necessary during a scenario where u have to communicate to another portal iview.say in portal u have your WDA app in one iview and another WDA or BSP app in another iview
    But for WDA app,navigation inside its views you would not need portal eventing.
    This Will help you,
    /people/sap.user72/blog/2006/01/05/creating-wd-abap-iview-and-the-wd-namespace
    Kindly check for following links also,
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/9f0396e1062883e10000000a422035/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/1d/e4a34273f60b31e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/0e/a1e94205045604e10000000a155106/frameset.htm
    Hope I have answered your question.
    Cheers,
    Darshna.

  • How to work with the component controller.

    I Created a Z component.
    In that component controller i ceated a context node by using value node with BUT000 with the attribute NAME_ORG1.
    I created a view in the same component.
    In the view i created a Context Node BUT000 wiht NAME_ORG1.
    I bind this view context node with compnent controller context node.
    I want set the value from the view context node to component controller context node. How it is possible?
    I created another Z component.
    I created compoent controller like same context node above.
    I created the view also.
    I want display the first compoent controller data in the second component controller.
    How it is possible.
    For one component to another component we can pass the data based on component controller only?
    Please give me how i can set/display the component controller context node with the data?
    Thank You.
    Regards,
    B. Krishna.

    Hi Manish.
        Thank you for reply Manish. I need some more information.
    I created ZCOMP1 with view V1 and ZCOMP2 with view V2.
    In both component controllers I created Context node by usng NAME_ORG1 of BUT000.
    I provide the Navigation link from ZCOMP1 to ZCOMP2 as well as ZCOMP2 to ZCOMP1.
    In Run Time Repository I provied two components as a INTERFACE VIEWS and
    I provide ZCOMP2 as component Usage in ZCOMP1 as well as ZCOMP1 as a Component Usage in ZCOMP2.
    Now, what ever data I entered in ZCOMP1 like NAME_ORG1 is "HELLO" then
    This infomation I want display in ZCOMP2 - V2.
    In ZCOMP2 method  wd_usage_initialize
    I write like this.
    IF IV_USAGE->USAGE_NAME = 'CompUsage'.
        iv_usage->bind_context_node( iv_controller_type  = cl_bsp_wd_controller=>co_type_component
                                       iv_target_node_name = 'BUT000'       
                                       iv_node_2_bind      = 'BUT000' ).    
      ENDIF.
    But it is displaying the Exception like this
    Cannot display view ZCOMP2/MainWindow of UI Component ZCOMP2
    An exception has occurred Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - The view controller or custom controller "" was implemented incorrectly 
    Method:  CL_BSP_WD_COMPONENT_USAGE=>IF_BSP_WD_COMPONENT_USAGE~BIND_CONTEXT_NODE 
    Source Text Row:  24
    Please tell me how to solve this Problem.
    Regards,
    B. Krishna.

  • Multiple versions of the same Web Dynpro application on the same SAP Portal

    I have a single application (local development) and deploy directly to a SAP Portal(NW 7.0) from NWDS Version: 7.0.15
    No problems there, works like a charm.
    But I want to have multiple versions of the same application on one portal. Eg. ill build a version 1.0 for test and deploy this. Then continue to work on version 1.1 deploying this directly on the portal. The two versions should now co-existing under different names and/or packages.
    Please help.

    Hi Kim,
    May be you can try this and see if this works for you. I am not 100% sure if it will work for you, but worth a try I guess. Create a Test WebDynpro project and try the following steps on this project. If they work  out correctly and serve the purpose for you only then try them on your actual Web Dynpro project.
    1. Create a test Web Dynpro project  say "TestWDProject" with Component say "Comp1" and the default views and windows etc.
    Also create some working application our of this component and Windows using the Context.
    2. Right click the "Comp1" and select Copy.
    3. Right click 'Components" node in the project structure and select "Paste"
    4.This step will try to paste the copy of Comp1 as a new Component.
    5. You can change the Name and Package of the Component.
    6.Similarly you'll get the prompts for views,windows etc.
    7.Once you have copied everything, Just check if everything looks good.
    8.Now you can create a new Application using this new component and the Component Interface View and Deploy it.
    9.Test whether the Application created out of this copy works same as the original component.
    You can also try to create another Web Dynpro project and paste the Comp1 in the Components node of that new project and perform the same steps.
    Again, try with these Test Projects and see if this serves your purpose before applying the steps on actual projects.
    Regards,
    Ajay

Maybe you are looking for

  • Civilization IV + Powermac G4?

    Has anyone tried the full version of Civilization IV on a G4? I've got a Dual 1.42Ghz G4 with 1GB of ram and was wondering how it would run on this machine. I downloaded the demo and it ran just fine - except that the background was all black. After

  • Nokia Lumia 520 double, triple copies of music fil...

    Hi everybody, i am still facing the problem of music files beeing copied twice or more on the sd card.At first i have copied some music and then disconnected mz phone from the computer, everything ok and no doubles, but when i cpoz music afterwards t

  • Regarding BAPI_CUSTOMER_CREATEFROMDATA1 Urgent Issue

    Hi all, I am using BAPI_CUSTOMER_CREATEFROMDATA1 to create customers from the portal. I have given a reference customer in the PI_COPYREFERENCE structure along with sales area information. But the BAPI gives an error message like no tax records exist

  • Idoc processing best practices - use of RBDAPP01 and RBDMANI2

    We are having performance problems in the processing of inbound idocs.  The message type is SHPCON, and transaction volume is very high.  I am a functional consultant, not an ABAP developer, but will try my best to explain our current setup. 1)     W

  • SMP 3.0 SP03 iOS Push Notification Error

    Hi Gurus, I am creating a SMP 3.0.3 Phonegap Based iOS Project which runs the index.html, datajs-1.0.3.js and OData.read function collectively fetching data from Backend. Up-to this level iOS app is running fine and giving correct data.(XCode Proj.jp