Add model node element

Hi all,
I've read very threads about this, but I'm not capable to do this:
I've a binded context to table from Model data from R3 like this:
I_Zrapp
-> proj
-> name
-> etc
After executing the bapi, in this table I can see the results correctly.
I need to add a row.
thans a lot,
david

Hi,
I need the previous step.
I've two FM. Read and update functions.
The first one, return a table results.
I will add in this table some information using webdynpro, and execute the function module to update.
I've implemented the addElement like a Node, but an errors appear.
thanks
david

Similar Messages

  • How to pass all values from one node element to created node element?

    Hi
    I have model node element under which there are 7 values, and I've created value node element and trying to pass the values from the model node Element to this value node element. But instead of passing all the values its listing only one value.
    How do we rectify this problem!!!
    Thanks in Advance
    Srikant

    Hi Anil
    I've created the node named: TableNode
    and the name of the node from which i want to get the data is : Li_Required_Node
    the Node Structure is
    Context
      |_ Zs_Quantity_Input
         |_Output
           |_Node_Required_Node
              |_Schddt
      |_TableNode
        |_CmpDate
    The Schddt has some 7 values
    The code Snippet is as follows:
    IPublicPricesComp.ITableNodeElement nodeElement;
    IPublicPricesComp.ILi_Required_NodeElement scheduleElement;
    int counter3Max = wdContext.ILi_Required_Node().size();
    for( int counter3= 0 ; counter3 < counter3Max ;counter3++ )
    nodeElement = wdContext.createTableNodeElement();
                             scheduleElement = wdContext.nodeZs_Quantity_Input().nodeOutput_Contract_Qty().nodeLi_Required_Node().getLi_Required_NodeElementAt(counter3);
    nodeElement.setCmpDate(scheduleElement.getSchddt());
    wdContext.nodeTableNode().addElement(nodeElement);               
    On writing the above code and then binding the node to a table column only one value getting displayed
    Where can be the error?
    Thanks in Advance
    Srikant

  • Validating the model node

    Hi Experts,
    I have a requirement of validating( changing field names and changing values based on the conditions) the model node and copy the required values into value node.
    Bacially , copying the model node elements to value node based on conditions.
    How can i do this anyone help me pleae.
    Regards,
    Suresh

    hi
               to get number of records from the model node
            catch the size of the Model Node .
             int n = wdcontext.nodeModelNode.size();
             for(int i=0;i<n;i++)
               wdcontext.nodemodelnode.setLeadSelection(i);
    String name = wdcontext.nodeModelNode.get<Model>elementatindex(i).getName();
    if (condition)
    fetch the data from the RFC and set in the value node as
    wdcontext.node<vauenodename>.invalidate();
    IPrivateviewname.Icomponentname ele = wdcontext.node<valenode>.createNode();
    ele.set(name);.
    and so on
    wdcontext.nodevaluenode.addelement(ele)
    Edited by: murali krishna  reddy on Apr 19, 2009 2:40 PM

  • How to add a new element to a model node in the view controller?

    View Context
        myNode
             attri1
             attri2
    myNode is a web service model node. How to add a new element to this node?
    Regards,
    Hui
    Edited by: Hui Wang on Feb 15, 2008 12:05 PM

    Sudhir Gorantla wrote:>
    > Hi,
    >
    > myNode
    > attri1
    > attri2
    >
    > IMyNodeElement ele=wdContext.myNode().createMyNodeElement();
    >
    > ele.setAttri1("");
    > ele.setAttri2("");
    >
    > wdContext.nodeMyNode().addElement(ele);
    >
    > Regards,
    > Sudhir
    Hi we need a model as an input parameter when creating a element for a model node. How to get the instance of the model?
    Regards,
    Hui

  • Creation of new element in Model Node

    Dear All,
    I am facing one problem, I have two  model node. I want to copy one model node to other model node.while copying its giving error saying the you can bind the element, coz target node doesn't have valid parent.
    Pl don't suggest me work on Value node.
    Can i create a element in model node at run time.
    Thanks & Regards
    Manoj Sahoo

    Hi Manoj,
                   Model node properties :
    1.A context model node makes a model object look like any other context node.  I.E. it gives the model object an API that is very similar to a value node.
    2.  A model node is not considered valid until it is bound to a corresponding model object.  Therefore, a model node always inherits its metadata from the model object to which it is bound.
    3. The element collection in a model node does not hold the actual runtime data!   Instead, it holds a list of references to the relevant model object instances.
    If u check the 2nd property, u will find the cause of ur exception. As u have already told, don't suggest to use value nodes, i don't have any other comment.
    regards
    Sumit

  • How can I create an element in the model node?

    Hi, Experts,
    I create a model node that name is containerNode in the contxt. Cadinility is: 1..n
    I write the code in the method:
      private String getDataForOutputTable( IWDNode wageTypePayslip, IWDNode containerNode ){
           String betrgSumStr = "";
         int index = 0;
         Vector containerVector = new Vector();
         int size = wageTypePayslip.size();
         IWDNodeElement element = containerNode.createElement();// The system report error when I run the application.
         BigDecimal betrgSum = new BigDecimal( 0 );
    I try to create a element in the containerNode, But the system report error when I run the application.
    java.lang.IllegalArgumentException: model object must not be null
         at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.<init>(ModelNodeElement.java:66)
         at besuretech.com.wdp.IPrivatePayDataDispView$IOContainerElement.<init>(IPrivatePayDataDispView.java:1537)
         at besuretech.com.wdp.IPrivatePayDataDispView$IContextNode.doCreateElement(IPrivatePayDataDispView.java:88)
         at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:884)
         at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1351)
         at com.sap.tc.webdynpro.progmodel.context.Node.createElement(Node.java:1370)
         at besuretech.com.PayDataDispView.getDataForOutputTable(PayDataDispView.java:251)
         at besuretech.com.PayDataDispView.getAllData(PayDataDispView.java:196)
         at besuretech.com.PayDataDispView.onPlugPayListViewIn(PayDataDispView.java:154)
         at besuretech.com.wdp.InternalPayDataDispView.wdInvokeEventHandler(InternalPayDataDispView.java:391)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.navigate(ClientApplication.java:826)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.navigate(ClientComponent.java:881)
         at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doNavigation(WindowPhaseModel.java:498)
    How can I create an element in the model node ?
    Best regards,
    tao

    Hi,
    You need to execute the model before creating the element.
    Regards
    Ayyapparaj

  • Add value to model nodes

    hi all,
    I have to populate a model node and execute the RFC so that its updated at the backend and the nodes are once again refreshed.
    <b>It_Prcgprdg()</b> is the model to which i have to add the record which should be added in the backend and the outputnode should be refreshed.
    here's my code.
        IPrivatePriProdGrpView.IIt_PrcgprdgElement prod = wdContext.createIt_PrcgprdgElement(new Zsd_Pmt_S_Prcgprdg());
       wdContext.nodeIt_Prcgprdg().validate();
       prod.setZprigrp(wdContext.nodeEt_Pricegrp_out().getEt_Pricegrp_outElementAt(lead1).getZprigrp());
       int Size = wdContext.nodeEt_Prodgrp_out().size();
      for( int i = 0; i< Size;i++)
        int lead = wdContext.nodeEt_Prodgrp_out().getLeadSelection();
        if(wdContext.nodeEt_Prodgrp_out().isMultiSelected(i) || lead == i )
        prod.setZchngusr(Username);
        prod.setZprodgrp(wdContext.nodeEt_Prodgrp_out().getEt_Prodgrp_outElementAt(lead).getZprodgrp());
        wdContext.nodeIt_Prcgprdg().addElement(prod);
    wdThis.wdGetPricingGrpCompController().execute_RFC();
    Please correct if my code is wrong.
    Thanks in advance,
    Gopi

    Hi bala,
    <b>Zsd_Pmt_Pricegrp_Rfc_Input input1 = new Zsd_Pmt_Pricegrp_Rfc_Input();
           wdContext.nodeZsd_Pmt_Pricegrp_Rfc_Input().bind(input1);
       int lead1 = wdContext.nodeEt_Pricegrp_out().getLeadSelection();
       int outSize = wdContext.nodeEt_Prodgrp_out().size();
      for( int i = 0; i< outSize;i++)
        int lead = wdContext.nodeEt_Prodgrp_out().getLeadSelection();
        if(wdContext.nodeEt_Prodgrp_out().isMultiSelected(i) || lead == i )
       //Zsd_Pmt_S_Prcgprdg prod is the struc of It_Prcgprdg
       Zsd_Pmt_S_Prcgprdg prod = new Zsd_Pmt_S_Prcgprdg();
         prod.setZchngusr(Username);
         prod.setZprigrp(wdContext.nodeEt_Pricegrp_out().getEt_Pricegrp_outElementAt(lead1).getZprigrp());
       prod.setZprodgrp(wdContext.nodeEt_Prodgrp_out().getEt_Prodgrp_outElementAt(lead).getZprodgrp());
        input1.addIt_Prcgprdg(prod);
      wdContext.currentZsd_Pmt_Pricegrp_Rfc_InputElement().setIv_Zoperation("P");
        wdThis.wdGetPricingGrpCompController().execute_RFC();</b>
    I have written the above code in the <b>onActionAddProduct</b> method of the iview. I need to add the products to backedn when user clicks the buttonADD.
    <b>Zsd_Pmt_Pricegrp_Rfc_Input input1 = new Zsd_Pmt_Pricegrp_Rfc_Input();
           wdContext.nodeZsd_Pmt_Pricegrp_Rfc_Input().bind(input1);
    <b>Zsd_Pmt_Pricegrp_Rfc_Input input1 = new Zsd_Pmt_Pricegrp_Rfc_Input();
           wdContext.nodeZsd_Pmt_Pricegrp_Rfc_Input().bind(input1);
    <b>Zsd_Pmt_Pricegrp_Rfc_Input</b> node i have already initialized in compcontroller as
    Zsd_Pmt_Pricegrp_Rfc_Input inpri = new Zsd_Pmt_Pricegrp_Rfc_Input();
           wdContext.nodeZsd_Pmt_Pricegrp_Rfc_Input().bind(inpri);
    Still i am unable to update the data. Do i need to write the code in compcontroller only?
    <b>Iv_Zoperation</b> is the import parameter in RFC. i need to send this as "P".
    Please suggest me.
    gopi
    Message was edited by: gopi nidjelli

  • How to bindi a UI element to 2 model nodes different in the same view

    I want to know how I can bind a set of inputfields, in a form view, to 2 different model nodes ?
    <u>example:</u>
    Im working with 2 adaptional RFC, both working, in my Custom Context.
    Ztest_Search
    Ztest_Update
    In my ResultView I have 2 Model nodes (one for each RFC) I show a set of inputfields in a form view, binded to the Ztest_Search_output of Ztest_Search. This works.
    now I want to update the changes, but I can't find the ways of binding the same inputfields to my other Model node (Ztest_Update) in the context of ResultView.
    Note: If I create a duplicate set of inputfields , one for Ztest_Search binded to the Ztest_Update_output and the other to the Ztest_Update_Input Works. But I wanna avoid this duplicated set of inputfields.
    Thx

    Rodrigo,
    If I understood correctly, your problem is to get the data from the input fields which are bound to a
    model node, Ztest_Search_output and set it to the model node of another RFC, Ztest_Update.
    This can be done by getting the suitable values from the model attributes of Ztest_Search_output
    and setting it to Ztest_Update.
    <b>/**
    * valueOne, valueTwo are the name of the model   
    * attributes that are bound to the Input fields.
    */</b>
    String firstValue = wdContext.currentZtest_Search_outputElement
         ().get<valueOne>;
    String secondValue = wdContext.currentZtest_Search_outputElement
         ().get<valueTwo>;
    Ztest_Update_Input update = new Ztest_Update_Input();
    wdContext.nodeZtest_Update_Input().bind(update);
    <b>/*
    *<b>Zstructure is the structure of the model node under
    *Ztest_Update_Input to which the values have to be 
    *updated.</b>
    */</b>
    ZStructure structure = new ZStruture();
    structure.setValueOne(valueOne);
    structure.setValueTwo(valueTwo);
    update.addZStructure(structure);
    try
       update.execute();     
    catch (Exception ex)
       wdComponentAPI.getMessageManager().reportException(ex.getMessage(), false);                     
    wdContext.nodeZtest_Update_Output().invalidate();
    Bala

  • Unable to add value to model node with cardinality 0..n

    Hi All,
       Im working with Webdynpro Java.i have an issue here.i have a input field item named customer and a drop down box item location.when i give customer and location as inputs,a WSDL (named Equipment WSDL) is called.the result is a  drop down list containing equipments id
    i took a custom node location with cardinaliy 0..n.i gave static values as input for location.i need to set the location values to model node location.when i m giving a single value to custom node location,that static value is not accepted by model node location(in WSDL) whose cardinality is 0..n.
    Please suugest a solution for this issue
    With Regards,
    Ushasri.

    HI Ushashri,
    What do you mean by 'static value is not accepted by model node location'
    how you have done the mapping
    send me the hierarchy of rfc and ur value node
    With Regards
    Naidu

  • How to add a new Element to the Context

    Hello all.
    I created in the wdInit()
    ArrayList datas = new ArrayList();
         for (int i = 0; i < 25; i++) {
              MyData data = new MyData();
              data.setMethods();
              datas.add(data);
         wdContext.nodeMyData().bind(datas);
    Now, I want by clicking on the Button "Create new Element", forward user to the other View, which elements are connected with the same model -> context, the new element should be added to context, the user should fill the form and click Save-Button.
    How can I add a new Element to the Collection I created and choose it as a current element?
    If I do: wdContext.nodeMyData().bind(new MyData()) all information will be lost. And I will have only one field.
    If I do it like this:
    IWDNodeElement dynTabElem=(IWDNodeElement)wdContext.nodeMyData().createElement();
    wdContext.nodeMyData().addElement(dynTabElem);
    I get an error: com.sap.tc.webdynpro.progmodel.context.ContextException: NodeInfo(DataComp.MyData): value node is created without a reference
    Well I can pass to my new View a Collection as a parameter and then
    Collection.add(new MyData()) and then bind it. But I find this solution not good.
    Is there any possibility to get the existing Collection from the Context without passing it to the view?
    Can I just add a new element to the existing collection?
    Thanks in advance.

    Hallo Monalisa,
    I did as you said. But I can't add something to my model class, because it is not collection.
                            MyData data = wdContext.currentBelegElement().modelObject();
                   data.add() ???? - don't work
                   wdContext.nodeMyData().invalidate();

  • Problem in mapping model node with cardinality

    Hi,
    I have a requirement where the RFC  which is being called has cradinality 0..n.
    I imported the RFC model in a different DC and then added the model to public part.
    Then, I used that model in the second dc.
    Now, I did context mapping with the component controlller by dragging the model context to the
    component controller. The view is also mapped with the component controller.
    The RFC has input field BUS_PART_NO which is a 12 character input field.
    I passed String in it.
    There is no error while I build the DC. But while I run the application, the input field is coming Read Only.
    I can't changed the component controller to 1..n or 1...1.
    I think I need to create a context node and attribute in the view or component controller and then programmatically add this
    to the model node.
    Please send some SDN links and urls.
    Regards
    Neha Singh

    Hi Neha,
    Please create the custom context node/attribute same structure as RFC model node. then populate the data using below following code :
    - get the size of the RFC model node which you want to populate in the costom node like
    int xxx =  wdContext.node<XXX node>().size;
    - Create onject for custom node like
      I<Custyom Name>Element element = null;
    -  then use for loop for fetching data from Model node and populate in custom node
    for(int i =0; i<xxx; i++)
             element = wdContext.create<Custyom Name>();
             element.set<Attribute Name>(wdContext.node<XXX>().get<XXX>ElementAt(i).get<>Attribute name for model())
             wdContext.<Custyom Name>().addElement(element);
    It will populate in your custom node from model node.
    Hope it will helps you.
    Regards
    Arun

  • Setting max length of the field when using Context Model Node

    I have created a model using Import Adaptive Web Service model option (a web service was a wrapper around SAP BAPI function module).
    There were no dictionary types created in the Local dictionary as a result of import.
    I have mapped the context of the controller to the model node.
    One of the fields in the model is name     CUSTOMER_NUMBER type string;
    Corresponding element in the wsdl of the web service is
    <xsd:element name="CUSTOMER_NUMBER" type="tns:char10" />
    I have created a view with the input filed mapped to the CUSTOMER_NUMBER field of the model node.
    When I type more than 10 chars into the field and hit the search button, I get a com.sap.dictionary.runtime.Ddcheck exception that the length of the field should be less than 10 chars.
    How can I set the max length of the field in design time to prevent runtime exception?
    Thanks,
    Julia

    Thank you for your reply.
    Java trim function will trim the white spaces only, not the characters.
    I can code check length functionality before calling execute function (the function that call the web service).
    I can also create a dictionary structure based on the model structure; create a context value node based on the dictionary structure and use WDCopyService API to move the data between value node and model node.
    I was looking for the best practice...
    When importing model based on Adaptive RFC, the dictionary structures are imported together with the model. This does not happen for Adaptive web service - hence there is a need to add coding for simple checks.
    Julia

  • CopyCorresponding to model node

    Hi,
    i have following problem:
    I have a context node with cardinality 1:1. This node should be copy to a model node as input for the rfc function. the model node has the cardinality 0:1
    I try copy with:
    WDCopyService.copyCorresponding(wdContext.nodeContextNode().currentContextNodeElement(),
              wdContext.nodeModelNode().currentModelNodeElement());
    But  wdContext.nodeModelNode().currentModelNodeElement() is NULL after this statement.
    I think because of the cardinality 0:1, there is no current...... Element..!?

    Hi Christopher,
    Before the code:
    WDCopyService.copyCorresponding(wdContext.nodeContextNode().currentContextNodeElement(),
    wdContext.nodeModelNode().currentModelNodeElement());
    add following code:
    wdContext.nodeModelNode().createModelNodeElement();
    Regards,
    Gopal

  • WebService Model Node

    Hi experts,
    I have worked with WebDynpro Java. There is it possible to create a WebService Model with a Wizzard. After that you can
    drag and drop Model Nodes to the context node and view and bind them to a view.
    Is this not possible in abap? Have I to create all Nodes and attributes by my own without wizzards support?
    This could be a lot of work for a complex service 
    Thansk in advance

    Hi SAP User,
    In Webdynpro ABAP you can not drag and drop to the context node to create them, but you can use a wizard to add Nodes with a certain data dictionary structure.
    Since the Webservice (you probably mean BAPI / Function Module) is always using data dictionary elements/structures as importing and exporting parameter, it might be more work as in Webdynpro Java but it's still relatively fast..
    So you have some kind of wizard support, but not as complete as in Java.
    Regards,
    Roelof

  • How can I create a model node in SAP Records Management

    Product: SAP Records Management
    Hi,
    I would like to create a model node in a record tree.
    I found in the function modul BAPI_RECORD_ADDELEMENT no entry for the creation of a model node. Only the instance and the structure node can create by this function modul.
    So, does anyone know a solution to create a model note?
    Regards,
    Thomas Fanninger

    Hi Thomas,
    it is not possible with the BAPI due to the piece of coding:
    case  myElementType.
            when glob_const_elem_type_instance.
              myRecordElement->Type_Set( if_srm_sp_record_element=>type_instance ).
              myRecordInstanceElement ?= myRecordElement.
              loop at element_sp_poid into myElementSpPoidWa.
                mySpPoidWa-id = myElementSpPoidWa-name.
                mySpPoidWa-value = myElementSpPoidWa-value.
                insert mySpPoidWa into table myElementSpPoidTab.
              endloop.
              myElementSpsId = sps_id.
              myElementPoid = myClientService->poid_get_instance( im_rms_id  = myRmsId
                im_sps_id  = myElementSpsId  im_sp_poid = myElementSpPoidTab ).
              myService->check_sp_connection( myElementPoid ).
              myRecordInstanceElement->poid_set( myElementPoid ).
            when glob_const_elem_type_folder.
              myRecordElement->Type_Set( if_srm_sp_record_element=>type_folder ).
            when others.
              perform set_error using '852' return.
              return.
          endcase.
    But you can do that by using directly the Records API. How to use this is demonstrated in the report 'SRM_RECORD_API_HOWTO'. Search there for the subroutine 'fillrecordelement'. There a record element for insert is created and its type is set. You can set the type there to 'IF_SRM_SP_RECORD_ELEMENT~TYPE_MODEL'. Of course your POID then may not be an instance POID.
    Best regards,
    Thomas

Maybe you are looking for

  • Simple line graph problem

    Hi there, I want to create a very simple line graph, containing 1 line. Therefore i create a Graph.LINE_VERT_ABS type Graph and add the data using myGraph.setLocalRelationalData(al ArrayList). This arraylist contains values in the form of setname jan

  • I have a subscription to Acrobat XI Pro, I thought that gave full access to FormsCentral Plus?

    I have a subscription to Acrobat XI Pro, I thought that gave full access to FormsCentral Plus. Is this correct? It shows that I only have 1 online form available.

  • T Code for report of PR PO GRN

    Hi Gurus I want the report that will give me all PR PO and GRN chin so is ther is any report and its T code?? Thanks Avahut

  • Renaming a report title

    Post Author: saman700 CA Forum: .NET Hi experts, I need to deploy some report files to the BO server but before, I need to find out if any report with the same title already exists inside the server and if there's any, i need to rename it's title (th

  • Layer Mask Thumbnail Option

    I'm using PSE 11 and layers masks.  If you click on the layer mask thumbnail you have the option of "add mask to selection" and "intersect mask to selection".  They both select the same area of the photo. So I use the help menu and go online and type