Web Dynpro TreeView with BAPI

Hi all,
I made the Java tutorial treeView in Webdynpro with any problems.
Now, I used the "BAPI_USER_GETLIST" to list users in my treeview with a userList Model.
When I click on a user Node I want to add child node with the user details information
getting by the "BAPI_USER_GETDETAIL".
In the Event OnAction of the TreeNodeType, when I execute my BAPI_USER_GETDETAIL with username as
input parameter
how can I add dynamically child nodes with the output values from "BAPI_USER_GETDETAIL" ?
Thanks in advance,
Mathieu

Thanks Armin,
I have solved my problem.
my Context looks like :
-BAPI_User_GetDetail_Input = ModelNode
-BAPI_User_GetList_Input = ModelNode
-TreeNode = ValueNode
--Child = Recursion Node
--Icon = Value Attribute
--Text = value Atrribute
In the wdDoInit method of my Controller, I have this code :
  public void wdDoInit()
    //@@begin wdDoInit()
          // Execute BAPI Call
          try
               Bapi_User_Getlist_Input inp = new Bapi_User_Getlist_Input();
               wdContext.nodeBAPI_User_GetList_Input().bind(inp);
               wdContext
                    .currentBAPI_User_GetList_InputElement()
                    .modelObject()
                    .execute();
          catch (Exception e)
               wdComponentAPI.getMessageManager().reportException(
                    "Exception " + e,
                    true);
          //     creating a topLevel Element (UserElement)
          IPublicUserController.ITreeNodeElement level1element;
          // for all users, add them tho root node and do query to get theyr roles
          int size = wdContext.nodeUserlist().size();
          wdContext.nodeUserlist().moveFirst();
          for (int i = 0; i < size; i++)
               // current user, name of the node
               String username = wdContext.currentUserlistElement().getUsername();
               // set infos and add to the tree
               level1element = wdContext.createTreeNodeElement();
               level1element.setText(username);
               level1element.setIcon("user.gif");
               wdContext.nodeTreeNode().addElement(level1element);
               // Making BAPI call for details
               wdThis.ExecuteBAPIUserDetail(username);
               // for all Elements from BAPI call, add them to tree
               int size2 = wdContext.nodeActivitygroups().size();
               // moving to first Element
               wdContext.nodeOutputDetail().moveFirst();
               for (int j = 0; j < size2; j++)
                    String rolename =
                         wdContext
                              .nodeActivitygroups()
                              .currentActivitygroupsElement()
                              .getAgr_Name();
                    // add to the tree
                    IPrivateUserController.ITreeNodeElement level2element =
                         level1element.nodeChild().createTreeNodeElement();
                    level2element.setText(rolename);
                    level2element.setIcon("role.gif");
                    level1element.nodeChild().addElement(level2element);
                    // next element
                    wdContext.nodeActivitygroups().moveNext();
               // moving to the next user
               wdContext.nodeUserlist().moveNext();
    //@@end
Message was edited by: Armin Reichert
(Added code tag)

