To compare value node

Hi, i need to compare two value, one it comes to LeadSelection (nodePo_Items) and another comes other table (nodeTemp_GetdetailSerivce_Output), but the comparison <b>(if)</b> don't work.
ex:
int m = wdContext.nodeZbapi_Po_Getdetail_Input().nodeOutput_Po_Getdetail().nodePo_Items().getLeadSelection();
int n = wdContext.nodeTemp_GetdetailSerivce_Output().size();          
for(int i = n - 1; i >= 0; --i)
<b>if </b>(wdContext.nodeTemp_GetdetailSerivce_Output().getTemp_GetdetailSerivce_OutputElementAt(<b>i</b>).<b>getPckg_No</b>() <b>==</b> wdContext.nodeZbapi_Po_Getdetail_Input().nodeOutput_Po_Getdetail().nodePo_Items().getPo_ItemsElementAt(<b>m</b>).<b>getPckg_No())</b>     
                 wdContext.nodeTemp_GetdetailSerivce_Output().removeElement(wdContext.nodeTemp_GetdetailSerivce_Output().getElementAt(i));          
<i>somebody knows that it can happen?  I am comparing bad?</i>

Hi Antonio,
I think the data type of your attribute Pckg_No is other than integer (like String, Bigdecimal or like an Object). Hence you cannot do a comparison using '=='.
Instead use 'equals' method.
wdContext.nodeTemp_GetdetailSerivce_Output().getTemp_GetdetailSerivce_OutputElementAt(i).getPckg_No().equals(wdContext.nodeZbapi_Po_Getdetail_Input().nodeOutput_Po_Getdetail().nodePo_Items().getPo_ItemsElementAt(m).getPckg_No()))
I think it will work.
Regards,
Shubham

