Model Handling in WebDynpro

Hi,
   I have the following scenario : My application has an adaptive RFC model. The model is bound to the component controller context which in turn is bound to the view controller context. The entries in model are being shown in the view as a table. All the nodes in the view context are Model nodes.
   The table being shown in the view has to be interactive, in the sense that user can insert new rows in it. The updated table then has to be saved back into SAP using another RFC.
    The Problem : How to dynamically insert new rows in the table and save the data? I tried using createElement method but it is not working probably because the node is a Model node and NOT value node.
Any suggestions will be very helpful.Thanks.

Hi Kapil,
You can dynamically add the rows as follows
Ex: Let us consider you have customer model.
    Create new object of type customer and create an element of the modelnode type and add the element to the modelnode root. This will create a row in the table.
Ex :
Customer cust=new Customer();
wdContext.nodeCustomer().bind(cust);
You can place another button on the table toolbar and call the execute method of the RFCModel to save the rows in the backend system !!
Regards, VIP

Similar Messages

  • Using Component Object Model+ (COM+) in webdynpro

    Dear friends,
    How can I use Component Object Model+ (COM) in webdynpro? Is it feasible to use COM to access SQL Server 2005 Database.
    Thanks and Regards,
    Tarani

    Hello Brian Tyler
    I followed your instruction but I ran into another problem ~
    I can't find the COM with the control
    on this website
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersg...
    I have found this section that I want to use:
    Modifying the Contents of the Taskbar
    Version 4.71 and later of Shell32.dll adds the capability to modify the contents of the taskbar. From an application, you can now add, remove, and activate taskbar buttons. Activating the item does not activate the window; it shows the item as pressed on the taskbar.
    The taskbar modification capabilities are implemented in a Component Object Model (COM) object (CLSID_TaskbarList ) that exposes the ITaskbarList interface (IID_ITaskbarList ). You must call the HrInit method to initialize the object. You can then use the methods of the ITaskbarList interface to modify the contents of the taskbar.
    but I can't seen to find it.
    Oh and I visited your blog, it is awesome, the nano car article is cool
    thanks for your help
    Jimmy

  • Customer written Request Handler at Webdynpro SICF Node

    Hi,
    We tried to activate our own request handler in the handler list of the SICF node of our ABAP webdynpro application. However, the handler is not called, i.e. the method IF_HTTP_EXTENSION~HANDLE_REQUEST of my own handler class is not executed.  Why?
    If this is - despite of the documentation - is not working, how can we enhance the request handling?
    thanks for feedback,
    Andreas

    Hi,
    Created a node under default_host and added the custom class to handlers tab, activated the service and then tried to test..browser shows the message
    404   Not Found
    *          SAP J2EE Engine/7.00*
      The requested resource does not exist.
      *Details:      *
      Go to main page of this application!
    BR,
    Anubhav.

  • Value Help for Model in java webdynpro

    I have created an OVS in web dynpro. I would like to query the database(ABAP Table in SAP R/3).
    How do I do it in webdynpro.
    Thanks and Regards,
    Narayani

    Hi Valery ,
    I tried using the ICMIQuery but there seems to be a problem. I am getting the following exception:
    "java.lang.UnsupportedOperationException: Not supported for generic queries"
    This is the code that I tried for query.
    Selectquery is the query model class that I have created.
    I have even tried without the wdcontext also.
    SelectQuery query = new SelectQuery();
    wdContext.nodeSelectQuery().bind(query);
    WDValueServices.addOVSExtension("OVSTEST",attributes,query,listener);
    Thanks.
    Narayani

  • Models in Abap Webdynpro.

    Hi All,
    I am a Java guy having knowledge in Java webdynpro, it happend for me to get into ABAP webdynpro just had a small query here.
    How does models functionality work in ABAp Webdynpro.
    How do we access RFC, BAPI, web services, EJBs etc in ABAP web dynpro.
    Thanks in Advance,
    Sai Krishna.

    Hi Sai,
    Model is nothing but the business logic similar to the Java webdynpro . I guess you have seen those Hook methods like WD_doinit, WD DOmodifyView some standard default methods which we get according to the requirement we write our code as and where we want . One basic thing is u must be aware of the Context which is the heart of the webdynpro abap applications the interaction between the screen and the database is done by this .
    Let me take a small example of how are we going to use the RFC or Bapis.
    EG:
    We have a screen UI elemnets in which we have one input field and a table our aim is to fetch the data into the table depending upon the input field or say selection field . and here we will be using say RFC or it may be a BAPI.
    SO step1. Intially we desing the screen UI elements , create a Node for the input field with cardinality (0:1). and create another node for the table binding with cardinality as (0:n).then bind the values of the screen .
    step2:  Now since after giving the value in the input filed we want to fetch the data. On action of the Button or on enter of the input filed we need to write our code.
    That means here our bapi or RFC comes into picture . what we need to do is get_attribute of the input field and call that RFC in import values pass the get_attribute value and see that it returns some table
    say lt_table.
    Now when you debug you can see the table values which we need to bind it to the table.
    lo_nd_table->bind_table( lt_table ).
    This will fetch the table values depending upon the input field values you giv .
    Hope it is clear and helpful.
    Have A GoodDay:)
    Regards,
    Sana.

  • SRM  RFC Model Error in Webdynpro JAVA

    Hi All,
    When I create a model from Any R/3 RFC in Webdynpro(JAVA) and map the RFC model context to Controller Context then every thing works fine, but when I create model from SRM RFC(Model is created with no problems at all) and map the SRM Model context to Controller Context, then I get below error:
    com.sap.tc.webdynpro.services.exceptions.TypeNotFoundException: type com.cnsl.srm.model.types.Bbp_Category_Id could not be loaded: com.sap.dictionary.runtime.DdException: Type com.cnsl.srm.model.types.Bbp_Category_Id does not exist
    Is there any thing specific to SRM that we have to do on the Webdynpro(JAVA) side to be able to call the SRM RFC. Kindly suggest me. Also please if you can forward me to forum thread/blog in case there is any.
    -Shekhar.

    Hi,
    Please look at this thread. Similar problem
    Webdynpro Services Exception
    WebDynpro using BAPI has an error
    Regards,
    Marcin Gajewski

  • Model Problem In webdynpro java

    Hi all,
    I am facing a differnent problem with model classes in my webdynpro application.
    I have a componenet where in i am using standard BAPIs.The problem here is i am getting the latest data from the bapi only when the application is loded first.
    If i add a new record and want to know the size of output node it is not giving the latest one.It is showing the size it has when the application is loded,But in the backend it is getting updated everytime.
    What might me the problem for this??Is it that the model proxy classes that are loded when the application is loded is not getting refreshed??
    Edited by: chandrashekar chandrashekar on Dec 10, 2008 7:30 AM

    Hi,
    This is the code i am using...
    My problem in brief is if i try to add a record it is getting updated in SAP but if i try to display the output node it is giving the size it has when the application is loded.
    If i restart the application it is giving the updated sise of the output node
    Bapi_Class_Getdetail_Input inputGetDetail = null;
    inputGetDetail = new Bapi_Class_Getdetail_Input();
    wdContext.nodeBapi_Class_Getdetail_Input().bind(inputGetDetail);
    inputGetDetail.setClassnum(className);
    inputGetDetail.setClasstype("300");
         try
              executeBapi_Class_GetDetail();
         catch(WDDynamicRFCExecuteException ex)
              return false;
    executeBapi_Class_GetDetail()
    try
    wdContext.currentBapi_Class_Getdetail_InputElement().modelObject().execute();
    wdContext.nodeOutput().invalidate();
    catch(WDDynamicRFCExecuteException ex)
         ex.printStackTrace();

  • Exception Handling in webdynpro abap

    Hi
    I have a function call which raises an exception. How do i handle it?

    hi,
    In WD4A, Exception handling in FM is same as We do in R/3. You can check sy-subrc after calling the function module.
    Also you can raise error message by using web dynpro code wizard(control + F7 ) button:
    Select Generate message radio button. You will find number of methods in F4. You can use them as per your requirement
    Example :
    Suppose you call a FM like this in WD ABAP :
    CALL FUNCTION 'F4UT_RESULTS_MAP'
        TABLES
          shlp_tab          = t_shlp_tab
          record_tab        = t_record
          source_tab        = t_HCP
        CHANGING
          shlp              = p_shlp_descr
          callcontrol       = icallcontrol
        EXCEPTIONS
          illegal_structure = 1
          OTHERS            = 2.
    Now after this FM, check the sy-subrc value Like this:
    if sy-subrc = 1.
    <Report message for exception 1>.
    elseif sy-subrc = 2.
    <Report message for exception 2>
    endif.
    Edited by: Saurav Mago on Oct 16, 2009 10:22 AM

  • How to refresh model nodes in webdynpro java

    Dear Experts,
    I have a table in view which is mapped to a model node . The model node gets populated by calling a RFC.
    Please tell me how to refresh the model node mapped in the view ?
    wdContext.node_Result_Data.invalidate() ;  doesnt work over here . dont know y !!
    Please advise.
    Regards,
    Mamai.

    Hi,
    Please check with this code. Hope this is help full for you.
    wdContext.nodePoDetails_OutTab().invalidate();
    after invalidate u have to write the Execute that BAPI also.
    wdThis.wdGetCO_POPendingDetailsController().executeYmm_Sc_Bapi_Oapending_Getlist1_Input();
    Hope this helps!!
    Thanks & Regards
    Vijay

  • Regarding exception handling in webdynpro

    Dear frds..
    I am using webservice for webdynpro application.,,,
    when i call a particular method of webservice in webdynpro i get o/ps but when i give wrong outputs the webservice exception is shown in webdynpro at the bottom
    I dont wanna to display the exception mesage doen the bottom,
    Instead of dispalying the exception message, i want to dispaly some other things like confirmation box or dialog box..
    How to catch exceptions in webdynpro?
    if  use try catch finally block in webdynpro,
    and in catch block i kept messaeg of popup confiramtion box, it is not been displayed....
    Thanks in advance
    Shravan

    For displaying error in confirmation box, try following code:
    Create a eventhandler named as "Exception"
    try
            //Some statements
    catch(Exception e)
    IWDControllerInfo controllerInfo =wdControllerAPI.getViewInfo().getViewController();
    String dialogText = "TYPE UR ERROR MESSAGE";
    IWDConfirmationDialog dialog =           wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,
    controllerInfo.findInEventHandlers("Exception"),"OK");
    dialog.open();
    OR
    To display error message at some place other than bottom( which is default), add a UI element named as MessageArea and placed it at the required location in View and trying executing the application.

  • Handling Currency Formats in WebDynpro

    Hi,
    We have a scenario where we have to display different currencies in their own format.
    The input structure is copied from a model node. The attribute is a simple type coming from the backend . When user enters the value ,an event is raised and some RFC s are called.
    Finally, the input which the user is entered is formatted correctly based on the currency he has chosen.
    When we debug, the node does not have the value in the proper format which is displayed. Its not a calculated attribute too.
    So how is currency formatting handled for different currencies... in webdynpro ?
    Here setR3NormalizingFormattingAttribute is used for the attribute. Does this handle this formatting ?
    How is backend setting of currency formats in TCURX handled ?
    Any idea on currency handling in WebDynpro would help.
    Regards
    Bharathwaj

    Hi Stefanie,
    Thank you. Here they are using currency normalized  by calling
    setR3NormalizingFormattingService(true)
    This , I guess handles the formatting. But when i try to access the value from the node attribute  it's giving an incorrect value.. This is quite surprising .. If
    If the currency specification is to correspond to the ERP system, will the attribute itself have a proper formatted value form R3 .Or is it that , we need some other handle to get the formatted value. ?
    Was i clear about  what the scenario is ?
    Regards
    Bharathwaj

  • Getting the following error while creating the model for webdynpro app.

    Plugin Name: Web Dynpro Model Editor Services
    Plugin ID  : com.sap.ide.webdynpro.service.modeleditor
    Class      :ap.ide.webdynpro.modeleditor.wizards.model.              creation.ModelDialog
    Method     : nextPressed
    Exception  : org.eclipse.swt.SWTException: Failed to  execute runnable (java.lang.NoClassDefFoundError)
    This is the error i am getting while creating the model for the webdynpro application. Can some one help ?
    Thanks & Regards
    Lalith

    hi
    This error occurs mainly due to the reason that particular plugin is not there in the NWDS.
    So please try to reinstall the NWDS or try tracing out whether that particular plugin is there or not.
    Thank,
    kris

  • Consuming AWS model in webdynpro java application

    Hi,
    We are using the following environment.
    SAP Netweaver Portal 7.3
    Netweaver Developer Studio 7.3.
    We have imported a AWS webservice model in a webdynpro application. When we deploy the application in portal, we are receiving the following runtime error,
    error in executing the model: Illegal model class renaming: Model classes with QNames '/definitions/types/xsd:schema[5]/xsd:element[15]/xsd:complexType' and '/definitions/types/xsd:schema[5]/xsd:element[15]/xsd:complexType#Choice1' were both renamed to the same name 'com.sap.demo.harmanmdmui.wd.models.addresswebservice.RunBatchJobRequest'
    Addresswebservice is the webservice name and harmanmdmui is the application name.
    Pleaae advise me with a probable solution.
    Thanks,
    Appachi

    Hi
    What does the log say?
    Regards
    Yuval

  • New Business Method in EJB not available in Webdynpro Model

    Hi,
    I am using EJBs for Business Logic in my webdynpro java application. I have added a new Business Method in one of the session bean. But I am not able to see the new method in webdynpro model. I am following the below procedure -
    1. Select the Session bean.
    2. Add New Business Method. It automatically adds the method in Remote and Local Interface.
    3. Implement thie new method.
    4. Build EJB project
    5. Add it to EAR
    6. Build EAR Project
    7. Deploy EAR Project
    After following above steps, when I am trying to create a model in my webdynpro project, it does not reflect the changes (context returned by new business method).
    Can any one help me on this ?
    Thanks in advance,
    Gaurav

    The issue is resolved. This is the case where methods in beans returns collections. For such scenario, relations have to be created manually, it does not come automatically. For details refer the blog at below link --
    /people/balaramnaidu.bankuru/blog/2006/04/23/importing-complex-javabean-model-into-webdynpro-by-creating-relationships-for-the-model-classes
    Thanks everyone.
    Gaurav

  • Problem when importing the complex bean model into webdynpro

    hi all,
    when importing the complex bean model into the webDynpro, it was returning the blank.
    Thanks in advance

    Hi,
      show your code for see and understand what could be wrong.
    Here one mine example:
    The model class
    * Created on 27-ott-2006
    * To change the template for this generated file go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package tmp.userslist.comp.model.userslist;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import javax.sql.DataSource;
    import java.util.Collection;
    import java.util.ArrayList;
    import java.io.Serializable;
    * @author rtagliento
    * To change the template for this generated type comment go to
    * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class AllUsers {
    // implements Serializable {
         private Connection con;
         private ResultSet rs;
         private Statement stmt;
         private String SqlQuery;
         private Collection usersList = null;
         private UserElement users = null;
    //     private Collection empDetailsList=null;
    //     private EmpDetailsHelperClass  empdetails=null;
         public AllUsers(){
              con = null;     
              java.sql.ResultSet rs = null;
              rs = null;
              SqlQuery  = "SELECT * FROM TMP_USERSLIST ; ";
         public Connection getConnection (){
                   return con;
         public void setConnection (Connection c){
              con = c;
         public Collection getUsersList()
              return usersList;
         public UserElement getUsers()
              return users;
         public void setUsers(UserElement class1)
              users = class1;
         public void execute() throws Exception {
              String DEBUG = new String("");
              try {
                   stmt = con.createStatement();
                   rs = stmt.executeQuery(SqlQuery);
                   usersList = new ArrayList();
                   usersList.clear();
                   while (rs.next()){
                        users = new UserElement();
                        users.setID(rs.getString("ID"));
                        DEBUG += "ID: " + rs.getString("ID") + " | ";
                        users.setName(rs.getString("NAME"));
                        DEBUG += "NAME: " + rs.getString("NAME") + " | ";
                        users.setSurname(rs.getString("SURNAME"));
                        DEBUG += "SURNAME: " + rs.getString("SURNAME") + " | ";
                        users.setBirthDay(rs.getDate("BIRTHDAY"));
                        DEBUG += "BIRTHDAY: " + rs.getDate("BIRTHDAY").toString() + " ---------- ";
                        usersList.add(users);
                   rs.close();
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
                   throw new Exception(e.toString() + DEBUG);
    //          throw new Exception(new Integer(usersList.size()).toString() + DEBUG);
    when use it:
         AllUsers AllU = new AllUsers();
    //     AllU.setConnection(myJdbc.getConnection());
         wdContext.nodeAllUsers().bind(AllU);
         wdContext.currentAllUsersElement().setConnection(myJdbc.getConnection());
         try {
              wdContext.currentAllUsersElement().modelObject().execute();
         } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    Hope can help.
    Bye

Maybe you are looking for