Similar Messages

  • Examples of 'calling a web dynpro application with parameters'

    Hi!!
    I'm I have been watching manual 'Web dynpro for abap: advanced concepts' in the sections 'url parameters' and 'calling a web dynpro application with parameters'.
    Is there some example where these terms are seen.
    Thanks in advance.

    Hi Ana,
    a window inbound plug can have parameters.
    These parameters are automatically fished out of the URL by the framework.
    So your inbound plug handler method has easy access to the parameters.
    URL
    http://<host>:port/sap/bc/webdynpro/sap/<your application>?param1=xyz&param2=abc
    The application is configured to call an inbound interface(window) and plug.
    The plug can be declared with parameters.
    Double click on window inbound plug and add your parameters.
    The parameters are made available by framework if present in Launch URL.
    You can also call an application that has parameters  directly entered on the parameters tab.
    ie Parameters can be part of the application launch.
    regards
    Phil

  • Web dynpro screen with multiple rows with columns that can be edited

    Web dynpro screen with multiple rows with columns that can be edited individually:
    Hi
    I am busy creating a screen in web dynpro for ABAP which we would like to make available via Portal ESS (Portal 7).
    I need to add 'n type of table (or almost something like Excel) or something in which someone can type a few paycode numbers (there should be lets say 10 blank rows in which info can be typed in and if I click on a button or so, more rows must be added if necessary.  Then in the other colums stuff like amounts must be entered which one should also be able to edit then and there.
    Can anyone assist in what I can use for this?  There does not seem to be some existing element that I can use.
    Help will be appreciated.
    Regards
    Debbie

    Hi Debbie,
    Whiel Creating table you need to be care full that use chose INPUT FIELD as the CELL EDITOR. Just guessing that if ur table is not editable u might have choosen TextView as default cell editor type.
    check link for details on TABLE UI
    [http://help.sap.com/saphelp_erp2005/helpdata/EN/b5/ac884118aa1709e10000000a155106/frameset.htm]
    easy way is to first add UI ELEMENT TABLE to your VIEW, then right click over it & select create binding from context. After you have a pop up where you can select what columns you want what should be its cell editor etc.
    Greetings
    Prashant

  • Web Dynpro integration with R/3

    Dear all,
    We have the following requirement in Web Dynpro integration with R/3
    We have to update the local SQL tables based on R/3 system return values. R/3 system should call the webdynpro business method for updating local SQL Status table.  In the R/3 system after purchase order is created, via user exit it should call and update some fields in the local SQL tables. To solve this problem we have thought of following solutions possibility:
    1.       In R/3 system based on user exit, it calls the ABAP Proxy ->  XI (SOAP Adapter) -> Web Dynpro Web Service in WebAS->  XI -> ABAP Proxy -> User exit – PO continues.
    2.       In R/3 system based on user exit, it calls directly web service then web service goes to user exit.
    3.       In R/3 -> user exit -> ABAP Proxy – JDBC Adapter -> SQL stored procedure call - > user exit.
    Please give your valuable suggestion or any other options to solve above problems.
    And another one question is how to create web service and deploy into WebAS through webdynpro project?. Kindly guide us to the correct document for creating webservice through webdynpro or any other related url link.
    Advance thanks,
    S.Saravanan.

    Hi Sarvanan,
    Please refer to the following link for help on webservice,
    Creating webservice, http://help.sap.com/saphelp_nw2004s/helpdata/en/db/99c04ba22fe64f96a8651df68eab92/frameset.htm
    Consuming a Web Service in JAVA,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/81/12703e5da3e946e10000000a114084/frameset.htm
    Consuming webservices in webdynpro,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/91/9c2226df76f64fa7783dcaa4534395/frameset.htm
    I feel once you go through these links you yourself will be in a much better position to decide upon to your design options.
    Reply back for more help,
    Guru.

  • Web Dynpro Java with Adaptive Model

    when i Created Web Dynpro Java with an Adaptive Model I got  Some error in webdynpro.  the error is
    com.sap.dictionary.runtime.DdException: Type com.sap.cust.model.types.Zcustdata does not exist
    what would be the problem .
    can u anybody please help me out in this.

    Hi ,
    i re-imported the and checked even though i got the same problem
    com.sap.dictionary.runtime.DdException: Type com.sap.cust.model.types.Zcustdata does not exist
    com.sap.tc.webdynpro.services.exceptions.TypeNotFoundException: type extern:com.sap.cutm.model.model.types.CustmModel:com.sap.cutm.model.model.types.Zcustdata2 could not be loaded: com.sap.dictionary.runtime.DdException: Type  com.sap.cutm.model.model.types.Zcustdata2 does not exist
    can u please help me out
    or can u please send me the sample pdf documents which contains step by step process.
    Thanks in advance,
    Venkat.

  • Closing window of web dynpro application with exit-plug don't run in the EP

    Hi everybody,
    I want to close a window that contains a Web Dynpro with a close button, because it's used and create as a popup from an other iView (that's not created with web dynpros) in the EP. I read the different threads how to close a window in web dynpro, like JavaScript in WD
    I create a HTML file with the javascript code to close the window and it works fine, when I start the application separately.
    If I used it in the portal and click the close button I get the following error message:
    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 tried also: ...wdFirePlugExit("javascript:self.parent.close();") or some other javascript code, but got the same error message.
    Then I tried:
    WDPortalNavigation.navigateAbsolute(url,WDPortalNavigationMode.SHOW_INPLACE,(String) null, (String) null,(String) null);
    instead of fireing the outbound plug in the action of the close button
    (...InterfaceViewController().wdFirePlugExit(url);)
    but than a new window with the EP open and the old is still there!
    We use the NWDS2004s an the EP 7.00.
    It must be possible to close a (this) window!
    Thanks for any hint
    christian

    Hi,
       This is what you can do:
    1. You have already created the HTML file with the necessary javascript in the foloowing folder structure :
    src->Mimes->Components-><your component name>-><fileName.html>.
    2. Create a new iView of type URL in your portal.
    3. Get the absolute URL of this HTML file inside your project. This will be in the following format:
    http://<server>:<port>/webdynpro/resources/sap.com/<development ComponentName>/Components/<namespace>/<fileName>.html
    You can find it thus:
    try {
    String u = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getDeployableObjectPart(),"filename.html");
    wdComponentAPI.getMessageManager().reportSuccess(u);
    } catch (WDURLException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    4. Now enter this URL string as the URL for the iview.
    5. Do a normal portal navigation to this iview on-click of the button.
    Regards,
    Satyajit.

  • Opening External Window in Web Dynpro ABAP with URL disabled or Hidden

    Hi Experts, I have a requirement where-in we want to open the Web Dynpro ABAP application using tcode WDYID (by passing the application name  and startmode), but the URL of the newly opened explorer should be disabled or hidden. To achieve the same, I have created a component (lets name it PARENT) and inside that in DOMODIFY/DOINIT method have written code to invoke the required WDA (lets name it CHILD) in external window (by using lo_window_manager->CREATE_EXTERNAL_WINDOW) and is successfully able to open the application with URL disable using different parameter of method CREATE_EXTERNAL_WINDOW. But in this case there are 2 window which opens, one is for PARENT view and other is for CHILD. Now I only want to keep the second view (CHILD) to be opened and want to close the PARENT view. When I used EXIT_PLUG to close the PARENT window, it closes both the window. Need your inputs on my approach or if you have any. Regards, Harish

    Hi,
    If you open the popup, it opens as Modal Window, originating from Parent window. Without external window( where you can pass has_location = abap_false ), you cannot hide the URL/Address bar.
    If you want to partially hide the URL( if you dont want to show the full URL with application path), you can create an Alias for the service in SICF.
    Go to SICF, and create an alias for your WDA application; say original URL: domain:port/sap/bc/webdynpro/sap/<ZAPPLICATION_NAME>
    This URL you can convert( partially hide) as, domain:port/sap/<ANY_NAME>
    Refer creating Alias in this help: http://help.sap.com/saphelp_sem320bw/helpdata/en/55/361a3c9c004866e10000000a11402f/content.htm
    Hope this helps u,
    Regards,
    Kiran

  • Interaction ABAP Web Dynpro popup with Windows

    Hello,
    I have made a view ‘Z_Y’ in Web dynpro for ABAP. In this view I call a standard external window with the statement:
      lo_window = lo_window_manager->create_external_window( url = lf_url ).
      lo_window->open( ).
    The lf_url field is a location on the Windows(XP) network. It could happen that the file doesn’t exist. In this case I get a standard Windows error message in a popup that the directory can’t be found with a ‘OK’ button. When I click ‘OK’ the popup is closed and I can use other functionality of the ABAP dynpro view.
    I integrate view ‘Z_Y’ in another dynpro window (W_WINDOW) that is called as a popup using the following statement:
    create popup window **********************************************************************
      DATA: l_window_manager          TYPE REF TO if_wd_window_manager.
      DATA: l_api_componentcontroller TYPE REF TO if_wd_component.
      l_api_componentcontroller = wd_comp_controller->wd_get_api( ).
      l_window_manager          = l_api_componentcontroller->get_window_manager( ).
      wd_this->m_popup_window = l_window_manager->create_window(
                                      close_button = abap_false
                                      button_kind  = '2'
                                      modal        = 'X'
                                      window_name  = 'W_WINDOW'
                                      title        = 'Popup' ). "#EC NOTEXT
      wd_this->m_popup_window->open( ).
    Then I call from view ‘Z_Y’ the external window using this statement again:
      lo_window = lo_window_manager->create_external_window( url = lf_url ).
      lo_window->open( ).
    If the directory doesn’t exist I get the same standard Windows error message in a popup that the directory can’t be found with an ‘OK’ button. But when I click ‘OK’ I can’t get back to the web dynpro application. I get a throbber/popup “please wait” and I have no interaction anymore with the button ‘close’ of the dynpro popup. The buttoner size still works.
    Can someone help me?
    Kind regards,
    Yan Cazarelly

    Hi
    You ca use this function to Create a new window..
      CALL METHOD wd_window->create_window
          EXPORTING
            modal             = abap_true
            window_name       = 'MMPUR_CPPR_RFQ_WDW'
            title             = lv_otr_text
            close_button      = abap_true
            button_kind       = 3
            close_in_any_case = abap_true
          RECEIVING
            window            = wd_comp_controller->window.
        wd_comp_controller->window->open( ).
    here you acn impliment buttons, if you want to subcribe window button please use this window subcribe method.
        CALL METHOD wd_comp_controller->window->subscribe_to_button_event
          EXPORTING
            button            = if_wd_window=>co_button_ok
            action_name       = 'RFQ_WT_VENDOR'
            action_view       = l_api
            is_default_button = abap_false
            button_text       = lv_otr_text
            tooltip           = lv_otr_text.
        wd_comp_controller->window->open( ).
    Please let me know if you have any issue. Please reword if its solve your problem.
    Regards
    Satrajit

  • Is it possible to integrate web dynpro java  with xPD screens?

    We have a requirement to integrate the xPD screens with Adobe using web dynpro java. The UI has to be completely Adobe and the xPD transactions would be triggered through Adobe.
    Is it possible?? Please let me know how if anyone worked on this.
    We are using SAP NW SP12 and NWDS 7.0.1
    Thank you,
    Vasu

    Vasu,
    I'm in the same boat as you because I have no idea where to start either.  Right now we are just evaluating some possible solutions for our UI needs that our Business is asking for.  Originally I only heard about the Adobe Forms.  Then I heard about this Web Page Composer which could also provide us a way to display our iViews and other links in a more user friendly page.
    So learning how to display xPD in either area is new to me and I am just starting to learn SAP all together.  If I hear anything or read anything, I will share with you.  Maybe we can help each other out. 
    Jennifer

  • Can we use MDM 7.1 Web Dynpro UI with MDM 5.5 ?

    Dear Experts,
    Is there any possibility to use new MDM Web Dynpro UI (which has got released with MDM 7.1 SP04).
    with MDM 5.5 SP6 as a backend.
    I wonder, if we deploy MDM 5.5 Java API with MDM 7.1 Web Dynpro components,
    then it should work with MDM 5.5 setup also!
    Any thoughts on this?
    Regards,
    Shailesh.

    Hi Shailesh,
    Is there any possibility to use new MDM Web Dynpro UI (which has got released with MDM 7.1 SP04).
    with MDM 5.5 SP6 as a backend.
    As per my knowledge is concern for MDM7.1 will support .NET API,ABAP API.......
    I wonder, if we deploy MDM 5.5 Java API with MDM 7.1 Web Dynpro components,
    then it should work with MDM 5.5 setup also!
    I dont think so....
    Thanks
    Yugandhar

  • Securing Web-Dynpro application with Netegrity

    Hi,
    I'm developing a web-dynpro application that will be secured by Netegrity SiteMinder. SiteMinder is a reverse-proxy that authenticates the user and adds the user details as additional headers to the HTTP stream. According to the documentation I found in SDN with regards to JAAS and NetWeaver it looks like SAP has added callbacks so that I can retrieve HTTP headers in my custom login-module. I've implemented a simple login-module and deployed it, but now am stuck with the following issues:
    (1) I can't seem to be able to debug the module (even when I create a simple HelloWorld.jsp and require the use of this module in the visual administrator, the debugger seems to ignore the break-points).
    (2) I can't find any possibility to configure the engine so that this specific module is required for authenticating my deployed web-dynpro application.
    My questions are as follows:
    (1) Is it possible to use standard JAAS authentication with web-dynpro applications?
    (2) How do I debug JAAS login modules?
    Regards, Chris.

    <b><b>Hi Adrian
    During the Life cycle of your application Your connection will be Released when it is inactive for particular Time (The inactive time limit will be specified in the JCo Pool Settings that would be in milli seconds)
    The RFC Connection can be Monitored using the Gateway process .
    There are Some Predefined Connections in the Gatewway Process and each connection Requires approximately 200Kb of Memory.
    So the memory cosumption of the Gateway process is proportional to the number of Active RFC Connection.
    For More Details Check This
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/85a483cb-0d01-0010-2990-c5168f01ce8a">JCo Connection Pools</a>
    Regards
    Chandran S</b>

  • Active a URL in web dynpro iview with out using LinkToURL button?

    Hello everybody;
    Is it possible to directly activate a URL in iview without using any buttons (e.g. LinkToURL)?
    I've develloped a Web Dynpro project. I have placed my code in the INIT function in iview, and I want the URL to activate automatically when INIT is opened. At the moment I have used the LinkToURL function to activate the URL, but I want to avoid this step.
    In EP iview it is possible to do this using Javascript, but Javascript is not allowed in Web Dynpro.
    Any ideas and suggestions are very welcome.
    Reza

    Look here
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/f1cfe990-0201-0010-22ac-dbe4cbdef504
    Use the code for open "www.google.com" into yuor wdInit or wdModify
    if (firsttime) {
       // THE CODE
    method.

  • Create a Table Dynamically in WEB Dynpro Java with diferent type of column

    Hi everyone, I have a question if is possible to create a table dynamically in Web Dynpro Java?, depending of the RFC consults create the rows dynamically, ,this table must have diferent type of columns, for example link column (when the user click this link execute an action and show a adobe interactive form in another view), image column (show an image depending of the information)
    Thank you everyone
    Atte Israel

    Hello,Israel.
    Yes , it is possible through dynamic programming in wdModify of the View.
    You can do this ,for example, using cell variants.
    IWDTable tab = (IWDTable) view.getElement("TABLE_NAME");               
    IWDTableStandardCell cellV= (IWDTableStandardCell) view.createElement(IWDTableStandardCell.class,"TableStandardCell"+i); 
    cellV.setVariantKey("NotEditableVariant");
    cellV.setCellDesign((WDTableCellDesign)wdContext.nodeTableDaysTitle().currentTableDaysTitleElement().getAttributeValue("CellDesign"+i));
    IWDTextView textViewi= (IWDTextView) view.createElement(IWDTextView.class,"TextView"+i);  // -- here you control the type of the object that is displayed in the cell
    textViewi.bindText(dayAttrib);
    cellV.setEditor(textViewi);          
    tabColumn.addCellVariant(cellV);
    tab.addGroupedColumn(tabColumn,tab.numberOfGroupedColumns());     
    Using this code you can control even specific cells in the table and not only columns.
    Hope this helps you,
    Constantine

  • Web Dynpro ABAP with workflow in EP

    Hi friends..
    I wants my web dynpro application in EP workflow (its a form which needs to be field by multiple users).. can u suggest how to do this , i am new to EP as well webdynpro ABAP.. please suggest how to proceed..
    regards
    siddharth

    Hi Siddarth,
    I can help you through some links are available here...
    https://www.sdn.sap.com/irj/sdn/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
    https://www.sdn.sap.com/irj/sdn/ep?rid=/webcontent/uuid/fe7a864d-0a01-0010-5c9f-992510042c41 [original link is broken]
    /thread/113025 [original link is broken]
    Thanks and Regards,
    Prabhakar Dharmala

  • Web Dynpro OfficeObject with VB Macros

    Hi all,
      I'm trying to employ an MS Word Template using the OfficeControl. The word template has macros in it, tied to buttons. When this is previewed in the Mime repository, the buttons are there and the macro runs. When the document is called in the WD, the Word document doesn't appear, just a big white box with SAP IOS instead of the place where the document would normally be previewed.
    Anyone know why this is and how to fix it?
    Thanks in advance.

    Hi, Patrick,
    I know this is a very old post, but I have got similar issues, so maybe you would be able to help. I have the same scenario + we would like to execute the macros directly from ABAP (macro is digitally signed by the customer). This looks impossible once you use setfields( ) method to do the mail-merge (I believe the macro's digital signature is lost then - the ACF protocol shows up the message - not signed).
    I tried opening two documents in the view at once (which looks impossible). When running the macro name ".macroname", it seems to look for .dot template in the default location C:\Users\"USERNAME"\AppData\Roaming\Microsoft\Templates\. We've got Office 2010, so .dotm template should be used. But ACF trace protocol shows a message that word cannot open this template:
    "(c:\users\"USERNAME"\appdata\...\.dot)". In fact, I only suppose the whole path is appdata\roaming..., because the protocol shows only this wrapper. It does not state the name of the file, but I suppose that Normal.dot is what it looks for.
    The office control itselft has a property "DocumentName". I would expect that this property has some meaning, but it seems it does not (if I try to run a macro "RealDocumentName.MacroName" - it states that there is no open document RealDocumentName.
    Now how to force the ACF to look for .dotm instead of .dot? Or did you find any other suitable solution? If I created a .dot template (in an older version of office - which I do not have right now), I suppose I would be able to let the customer to digitally sign the document. But how to distribute this kind of stuff to all the target PCs, that is very confusing (not all the users will have the same version of Office).
    Any push is greatelly appreciates.

Maybe you are looking for

  • Quits on startup

    Whenever I try to open Safari, it opens, but a window doesn't pop up (the arrow pops up underneath the Safari icon in the dock) and when I try to open a new window it quits it. Heres the report thing. Date/Time: 2007-12-28 10:59:17.634 -0500 OS Versi

  • [Solved] pushing any key on keyboard crashes KDE

    I just did a -Syu, and therefore am running the latest Kernel, xorg server and KDE. I use nvidia. X loads up, KDE come up, music plays... I push any button on keyboard and *poof*, crash. I cannot get the keyboard or X or a command line back. I either

  • Boot camp XP on mac Pro with Leopard

    I have tried to load windows xp onto my new Mac Pro. The firmware is up to date. The files load but the startup disk never ejects. The computer says that it is starting up windows, but never enters into the windows start up screen. The computer conti

  • Call stored function / stored procedure from JAVA/JPA and pass array

    I fail calling a plsql function from java with jpa - it works perfect without the array but its not working with the array: PLSQL Function: function getHtml(pWhere VARCHAR2 DEFAULT NULL, pColSort HTP.STRINGARRAY) return clob is begin errorhndl.Log(pM

  • Over delivery tolreance

    Hi, i want to know how the overdelivery tolerance works in ths ystem. i am maintaining my overdelivery tolernace in material master in purchasing data say of some 10%. if i rise a PO and i recive the delivery in multiple splists says Multiple GR's. W