Access a value attribute under a value node

Hi guys,
Could you please help me on this one. I need to access value attributes that are under a value node?. I use the following codes and I always have the error "java.lang.NullPointerException ".
1) wdThis.wdGetContext().currentMyValueNodeElement().getMyAttribute();
2) wdContext.currentMyValueNodeElement().getMyAttribute();
Thanks in advance
Franck

HEre is an example where I'm pulling a value from a value attribute where the Node is a table.  "Ytdsl" is the actual value attribute name.
          //      Get the total  from the last line of the table
          String sx =
               wdContext
                    .nodeChannelList()
                    .getElementAt((wdContext.nodeChannelList().size() - 1))
                    .getAttributeValue("Ytdsl")
                    .toString();
Regards,
Rich Heilman

Similar Messages

  • Access to an attribute of a value node of a component controller

    Hello experts,
    I'm new to the area of SAP CRM Web Client UI development. My problem is probably very simple and you will surely smile about it.
    I have created my own component with the value node FILE (that consists of five atributes) in the component controller. Unfortunately I have not figured out yet how I can access the value of an attribute.
    The first thing I do not know is where I can find the controller-ID.
    In addition, I get an syntax error Field "TYPED_CONTEXT->FILE->COLLECTION_WRAPPER->GET_FIRST(" unknown in the line with "lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).".
    Currently no functionality is included in my code, because firstly I want to understand the basics.
    method OP_FILEUPLOAD.
      data lo_entity       type ref to if_bol_bo_property_access.
      data lv_file_name    type string.
      data lr_file_content type ref to data.
      field-symbols <lv_file_name> type string.
      IF ( comp_controller is INITIAL ).
        get_controller( 'xxxx' ).
      ENDIF.
      lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).
      while lo_entity is bound.
        lv_file_name = lo_entity->get_property_as_string( 'FILE_NAME' ).
        lr_file_content = lo_entity->get_property( 'FILE_CONTENT_STRING' ).
        assign lr_file_content->* to <lv_file_content>.
        lo_entity = me->typed_context->file->collection_wrapper->get_next( ).
      endwhile.
    endmethod.
    I hope that I will manage my "problem" with your help!
    Sebastian
    Edited by: Sebastian Lenz on Jun 27, 2011 2:35 PM

    Hi Sebastian,
    The issue is in the following line of your code:
    lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).
    The 'typed_context' belongs to your own component controller class and not the standard framework superclass. So, you need to replace this single line of code with something as follows (assuming that your component controller class is ZCL_CUSTOM_BSPWDCOMPONENT_IMPL):
    DATA lr_coco TYPE REF TO ZCL_CUSTOM_BSPWDCOMPONENT_IMPL.
    lr_coco ?= me->comp_controller.
    lo_entity = lr_coco->typed_context->file->collection_wrapper->get_first( ).
    The me->comp_controller reference will refer to the standard framework superclass of all component controllers and this does not have any typed_context attribute with it. The real component controller that gets created when you create a BSP component will have this attribute. That is why you need to first cast it to your own reference type before trying to access its typed_context.
    And if your value node will have only single values, then you can as well do the following to access the attribute ATTRIB1 of context node node1:
    DATA lv_value TYPE string.
    lv_value = lr_coco->typed_context->node1->get_attrib1( attribute path = '' ).
    Basically all attributes can be accessed by above code by using the right getter method.
    Regards,
    Shiromani

  • How to set Value Attribute (under valu node) at run time

    Hi,
    This is my View context.
    wbsElement (Value Attribute of Type String)
    This is my Component Controller Context.
    Project_info  (Value node)->Wbs_Info (Value Node)-WBS(Value Attribute).
    Initially I want to set some dummy values to wbsElement(view attribute),sothat I can show that in drop downby key.
    On selecting of wbsElement I want to pass the selected value to component controllers ValueAttribute - WBS (this Value attribute is under 2 nodes-see the structure I've given).
    I tried this way which is not working fine.
        IWDNodeElement element = wdContext.createWBSElement();
         wdContext.nodeWBS().addElement(element);
        wdContext.currentWBSElement().setWBS(wbsElement);
    Can anyone tell me which is the correct way to do this?
    This is very urgent.plz help me in this.Thankx in advance.
    Regards,
    Karthick

    Hi Karthick,
       try this code.
    IPublic<compcontrolllername>.IWbc_infoElement  obj  =         wdThis.wdGet<Componentcontrollername>Controller().wdGetContext().createWbc_infoeElement();
    obj.setWBS(wdcontest.currentContestElement.getwbsElement());
    wdThis.wdGet<Componentcontrollername>Controller().wdGetContext().nodeWbc_infoElement().addelement(obj);
    set the cardinality of Project_info to 1:n or 1:1
    test this one
    if you find any problem let em know
    regars
    Naidu

  • Difference between value attribute and value attribute under Node in contex

    I have very basic question..it might be very simple but it is giving me a problem.
    I have created one Node name "Input" and value attribute "Input1" under it.
    I have just created one more value attribute named "in1" not under any Node.
    I have created two input filed in the my view.One first I have mapped the value in properties
    to variables "Input.Input1" and on another "in1".
    When I deploy and run the application one Input box is coming as readonly and other is working fine .Will anybody tell me why it is so?

    There is no major difference between value attribute and inside a node.
    It is a separation of attributes. Usually all the attributes belongs to same purpose will create in one value node. Like, calling one BAPI - requestListBAPI - it contains all the bapi related value attributes.
    For your question, one field is read only(Input.Input1), bcz that context is not created. see the context properties.....cardinality will be 0..n. Change the cardinality to 1...n (<b>or</b>) create that context element .
    In your implementation create that value node like this in your init method.
    wdContext.createInputElement();
    It will solve your problem.
    in1 - is a value attribute, which is mapped to your input element. It wont have any problem.
    Regards,
    Sri

  • Attributes iteration of a value node bound to a structure invalid?

    A context value node bound to a structure always delivers all attributes of the structure bound instead of the attributes, which were selected from the available structure attributes.
    For example, if structure S has the attributes A, B and C and the value node V is bound to S, but "inherits" attribute A only, the code
    wdContext.nodeV().getNodeInfo().iterateAttributes()
    delivers an iterator which loops 3 times and returns A, B and C as attribute infos.
    Is this a wanted behaviour? I would expect that only the attributes, which are bound to the corresponding structure attributes (A in the sample) are returned.
    Regards
    Stefan
    Just to be a little bit more accurate: the term "structure" means a complex type defined unter "Structures" in the "Local Dictionary" for example. Attributes and nodes are Value Attributes/Nodes.
    Message was edited by: Stefan Klensch

    Yes, it is the intended behaviour. These <i>are</i> the attributes at run time. And I don't see why the additional structure attributes should be hidden from the application (besides the fact that iterateAttributes() is used internally, too).
    If you are interested whether an attribute was originally declared or was automatically added due to the structure binding, look at IWDAttributeInfo.isDeclared().

  • How to make visible value attributes of a Search Node

    Hi All,
    We have a requirement to enhance the search context node SEARCH ( Dynamic Query Object SVYQ ) of component SVY_S.
    But the enhancement category of Attribute Structure CRMST_QUERY_SVYIL is 'Can't be enhanced'.
    So we are adding value attributes to this context node. How to make this value attributes available in view configuration tab?
    Please suggest a better approach if there is any.
    Thanks in adv.

    Hi  Suchindra,
       You assign these  enhanced  attributes to design layer. so you can see these fields in Config tab.
    How to do:
    IMG->Customer Relationship Management -> UI Framework -> UI Framework definition -> Maintain
    design layer
    Here include the enhanced attributes and then go to component work bench and in context attributes right click assign the desing layer, selct your attribute and  in the bottom click on SAVE button.
    Then check it in configuration tab your attributes will available in show available fields.
    I hope this will solve your problem
    Regards,
    Sagar

  • How can we access the value set to a search criteria's attribute

    Hi guys,
    Is there any way to access the value which was set to a search criteria's attribute programmatically in the backing bean?
    Regards !
    Sameera

    Check sample 85 from the adf code corner sampleshttp://www.oracle.com/technetwork/developer-tools/adf/learnmore/85-querycomponent-fieldvalidation-427197.pdf
    Frank shows how to access the variables.
    Timo

  • How to populate a Value Attribute of a Value Node inside Model Node

    Hello
    I have my context like this.
      Context
    ..          - ModelNode
    ....                      - Model Attr1
    ....                      - Model Attr2
    ....                      - Model Attr3
    ....                      - Model Attr4
    ....                      - Value Node
    ......                                  |
    ......                                   - Value Attr1
    Model Node is of Cardinality 0..N
    Value Node is of Cardinality 1..1
    I want to create multiple records in my Model Node and one record for every Model Node in Value Node.
    How to do this?
    All good suggestions are welcome.
    Regards,
    Shubham

    Hi Shubham,
    With your context structure the code will be
    for(int i = wdContext.nodeModelNode().size()-1 ; i>=0 ; i--)
        IPublic<comp name>.IModelNodeElement ele =   wdContext.nodeModelNode().getModelNodeElementAt(i);
        IPublic<comp name>.IValNodeElement valEle = wdContext.nodeModelNode().nodeValNode().createValNodeElement();
        valele.setValAttr("");
        ele.nodeValNode().addElement( valEle);
    Your val node should be non singleton (singleton property = false)
    Regards,
    Jaydeep

  • How to pass value node attributes to transaction launcher?

    Hallo,
    I want to pass some parameters to transaction launcher.
    Im using a url-transaction.
    My context node is a value node.
    Can i enhance a handler class?

    Hello,
    Did you have a look at this thread ?
    WebClient Transaction Launcher Parameters
    Regards,
    Nicolas.

  • Problem in accessing attribute of a context node

    Hi All,
    I have a context node called REFE and an attribute named REF to the node REFE. I am trying to get access to the attribute REF, so that i can dynamically set properties. But i am getting NULL Object error. I am successfully getting access to node REFE.
    Here is the code.
    lo_nd_refe = wd_context->get_child_node( name = wd_this->wdctx_refe ).
    lo_el_refe = lo_nd_refe->get_element(  ).
    lo_el_refe->set_attribute(
          EXPORTING
            name =  `REF`
            value = 'http://sapsndbp.sbic.co.za:8011/sap/bc/webdynpro/sap/zzdm_audit_report' ).
    Regards,
    RAvi

    Hi,
    What is the cardinality of the node.
    If it is 1:1 then you can get teh reference of the context element directly.
    If it 0:N or 1:N then you need to pass the index of the context element you are trying to get.
    Use the method get_element of the context node and pass the index value.
    Always check the element is initial or not before you process further for better coding.
    Regards,
    Lekha.

  • Model and Value node data in one form...?

    Hello,
    I have a requirement where the adobe form is expected to have model data available and then in the same form teh user provides data, which is maintained in value node.
    Now the problem we are facing is, we are unable to maintain both value node and model node(i.e,attributes) under one type of node.(Invalid node type error appears when tried to place both attributes under one node).
    How do we provide them to data source, as it takes only one node.
    Thanks & Regards,
    Sharath

    Hi,
    you could try to add a some calculated attributes in the node which is bound to the interactive form. In the getter and setter methods of these calculated attributes you can read and set the value of your model attributes.
    Regards
    Sebastian

  • How to access a dynamic created attribute in a context node?

    <i>Hello,</i>
    <i>who could help? I can't set a value for a dynamically created attribute which is bind to a table.</i>
    <i>My context of the view looks as follow (is defined in NetWeaver):</i>
      - Context
         - Availability (Node)
             - vctxService (Attribute)
             - vctxServiceDesc (Attribute)
             - ... (further predefined attributes)
             - ... (some have to be set dynamically as follows)
    <i>Then I have added attributes dynamically in the wdDoModifyView(...) - method, as follows:</i>
    for (int i = 0; i < max; i++) {
       // some code to dynamically create table columns
       // adding attributes dynamically
       IWDAttributeInfo attrInfo =       wdContext.nodeAvailability().getNodeInfo().      addAttribute("vctxAvailability_" + i, "ddic:com.sap.dictionary.string");
       tv.bindText(attrInfo); // bind to TextView in table
    <i>In the method onPlugFrom... I tried to set the values for the attributes "vctxAvailability_ + i" as follows:</i>
    for (int i = 0; i < max; i++) {
       IAvailabilityElement newAvailNodeElement =     wdContext.createAvailabilityElement();
       // some values will be set for the
       // predefined attributes of AvailabilityNode
       // newAvailNodeElement.set...( value );
       // newAvailNodeElement.setVctxService( xy.getServ() );
       // now the values of dynamically created and added
       // attributes in AvailabilityNode will be added
       // THIS DOESN'T WORK
       newAvailNodeElement.setAttributeValue    ("vctxAvailability_" + i, "value" + i);
    <i>It would be great if someone could help me.
    Thanks in advance.
    Kind regards,
    Carsten</i>

    Carsten,
    Here is a sample code that creates context attributes dynamically and also sets values:
    //Creates a node
    IWDNodeInfo nodeInfo = wdContext.wdGetAPI().getRootNodeInfo().addChild("TestNode", null, true, true, false, true, false, true, null, null, null);
    //If you want to bind the node to a model node then the
    //second argument to the above method should be the
    //model class.
    //Creates an attribute under the node just created.
    IWDAttributeInfo testAttrib = wdContext.wdGetAPI().getRootNodeInfo().getChild("TestNode").addAttribute("testAttrib", "ddic:com.sap.dictionary.string");
    IWDNodeElement testNode = wdContext.getChildNode("TestNode", IWDNode.LEAD_SELECTION).getCurrentElement();
    IWDNode testNode2 = wdContext.getChildNode("TestNode", IWDNode.LEAD_SELECTION);
    //Now you can bind testNode with the Model Node
    //You can also set a value to the newly created attribute
    testNode.setAttributeValue("testAttrib", new String("Value"));
    Hope this helps.
    Shakeel

  • Binding value nodes to component in a view

    Hi,
          What is the use of these value nodes and value attributes? How can I bind them to, say a inputfield in my view? Can any change to the value node dynamically affect the inutfield?

    Thanks to Peter Conrad for the answer. The answer's in a different post. I have included his reply below.
    From a binding perspective there's no difference between value or model nodes/ attributes. you can always bind using the syntax
    //<contextnode/attribute to the value attribute of the tag.
    And yes, for accessing the value the SET_<attribute> and GET_<attribute> methods should be used in this case.
    Peter
    Edited by: Arun Prakash Karuppanan on May 15, 2008 10:24 PM

  • Navigate between View with Value Node.

    Dear Expert,
        I would like to know the best way to carrying data in Webdynpro between View.
       For example, I have a Quiz applcation with 10 pages (View) of question.  I would like to submit the answer at the end of the page (10th View).   So, at the end of the page, I need the to retreive the answer from page 1 to 10 and submit it.
    1.   I am using copyToLocal.  What that does it when the application fire Next event plug.  it will
    Quiz.<b>set</b>QuizAns1(Quiz.<b>get</b>QuizAns1)
    and do the same thing for next 9 pages in order to bring the answer from page 1 to the end.
    To simplfied, I am considering.
    2.  Model Beans
    /people/valery.silaev/blog/2005/06/29/apojo--almostplain-old-java-objects-as-model
    3.  Session Beans.
         Is any concern that I shouldn't use session bean in webdynpro??
    Or any other way to make the Code more organize?
    Thanks all.

    Hi,
    The best way to carry data in WebDynpro views is through context attributes.
    Create a context as below in component controller
    Context
    +Questions (node:cardinality 0..n,selection 0..n)
    ---Question
    +Answers
    ---Ans (node:cardinality 0..n,selection 0..n)
    Map the above context to all the views.
    In the wdDoInit() of component controller create Ans elements under Answers node equal to question node.
    for(int i=0;i<wdContext.nodeQuestions.size();i++)
    wdContext.nodeAnswers().addElement(wdContext.nodeAnswers().createAnswersElement());
    // This way we need not create the elements in each view before going to the next view.
    Populate the Question attribute with Questions.
    Through indexing show the question corresponding to views as
    In first view (index 0)
    wdContext.nodeQuestions.getQuestionsElementAt(<b>0</b>).getQuestion();
    In second view (index 1)
    wdContext.nodeQuestions.getQuestionsElementAt(<b>1</b>).getQuestion();
    and so on..
    // Note: The Answer node will not be populated intially with values as your answer might be multiple choice.
    After the user gives answer store the answer in the corresponding index of Ans attribute under node Answers as
    For the answer in first view
    wdContext.nodeAnswers.getAnswersElementAt(<b>0</b>).setAns(<get the answer from the view>);
    For the answer in second view
    wdContext.nodeAnswers.getAnswersElementAt(<b>1</b>).getAns(<get the answer from the view>);
    In your last view you can get the Questions and Answers by looping through the Questions and Answers node.
    This way you will need only one attribute for Question and Answer respectively.

  • Access field value in ALV

    Hello experts,
    I have created an simple ALV Grid report, in that I have implemented double click event n I want to create a new ALV grid with new data to be displayed. So I want to access field value ie using SLIS_SELFIELD or anything. Could anyone please guide me how can I access a field value using slis though SLIS_SELFIELD has methods like SEL_TAB_FIELD... I wan to access something like SEL_FIELD_VALUE but its not available in the class.
    Thanks in advance...
    Regards,
    Viral Patel

    Hi Viral,
    SLIS_SELFIELD has an attribute named VALUE which holds the value you selected row & TBAINDEX holds the row number.
    Refer below code snippet :-
    FORM user_command
              USING s_ucomm LIKE sy-ucomm
              s_selfield TYPE slis_selfield.                    "#EC CALLED
      CASE s_ucomm.
        WHEN '&IC1'.
          CLEAR wa_podat2.
          READ TABLE itab_podat2 INTO wa_podat2 INDEX s_selfield-tabindex.
          CHECK sy-subrc = 0.
          IF wa_podat2-ebeln = s_selfield-value.
            SET PARAMETER ID 'BES' FIELD wa_podat2-ebeln.
            IF wa_podat2-ebeln IS NOT INITIAL.
              CALL TRANSACTION c_tcode.
            ENDIF.
    For above event to happen, you have to use parameter I_CALLBACK_USER_COMMAND of  REUSE_ALV_GRID_DISPLAY as below :-
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = l_repid
          i_callback_user_command = 'USER_COMMAND'
          it_fieldcat             = itab_fieldcat
          it_events               = itab_events
        TABLES
          t_outtab                = itab_podat2[].
    Regards
    Abhii
    Edited by: Abhii on Nov 30, 2009 11:25 AM

Maybe you are looking for

  • Apple TV content no longer working

    As of this morning, all of our Apple TV's stopped loading content from certain providers (some news apps, e.g. Bloomberg, Sky News). The devices are correctly configured on the network, and have network and internet access (we have seen the traffic p

  • Deleting unclompleted photocast download

    I tried to download a photocast, but saw that the photos weren't very interesting, so I stopped the download, then I removed the photocast from my Source list. iPhoto asked wether I wanted to remove all the photos from within the photocast, I said ye

  • How to divide consgroup in two?

    I want to divide one consgroup Group Comp1 Comp2 CompN into 2 new: Group2 Comp1 Comp2 and Group3 Comp3 Comp4 CompN Year - 2008. Which steps should I do? I have created two new groups already and added companies to them. P/L reports (on this new group

  • Can't re-shuffle songs

    Lately, I can't get my songs to re-shuffle. According to the card that ships with the Shuffle, all I have to do is "switch off, wait 5 seconds, then switch to shuffle or play". This has no effect whatsoever. The memory of where it left off also no lo

  • How to run Adobe InDesign CC without needing Domain Admin privileges?

    Adobe InDesign CC needed Admin privileges to install which is fine but it seems to need the same just to start-up and run the program. I've given the user Local Admin but that didn't fix it. I don't want to have to 'Run as Administrator' every time t