Similar Messages

  • 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 hide a single value node hierarchy in the query designer

    Hi,
    I would like to perform a calculation  in the infocube. It concern  a count "Nb of different customers" with the following hierarchy : Country / region / City.
    This KF would be read at the same time by city, region and country, and  certain customers exist in 2 different region, and I have to count them only once by country.
    To do this, I added a new record (at the country level when loading infocube) to deduct a number of customers in doubloons.
    This line added contain only a country code and the number of cutomers in doubloons (- 23 when I have 23 cutomers in doublons) with revrese sign.
    Now, I would like to use this value (-23) to have a right Nb of different customers by country, without showing the not assigned line in the report hierarchy.
    How can I hide, in the query designer or the WAD, a single value node from hierarchy (NOT assigned) but take in account the value (-23) at the country level ?
    Is there another solution (more simple) to perform this in the infocube ?
    For information,
    1) The infocube is loaded once per month, and the KF (Nb of different customers" is also performed by month.
    2) I can't perform this in the report (performance problem with calculated KF).
    thx.

    Hi,
    the short answer is "you can't", the longer is: The ADF Faces tree component is stamped for better performance. This stamping means that nodes are not rendered as JSF objects but copies of an existing component (just with a changed value). For this reason the nodes don't issue their own query for data and thus cannot be refreshed individually
    Frank

  • Create Value node instance from structure at runtime

    Hi,
    I have a requirement where an internal table is given with some details.
    Now I need to add each row of this internal table as one entity into a collection.
    For this I need to create value node instance for each entry of the table and then
    lr_collection->if_bol_bo_col~add( lr_entity ).
    this to add to the collection.
    Please tell me how to convert this one row of this table into entity.
    Regards,
    pooja

    Try it like this:
    DATA: lt_data type table of ty_line.
    DATA: ls_data type ty_line.
    For the value nodes we need an data object
    DATA: lr_line_ref type ref to ty_line.
    The value node which should be added
    DATA: lr_value_node type ref to cl_bsp_wd_value_node.
    First create the reference structure
    CREATE DATA lr_line_ref.
    *Loop over you itab
    LOOP AT lt_data into ls_data.
    Create the value node based on the ref line
    CREATE OBJECT lr_value_node
    EXPORTING iv_data_ref = lr_line_ref.
    Now set the data from the internal table
    lr_value_node->set_properties( ls_data ).
    Now add the created value node to the collection
    lr_collection->if_bol_bo_col~add( lr_value_node ).
    ENDLOOP.

  • 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 populate value node with values?

    Hi Experts,
    I have created a new view with a vlaue node of table type.
    How can I populate values into the value node?
    Which method will be useful?
    Is there any material for Web UI Programing?
    Please help me in this.
    Thanks,
    Adi.

    Hi Adi
    If ZVal is your value node then,
      DATA: lref_entity    TYPE REF TO cl_bsp_wd_value_node,
            lref_bo_coll   TYPE REF TO if_bol_bo_col,
            lref_data TYPE REF TO <<your ZStructure>>,
             ls_data type <<your ZStructure>>.
    ls_data-<<field1>> = 'XYZ'
    ls_data-<<field2>> = 'XYZ'
         CREATE OBJECT lref_bo_coll TYPE cl_crm_bol_bo_col.
          CREATE DATA lref_data.
          CREATE OBJECT lref_entity
            EXPORTING
              iv_data_ref = lref_data.
          lref_entity->set_properties( ls_data ).
          lref_bo_coll->add( lref_entity ).
          typed_context->ZVal->set_collection( lref_bo_coll ).
    Hope this was helpful.
    Best Regards,
    Lakshminarayana

  • How to populate value of a Z table which is a value node for the context?

    Hi,
    My requirement is to display the content of a z table onto a webpage, for this a have create a z component having a tableview with value node (Z table) assigned.
    In output its showing the table with table columns name. But how to display the content of that table?
    Regards,
    Payalg

    The get_xxxX methods should be automatically created and there is no need to add any code .. it generally has this kind of code.
        DATA: current TYPE REF TO if_bol_bo_property_access.
        DATA: dref    TYPE REF TO data.
        value =
    CNODE1 not bound'."#EC NOTEXT
        if iterator is bound.
          current = iterator->get_current( ).
        else.
          current = collection_wrapper->get_current( ).
        endif.
        TRY.
            dref = current->get_property( 'FIELD1' )."#EC NOTEXT
          CATCH cx_sy_ref_is_initial.
            RETURN.
        ENDTRY.
        IF dref IS NOT BOUND.
          value = CNODE1/FIELD1 not bound'."#EC NOTEXT
          RETURN.
        ENDIF.
        TRY.
            value = if_bsp_model_util~convert_to_string( data_ref = dref
                                        attribute_path = attribute_path ).
          CATCH cx_bsp_conv_illegal_ref.
            FIELD-SYMBOLS: <l_data> type DATA.
            assign dref->* to <l_data>.
          please implement here some BO specific handler coding
          conversion of currency/quantity field failed caused by missing
          unit relation
          Coding sample:
          provide currency, decimals, and reference type
          value = cl_bsp_utility=>make_string(
                             value = <l_data>
                             reference_value = c_currency
                             num_decimals = decimals
                             reference_type = reference_type
              value = '-CURR/QUANT REF DATA MISSING-'.
          CATCH cx_root.
            value = '-CONVERSION FAILED-'.                  "#EC NOTEXT
        ENDTRY.

  • How to empty a Value Node?

    I want to clear all elements inside a value node.. What's the best way to do it?

    Hi
    User Standred mehtod provided by framework
    wdContext.nodeChildUrlNode().invalidate()
    Will clear all the instance contain by Value node
    Best Regards
    Satish Kumar
    Edited by: satish jhariya on Mar 4, 2009 9:56 AM

  • How to populate a Dropdown List from a Value Node

    Hi
    I have a WD application Java with an Interactive Form. In the WD context I have a value node of cardinality 0..n. In the Interactive Form I need to have the values of this node within a dropdown list. Which type of DDL is best choice and how do I manage to get the node values into the list.
    We are working on NW2004 with Designer 7.08.
    Thank you for any suggestions.
    René Morel

    hi,
    With respect to your problem please refer to this guide/tutorial.
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/98af7acd-0401-0010-f697-bfa06971b65e
    Hope this helps you.
    Thanks,
    kris

  • 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

  • Custom component Search and Result view using value node :pls help

    Hi Experts,
    I am creating a Custom component with Search and Result view using value nodes.
    This is the code I wrote in the Search button event handler method.
    The data which gets in lv_search I need to put in lv_col .
    Can somebody guide me for this.
    Points will be awarded .
    METHOD eh_onsearch.
      DATA : lv_current TYPE REF TO if_bol_bo_property_access,
             lv_search  TYPE zcrm_orgstruct_search,     "Search value node structure
             lv_result  TYPE zcrm_orgstruct_result,         "Result value node structure
             lv_col     TYPE REF TO if_bol_bo_col.
      lv_current ?= me->typed_context->search->collection_wrapper->get_current( ).
      CALL METHOD lv_current->get_properties
        IMPORTING
          es_attributes = lv_search.
      me->typed_context->searchresult->collection_wrapper->set_collection( lv_col ).
      op_toresultview( ).
    ENDMETHOD.
    Regards,
    Lakshmi

    Hi Lakshmi,
    Could you please share with us how it was solved.
    "CALL METHOD lv_current->get_properties
    IMPORTING
    es_attributes = lv_search."
    Did you get any values in lv_search ?
    Because while using value nodes for search view (which inherits from advance search controller  class), the above method does not return any search values entered in the fields.
    Please let me know how did you solve it.
    Thanks & Regards
    Vidhya

  • 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

  • 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 fill or bind data using Value Node in Tree Node

    Hi Gurus,
    Can anybody help me on how to fill data or bind data using Value Node in Tree Node View. I know how to create Tree Node but not able to show value on the UI in Tree View.
    Can u please let if anybody has done it?
    Thanks in advance.
    Madhusudan

    continued...
    TRY.
              lv_child = me->node_factory->get_proxy(
                        iv_bo = lv_value_node
                        iv_parent_proxy = me
                        iv_proxy_type = 'ZL_CLASS_CN02' ).
              lv_child->is_leaf = 'X'.
              APPEND lv_child TO rt_children.
            CATCH cx_sy_move_cast_error cx_sy_ref_is_initial.
          ENDTRY.
      In the above code iv_bo , lv_value_node will be the actual object of the second node or leaf node here, which will have the same structure of parent node along with data. After/before this, you would need to build table and refresh in do-prepare_output of IMPL class.In the above code iv_bo , lv_value_node will be the actual object of the second node or leaf node here, which will have the same structure of parent node along with data. After/before this, you would need to buid table and refresh in do-prepare_output of IMPL class.
    ztyped_context->resultlist->build_table( ).
      IF ztyped_context->resultlist->node_tab IS INITIAL.
        ztyped_context->resultlist->refresh( ).
      ENDIF.
    Also the EH_ONEXPAND has to be implemented and event handled in DO_HANDLE_EVENT. But this expand event has to be delegated to context node directly as CL_BSP_WD_CONTEXT_NODE_TREE will already have the implementation.
    ztyped_context->resultlist->expand_node( lv_event->row_key ).
    Where in result list is the node ZL_CLASS_CN00.
    After typing the whole content , i found this blog :). There are few things i have written more that in the blog.  /people/poonam.assudani/blog/2009/06/24/create-a-tree-view-display-in-crm-web-ui
    Regards,
    Karthik

  • Need to compare values in two columns of one table against values in two columns in another table

    Hi, as the title reads, I'm looking for an approach that will allow me to compare values in two columns of one table against values in two columns in another table.
    Say, for instance, here are my tables:
    Table1:
    Server,Login
    ABCDEF,JOHN
    ABCDEF,JANE
    FEDCBA,SEAN
    FEDCBA,SHAWN
    Table2:
    Server,Login
    ABCDEF,JOHN
    ABCDEF,JANE
    FEDCBA,SHAWN
    In comparing the two tables, I'd like my query to report the rows in table1 NOT found in table2. In this case, it'll be the 3rd row of table one:
    Server,Login
    FEDCBA,SEAN
    Thanks.

    create table Table1([Server] varchar(50), Login varchar(50))
    Insert into Table1 values ('ABCDEF','JOHN'),('ABCDEF','JANE'),('FEDCBA','SEAN'),('FEDCBA','SHAWN')
    create table Table2([Server] varchar(50), Login varchar(50))
    Insert into Table2 values ('ABCDEF','JOHN'),('ABCDEF','JANE'), ('FEDCBA','SHAWN')
    select [Server] ,Login from Table1
    Except
    select [Server] ,Login from Table2
    select [Server] ,Login from Table1 t1
    where not exists(Select 1 from Table2 where t1.[Server] = t1.[Server] AND Login=t1.Login)
    drop table Table1,Table2

Maybe you are looking for