How to set a attribute value of a sub node binded to a table.. pls respond.

Hi friends,
I have context defined like this.
     Head_node ( table 1)
          Item_node ( table 2, sub node ).  ( now this im saving in global internal table).
so now when i hit save button, im passing my internal table (it has col1- sales order no, col2 item details(table type, which can have more than one record) to a FM, to create sales order.
My sales order is getting saved.
But the function module will return some new values (like sales order number, item number etc).
Now i want these values to be updated in my context.
Meaning whenever after that i do get_attribute, i should get these new (sales order no, item no ) also.
I dont know how to set the context values of sub nodes , so im missing these values.
kindly respond back to me..
thanks in advance,
Niraja

Its very simple.
Follow these steps. e.g you want to get the new sales order number. Define a attribute in ur node (or set of attributes in ur case as per reqruirement) say new_so_number.
Check your FM, if its returning new_so_number then it's fine, otherwise you have to change the FM to return the new_so_number or you have to get from db table somehow, which best suites your req.
So once you have new_so_number after calling the FM, say in lv_new_so_number field. Then write this code to set the attribute (change the variables as per your context attributes)
DATA lo_nd_head TYPE REF TO if_wd_context_node.
  DATA lo_el_head TYPE REF TO if_wd_context_element.
  DATA ls_head TYPE wd_this->element_head.
  DATA lv_new_so_number LIKE ls_head-new_so_number.
* navigate from <CONTEXT> to <HEAD> via lead selection
  lo_nd_head = wd_context->get_child_node( name = wd_this->wdctx_head ).
* get element via lead selection
  lo_el_head = lo_nd_head->get_element(  ).
lv_new_so_number = new_so_number. " (You got this as a exporting parameter of FM etc..)
* get single attribute
  lo_el_head->set_attribute(
    EXPORTING
      name =  `NEW_SO_NUMBER`
      value = lv_new_so_number ).
Hope it works.

Similar Messages

  • How to set a date value at netui:hidden/ tag bind to a RowSet item/property through a form bean?

    Hi,
    I have the following urgent problem.
    I created a pageflow which uses a form bean (created with a db control) to insert
    values in a table. I overcame the disability to insert date values in the table
    by converting this columns to string values in the table. But now I have to insert
    a sysdate in a column that holds the row sampled date. How is it possible? I used
    javascript without an success.
    Code in jsp:
    document[getNetuiTagName("myForm",this)][getNetuiTagName("date",this)].value=new
    Date();(have used string values too)
    <netui:hidden dataSource="{actionForm.sampled}" tagId="date"/>
    Code in .jcx file
    <xsd:element name="SAMPLED" type="xsd:dateTime" wld:JDBCType="DATE" minOccurs="0"
    wld:TableName="theTable" nillable="true">
    * </xsd:element>
    Code in .jpf file
    * <pageflow-object id="formbeanprop:portlets.Career.Submit_CV.Submit_CVController.DatabaseForm#sampled#java.sql.Timestamp"/>
    public static class DatabaseForm extends RowSetForm
    public java.sql.Timestamp getSampled()
    return sampled;
    public void setSampled(java.sql.Timestamp newOne)
    registerChange("sampled");
    this.sampled = newOne;
    I have tried to use java.sql.Date too...
    Any help would be very appreciated.
    Thx,
    Vincent

    Hi,
    Hope You're using the template.fmb.
    If  your Custom Form is in INV module, use  'FND_ORG.CHOOSE_ORG;' in the pre-form.
    Else Set the org id dynamically,
    begin
        MO_GLOBAL.SET_POLICY_CONTEXT(ACCESS_MODE,ORG_ID);
    end;
    Example:
    begin
        MO_GLOBAL.SET_POLICY_CONTEXT('S',101);
    end;
    S - Denotes that the current session will work for Single Org_id (101)
    M - Denotes that the current session will work for Multiple Org_id
    Thanks

  • How to set a default value in dropdown list in Wendynpro ABAP? Help!

    Hi Experts,
           I have Webdynpro for ABAP application that shows a DropdownwithKey UI element.
    1. I am able to populate the dropdown list. But by default the list is not showing any value. Only when I select a value from the list then it shows it.
    So how to set the default value to the first value in the list? Any code sample will be really helpfull.
    I have written the following code:
    method WDDOINIT .
      DATA:
        node_category TYPE REF TO if_wd_context_node_info.
      node_category = WD_CONTEXT->GET_NODE_INFO( ).
      node_category = node_category->GET_CHILD_NODE( 'CATEGORY' ).
      data:    LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST,
               L_VALUE type WDR_CONTEXT_ATTR_VALUE.
    L_VALUE-VALUE      = 'V1'.
    L_VALUE-TEXT    = 'yesterday'.
    INSERT L_VALUE into table LT_VALUESET.
    L_VALUE-VALUE      = 'V2'.
    L_VALUE-TEXT    = 'today'.
    INSERT L_VALUE into table LT_VALUESET.
    L_VALUE-VALUE      = 'V3'.
    L_VALUE-TEXT    = 'tomorrow'.
    INSERT L_VALUE into table LT_VALUESET.
    node_category->SET_ATTRIBUTE_VALUE_SET(
                 NAME = 'CAT_VALUE'
                 VALUE_SET = LT_VALUESET ).
    endmethod.
    Note that: I am using webdynpro for ABAP.
    Thanks
    Gopal

    I am not sure how it works in Web Dynpro for ABAP, but in Web Dynpro for Java to set default drop down value you will have to set the value for particular attribute (which is linked to the dropdown element)  in the context
    like
    wdContext.currentContext<nodeName>Element.set<FieldName>(<defalut value>)
    This generally done in Initialization method of the controller.

  • How to set a default value in Select one choice.

    Hi
    I'm using ADF BC, in that how to set a default value in select one choice.
    pls. help on this.
    regards

    set the default value on the underlying EO or VO attribute
    john

  • How to set a default value to t-list when creating t-list programmatically

    hi,
    I'm creating a t-list programmatically
    by calling
    n = populate_group('groupname');
    populate_list('form.list','groupname');
    In this case how to set a default value for the t-list
    thanks
    rani

    I am not sure how it works in Web Dynpro for ABAP, but in Web Dynpro for Java to set default drop down value you will have to set the value for particular attribute (which is linked to the dropdown element)  in the context
    like
    wdContext.currentContext<nodeName>Element.set<FieldName>(<defalut value>)
    This generally done in Initialization method of the controller.

  • How to set a default value for particular field in SRM PO Portal

    Dear Gurus,
    Im desparetly need a help in web dynpro on how to set a default value for a field(flag) in PO header tab in portal.
    My requirement is whenever the user press the edit button in PO screen,automatically a flag field should be set as abap_false.
    I dont think this will handle in check badi or change badi. i tried this part in onbuttonpressed overwriteexit in CNR_VIEW views,i can get the function EDIT in debugging mode,but dont know how to proceed further.....
    Many of them suggested to go with get attribute and set attribute for changing any particular field in web dynpro,but im not very familiar in using those get and set attributes.I request you people can give me sample code on how to identify my target field in the node and set the values while pressing EDIT Button.
    Thanks in advance...
    Regards,
    Sathish

    Dear Laurent,
    Thanks for your response,
    But i searched in enhancement spot of WD_BADI, but couldnt get the exact way to change the coding,
    My real requirement is, that particular flag should be enable and disable dynamically by checking a condition in my header values.So in that case i dont know how to proceed further to handle in the PO screen.
    Kinly guide me how to get the particular node of field in the Purchase order screen.
    Thanks you in advance,
    Sorry for the inconvenience if any
    Regards,
    sathish

  • How to set hidden field value in form?

    I've encountered a problem while developing a forum using JSF. See this code:
    <h:form id="commmentForm" formName="commentForm" >
         <h:input_hidden id="pageId" valueRef="CommentBean.pageId" value="${article.id}"/>
         <h:input_text id="userName" valueRef="CommentBean.userName"/>
         <h:input_text id="userEmail" valueRef="CommentBean.userEmail"/>
         <h:input_text id="userURL" valueRef="CommentBean.userURL"/>
         <h:input_textarea id="content" valueRef="CommentBean.content"/>
         <h:command_button id="submit" label="Leave A Comment" commandName="submit" actionRef="CommentBean.createAction" />
    </h:form>
    I was trying to specify a hidden field that represents the unique ID number of the current article using <h:input_hidden> tag above. But RI complains that runtime expression is not permitted in 'value' attribute. So I set the attribute 'value' to arbitrary number such as '2', but it seems that CommentBean.pageId is still null.
    So the question is:
    1. Why can't I use EL in JSF tags attributes?
    2. How can I resolve my problem mentioned above?
    Thanks very much in advance!

    To solve the problem, you have to use two hiddenfields, say:
    <h:input_hidden id="pageId"valueRef="CommentBean.pageId" />
    <h:input_hidden id="articleId" valueRef="article.id"/>
    I want to set the value of CommentBean.pageId to
    ${article.id} (article is not a managed bean) and to
    let CommentBean.createAction insert a database row
    whose page_id column is ${article.id}, so I think the
    tags you suggested won't work for me.Why can't you interrogate your ComponentBean for its pageId property during your invoke() method? By the time your invoke() method is called, the value from the hidden field will have been pushed to the model, so this should be no problem. You could do Application.getValueBinding("ComponentBean.pageId").getValue() to do so.
    Ed

  • How to set an attribute while creating an XML?

    Hi All,
    I am required to create an XML in the following manner :
    here  <ITEMS ITEMCOUNT="2"> where ITEM is an element and itemcount=2 is the attribute which means their are 2 line items
    - <HEADER>
      <PR_NO>sap pr no</PR_NO>
      <REVISION_NO>0</REVISION_NO>
       </HEADER>
    - <ITEMS ITEMCOUNT="2">
    - <ITEM>
      <PR_LINE_NO>1</PR_LINE_NO>
      <ITEM_DESCRIPTION>Security Locks</ITEM_DESCRIPTION>
      </LOCATIONS>
      </ITEM>
    </items>
    Please suggest how to set the attribute ITEMCOUNT?
    Thanks,
    Lina

    I am also trying to do something similar to this.  I tried the suggestion given but it still only allows 1 parameter.  A snippet of my .icd file is below.
    Attribute (ROI Settings) {
    Value (Integer) {
    Min (0)
    Max (79)
    Increment (1)
    Display {
    Multiplier (8.000000)
    Offset (0.000000)
    Precision (0)
    Units (Pixel)
    Default (0, 0, 0, 0)
    Current (0, 0, 0, 0)
    Action (Serial) {
    Command (ROI %d, %d, %d, %d\r)
    Response ()
    Timeout (1000)
    Delay (100)
    Any answer or help is appreciated.
    Thanks,
    Bruce

  • SRM 4.0- How to set the default values for product type (01) only for SC

    The radio button “Service” should not be visible.
    Also for search help (e.g. search for internal products) where a search should only be possible for product type 01 (goods). The system should not display the product type and internally always search for goods only.
    How to set the default values for product type (01) only for SC
    We needs to use Search help BBPH_PRODUCT which having parameter PRODUCT_TYPE
    Here we can set defalut value 01 but it is not correct one since same search help is using several places.
    We need to limit the search help results only for SC.
    Kindly help out me ASAP.

    The easiest way to set defautl values is to edit the batch class.
    Goto the characteiristic and go to update values.
    In here you probably have something like 0 - 100 as a spec range.
    On the next line enter the default value within this range.  At the end of the line, click in the box in the column labelled "D".  This indicates the defautl value for the characteristic.
    If you need to you can do this in the material classification view as well.
    Just to be clear, these values will only show up in the batch record.  You can not have defautl values in resutls recording screens.
    FF

  • How to set a variable value on the BPC Data Manager

    Hello BPC Experts,
    I'm creating a BPC10 NW version demo environment for our prospect customer.
    I made a data manager to import  BW data into BPC model from BW cube.
    I need to import just one month data into BPC from the BW cube that has more than one month data.
    When I run the data package manually, I can select a member of the time dimension prompt and I can import specific month data I want.
    But, in a case where the program (data manager) runs by JOB monthly,
    I can't select a member of the time dimension prompt manually.
    So I want to know how to set a  variable value to the time dimension prompt from a system date etc. automatically.
    Are there any way to set a variable value to the time dimension prompt on the data manager automatically from a system date?
    Or, do you have any other solution to import just one month data into BPC from the BW cube that has more than one month data  by the data manager running on JOB ?
    (without selecting a member of the time dimension prompt of the data package manually)
    Thanks in advance,
    Keisuke

    Hi Gersh
    Sorry for my late reply and thanks for your helpful information.
    I tried the second way of your information and I could configure it.  
    And I 'll try first way of your information.
    Regards,
    Keisuke

  • How to set a default value in a DateTime field?

    Hi!, how do you set a default value in a DateTime field in a user table to the value of "today"?
    Thank you!

    It's in SAP Business One 2007, in User-Defined-Fields, under User Tables, Iam trying to add a field to a Table I created in the User-Defined-Tables-Setup menu.
    I click Add then type the field name, description and then I select the Type, which is DateTime, then the SelectDefault Value For Field get's grayed out.
    Thank you!

  • How to set a Default Value in the drop down on Account Creation ?

    Hi,
    i have to set a default value in the drop down as soon as a User in a particular business role clicks on New Account. I have written the following code in do_prepare_output method. But this code is executed in the 2nd server round trip after entering some value or pressing enter. so i am not getting as soon as user clicks on the New Account.
    How to set that default value when user clicks on New Account ? and where should i code ?
      IF lv_icwc_profile = 'ZCSALESPRO' or lv_icwc_profile = 'Z_SALESPRO' .
      try.
                  lr_entity ?= me->typed_context->header->collection_wrapper->get_current( ).
                  lv_current = lr_entity->create_related_entity(
                                                  iv_relation_name = 'BuilRolesRel' ).
                                 lv_current->set_property(
                                    iv_attr_name = 'PARTNERROLE'
                                    iv_value     =  'BUP002' ).
                   CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
                   cx_crm_genil_model_error.
                   return.
            ENDTRY.
    Thanks and Regards
    Raman Khurana

    Hi,
    I have some idea abt it, it is also used in account life cycle.
    Please refer SAP note 1097651, Defaulting a life cycle stage.
    Let me know if useful.
    rgds,
    Vinay

  • How to set a object value bound to a session to JavaScript variable

    In a JSP, I store an object value in a HttpSession and I also write a Javascript function to display something on the screen. I need to use the Javascript function to display the object value which is stored in the session. How to set the object value to variable of the JavaScript function. Thanks.

    I write a class JavaScriptHelper to convert the object value to variable of the JavaScript;
    1.get the data to a javabean from database;
    2.convert the data to variable of the JavaScript as a String ;
    3.store the object in a HttpSession or Httprequest ;
    4.use in Jsp get the String (variable of the JavaScript )
    YourBean bean = (YourBean) request.getAttribute("model");
         if (bean != null) out.println(bean .getJsCode())
    convert function,(this is only for the matrix):
    public static String formatJsCode(Vector vector) {
    String sJsCode = "";
    //get js head
    sJsCode = getJsHeader();
    //define js array;
    sJsCode += "var data=new Array();\n";
    Vector v = null;
    String sTemp = "", sLine = "";
    for (int i = 0; i < vector.size(); i++) {
    v = (Vector) vector.get(i);
    sLine = "";
    for (int j = 0; j < v.size(); j++) {
    sTemp = (String) v.get(j);
    //replace " to \"
    sTemp = sTemp.replaceAll("\"", "\\\\\\\"");
    //escape Html Tag
    //sTemp = StringUtil.escapeHTMLTags(sTemp);
    //replace \r\n to <br>
    sTemp = sTemp.replaceAll("\r\n", "<br>");
    if (j != 0)
    sLine += ",";
    sLine += "\"" + sTemp + "\"";
    sJsCode += "data[" + i + "]=new Array(" + sLine + ");\n";
    //get js foot
    sJsCode += getJsFooter();
    return sJsCode;
    public static String getJsHeader(){
    return "<script language=\"JavaScript\">";
    public static String getJsFooter(){
    return "</script>";
    }

  • How to set a new value for formula field in crystal reports xi?

    <p>How to set a new value for formula field in crystal reports xi?</p><p>//formula</p><p>{@description}</p><p> </p><p>exemplo in VB6</p><p>crxSubreport.FormulaFields.Item(1).Text =  "&#39;Subreport Formula&#39;"  or</p><p>crxSubreport.FormulaFields.Item("description").Text =  "&#39;Subreport Formula&#39;"</p><p>How to in JRC?</p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p>

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • How to set a Object value by JDI

    How to set a Object value using JDI?
    For example:
    class User{
      private String name;
      private String id;
    set and get method;
    public static void main(String[] args) throws Exception {
            VirtualMachineManager vmm = Bootstrap.virtualMachineManager();
            List<AttachingConnector> connectors = vmm.attachingConnectors();
            SocketAttachingConnector sac = null;
            for (AttachingConnector ac : connectors) {
                if (ac instanceof SocketAttachingConnector) {
                    sac = (SocketAttachingConnector) ac;
                    break;
            if (sac == null) {
                System.out.println("JDI error");
                return;
            Map<String, Connector.Argument> arguments = sac.defaultArguments();
            Connector.Argument hostArg = arguments.get("hostname");
            Connector.Argument portArg = arguments.get("port");
            hostArg.setValue(HOST);
            portArg.setValue(String.valueOf(PORT));
            vmMachine = sac.attach(arguments);
            List<ReferenceType> classesByName = vmMachine.classesByName(CLSNAME);
            if (classesByName == null || classesByName.size() == 0) {
                System.out.println("No class found");
                return;
            ReferenceType rt = classesByName.get(0);
            List<Method> methodsByName = rt.methodsByName(METHODNAME);
            if (methodsByName == null || methodsByName.size() == 0) {
                System.out.println("No method found");
                return;
            Method method = methodsByName.get(0);
    I will connect to server and monitor the remote server JVM , There is a object of User, I want to change its value by the Java Debugger Interface by client.
    so how to set its value by the client, and I can not got the User bean at client.
    I know the basic type filed value changed as follows:
    Value newValue = vmMachine.mirrorOf("change var value");// this field is a string.
    stackFrame.thisObject().setValue(field, newValue);
    But a Object , how can I change its value.
    Thanks Advanced.

    ObjectReference.setValue() is the method for chaining the value of an Object's field. First you need to find the specific Object you want to change, though.
    /Staffan

Maybe you are looking for

  • Officejet pro 8600 plus e-all-in-one color managment problem.

    please help, I'm a photographer and I own officejet pro 8600 plus e-all-in-one printer. I want to print my photos using this printer, but it never print them right, so I bought Colormunki photo to calibrate my monitor and my printer and match them to

  • Printer not printing black Ink

    My printer is not printing black colored ink. The cartridge is brand new and when I touch the ink pad on it, it saturates black so I know that it's not an issue with the cartridge. I have the HP Photosmart 5510

  • Sales doc type

    Hi, If in a business having Plant Sale,Depot Sale & Export slaes then I have to create one sales doc  type-ZOR1 for all types of sales & one document catgory & one pricing procedure.,Please give me the solution. Thanks, Siku.

  • Best router for a macbook experiencing connection timeouts?

    Hi all, I know macbook wireless connection issues have been discussed to death already, but I have a slightly different question and with Black Friday looming, I was hoping to get some input from those who may have had success with finding a new rout

  • Best way to work with large image sequences

    Hello, Im relatively new to Adobe CS4. I am learning to create detailed animations with another software that produces thousands of still images. (I normally save them as  .png, 720 x 480, 29.97 fps) I spent the money to buy CS4 becuase I was told th