Query in Context Node

Hi all,
           Can anyone please tell me as to when we go for creating a New Context Node.
Regards,
Vijay

Where to create new context nodes in the component workbench should be clear. The Wizard on view generation or the wizard after right click on context nodes.
Creating new entries in the context nodes during runtime can be done everywhere. I experienced problems doing it in DO_HANDLE_DATA.

Similar Messages

  • How to go over a Context node

    Hello,
    I have a Context Node myNode which contains many attributes: first_name, last_name, phone ect.
    How do I go over the Node in a while/for loop and query each attribute for it's value for example?

    Hi,
    try something like this:
    public static void iterateThroughAttributes(final IWDNode node)
         final int size = node.size();
         final IWDNodeInfo nodeInfo = node.getNodeInfo();
         for (int i = 0; i< size; i++)
              final IWDNodeElement element = node.getElementAt( i );
              for (final Iterator it = nodeInfo.iterateAttributes(); it.hasNext(); )
                   final IWDAttributeInfo attributeInfo = (IWDAttributeInfo)it.next();
                   element.getAttributeValue( attributeInfo.getName() );
    Regards, Maxim R.
    Message was edited by: Armin Reichert
    corrected code

  • How to use attributes from different context nodes in one view?

    I am VERY new to the concept of CRM and currently working on creating an alternate version of the BP_HEAD_SEARCH. With help from SAPPRESSs book 'SAP CRM Web Client' i was ble to create my own simple Z-component.
    However after going back and forth the book and the forum (including this [article|https://wiki.sdn.sap.com/wiki/display/CRM/Howtoaddanexistingfieldtoasearchpageofadifferent+component]) i was not able to find a solution to my problem. My current search uses BuilHeaderAdvancedSearch as context node for searching. But the search should also be able to use attributes from BuilActivity, which is directly related to BuilHeader. I can't seem to find a way to get attributes from BuilActivity into the search window of my component without having to change SAP-Standard.
    Is this really the only way? Please advise on possible code and insertion point.

    Any suggestions?

  • Error while genetrating gettter method on Context node attribute

    Hi,
    I am working in SAP CRM 7.0 Ehp1.Now I need to create get_p_a and set_p_a method
    on context node attribute.But while selecting attribute and clicking on right and selecting
    on generate P-Getter,getting an error (error message - View not copied or enhanced with wizard; processing not possible).
    This is a custom context node attribute and need to create gettter,setter method.
    Kindly assist on this or suggest is there any way to create method on required context node attribute.
    Regards
    Viren

    Hi there,
    Creation of Getter  Setter is not possible for the AET Generated Views and Components.
    It seems your view is generated using AET Table enhancement feature of Ehp1 and the context node is thus a based on a Z BOL object created by a feature of AET of Ehp1
    For such context node, generation of getter setters is not  possible with right click.
    If you need any of GET_ , SET_, GET_P_ or GET_V , then you need to copy the GET_P_XYZ etc method you find on context node class.
    Hope this helps
    Thanks & Regards
    Suchita

  • Reading Attributes from different context nodes in the same view

    Hi,
    I have added a new field as part of an enhancement for Trade Promotions. This field is a checkbox and part of the context node TRADE in the view TPMOE/HeaderEOF. This field will be checked or unchecked using a logic in the background.
    The logic will be based on an attribute (Fund Plan ID) which is part of another context node FUNDPLAN in the same view.
    How can I read the attribute of FUNDPLAN context node in TRADE context node?
    A sample code will be quite helpful as I am new to CRM 2007.
    Thanks,
    Abhishek
    Edited by: Abhishek  Periwal on Oct 16, 2008 2:35 PM

    Hi Abhishek,
    If I understand your question correctly, you would like to access the Fund plan ID (in a different context node) in the getter setter methods of the check box attribute which you have added.
    The code snippet mentioend by sudeep works perfectly fine when you are making any checks in the view implementation class. But since you are in the getter setter methods of the context class, this doesnot work as "me" always refers to the class instance in which you are present.
    Now in this case what you need to do is :
    1)  create an attribute <view_controller> in your context class. Here the context is TRADE. The type of this attribute wud be same as the view controller class CL_TPMOE_HEADEREOF0_IMPL
    2) Go to the view controller class and redefine the method
    DO_VIEW_INIT_ON_ACTIVATION. This method is called only once when the view is loaded for the first time.
    3) In this method, put the following code
    me->typed_context->(Trade)->[view_controller] = me.
    by the above code, you are setting the newly created attribute to the view controller instance.
    4) The next step would be, go back to your getter setter methods or what ever it may be, try referring to the Fund plan ID by the code snippet mentioned below
    data: lr_entity type ref to cl_crm_bol_entity.
    lr_entity ?= me->[view_controller]->typed_context->[the context node in which the fund plan id is present]->get_current().
    lv_field_value = lr_entity->get_property_as_String( **pass the field name here ).
    This should definitely resolve the problem.
    Thanks,
    Vinay

  • How to set value from one view to other view's context node attr b4 save

    HI all,
    My requirement is as below:
    There are two views in component BP_CONT.
    BP_CONT/ContactDetails    IMPL class
    BP_CONT/SalesEmployee   SALESEMPLOYEE    STRUCT.SALESEMPLOYEE
    I want to set value from first view to second view's context node's attribute.
    i get Sales Employee BP number in ContactDetails view, from here i want to set that value in to STRUCT.SALESEMPLOYEE
    of second view in the same component.
    please send me code snippet for doing the same.
    Thanks in advance.
    seema

    Hi Seema
    You can access the fields from different views by either using custom controllers or by using component controllers, in your case you can access the Sales employee BP number from the Component controller.
    first access the component controller  as below in BP_CONT/SalesEmployee  (in do_prepare_output method) or in (specific setter method)
    lv_compcontroller type ref to CL_BP_CONT_BSPWDCOMPONENT_IMPL,
    lv_partner type ref to cl_crm_bol_entity,
    lv_role type string,
    lv_partner_no type string.
    lv_employee TYPE REF TO if_bol_bo_property_access,
    lv_compcontroller  = me->COMP_CONTROLLER.
    lv_partner ?= lv_compcontroller  ->typed_context->-partner->collection_wrapper->get_current( ).
    lv_role = lv_partner->get_property( iv_attr_name = 'BP_ROLE' )
    IF LV_ROLE = 'SALESEMPLOYEE'
      lv_partner_no ?= lv_current->get_property( iv_attr_name = 'BP_NUMBER' ).
    endif.
    now set the value
    lv_employee ?= me->typed_context->salesemployee->collection_wrapper->get_current( )
    CHECK lv_employee IS BOUND.
        lv_employee->set_property( iv_attr_name = 'SALESEMPLOYEE' iv_value =  lv_partner_no  )
    Thanks & Regards
    Raj

  • Binding of different context nodes in BSP WD Workbench

    Im creating a new View .
    How can i bind a new attribute node in this view to  context node of <U>component controller</u>( not of custom controller)?
    Edited by: Oleg Agranovich on Oct 27, 2008 3:07 PM

    HI,
    just like you would with a custom controller. It is the same method call in the CREATE_XXX method of the context class.
    Just substitute the iv_controller_type variable with CL_BSP_WD_CONTROLLER=>CO_TYPE_COMPONENT
      owner->do_context_node_binding(
            iv_controller_type = CL_BSP_WD_CONTROLLER=>CO_TYPE_COMPONENT
            iv_target_node_name = '<<CUCO_NODE>>'
            iv_node_2_bind = <<node>> ).
    cheers Carsten

  • How to read the context node of used component?

    Hi,
    I have component called : SRQM_INCIDENT_H. This component has used component - BTSTATUS.
    Now, I need to read the context node of the BTSTATUS/UserStatus in GET Methods of Context node in SRQM_INCIDENT_H.
    Can you plese help me out.
    Thanks,
    Sandeep

    The component usages can be accessed from the component controller
    You should however assure that the context node is present in comp controlelr of the used component.View context nodes cannot be accessed.
    if not ,then you need to goto the component BTSTATUS ,add the context node  explicitly to comp controller,and do correct bindings to the view context node.
    Once you add the context node to the com controller,yo also need to expose it.
    go to runtime repository->component_interface->interface_controller->context->right click and select ADD CONTEXT NODE, and add you newly creatde context ndoe of comp contorller here.
    Now you cann access it using the code below in your comp SRQM_INCIDENT_H
    data:lr_comp_controller type ref to <ur comp controller class>lr_comp_controller ?= me->comp_controller.
        lr_comp_usage ?= lr_comp_controller->get_component_usage( iv_usage_name = '<name of the comp usage as in runtime repository' ).
        CHECK lr_comp_usage IS NOT INITIAL.
        lr_cnode ?= lr_comp_usage->get_context_node( iv_cnode_name = '<the required context node name>' ).
    Suvidha

  • How to read the value of a field belonging to a different context node in GET_I method during runtime

    I want the read the value of a field,'LCSTATUS' belonging to context node 'BTADMINH' in the GET_I method of the field, 'ZZFLD000008' belonging to context node,'ZBTACTIVITYH'.
    In the context node class of context node 'ZBTACTIVITYH',I have created an instance attribute,GR_OWNER type ref to context class.
    I get the following error in the line - lv_act_status = Lr_entity->if_bol_bo_property_access~GET_PROPERTY_AS_STRING( 'LCSTATUS' ).
    'An exception (CX_CRM_CIC_PARAMETER_ERROR) occurred Message no. TPDA430'
    I have used the below code.
    method GET_I_ZZFLD000008.
         DATA: current TYPE REF TO if_bol_bo_property_access,
               lv_act_status TYPE string.
         DATA:lr_entity TYPE REF TO cl_crm_bol_entity,
               lr_current TYPE REF TO if_bol_bo_property_access,
              lr_parent TYPE REF TO cl_crm_bol_entity.
         rv_disabled = 'TRUE'.
         if iterator is bound.
           current = iterator->get_current( ).
         else.
           current = collection_wrapper->get_current( ).
         endif.
    CHECK gr_owner IS BOUND.
    lr_entity ?= gr_owner->btadminh->collection_wrapper->get_current( ).
    CHECK  lr_entity  IS BOUND.
    lv_act_status = Lr_entity->if_bol_bo_property_access~GET_PROPERTY_AS_STRING( 'LCSTATUS' ). "error states that lcstatus can't be used here.
       TRY.
             IF current->is_property_readonly(
                           'ZZFLD000008' ) = abap_false. "#EC NOTEXT
               rv_disabled = 'FALSE'.
             ENDIF.
         CATCH cx_sy_ref_is_initial cx_sy_move_cast_error
               cx_crm_genil_model_error.
           RETURN.
       ENDTRY.
    endmethod.

    Hi,
    LCSTATUS is not an attribute of the BTADMINH structure. It is read using the relation to the status object
    BTADMINH-> BTHeaderStatusSet-> BTStatusHCurrent-> ACT_STATUS.
    Try reading the ACT_STATUS of object BTStatus as given below.
            data: coll   type ref to if_bol_entity_col.
           data: entity type ref to cl_crm_bol_entity,
                         lv_act_status TYPE string.
           entity ?= current.                                                               "BTADMINH entity.
           coll = entity->get_related_entities(
                    iv_relation_name = 'BTHeaderStatusSet' ).    "#EC NOTEXT
           current = coll->get_current( ).
            entity ?= current.
           coll = entity->get_related_entities(
                    iv_relation_name = 'BTStatusHCurrent' ).     "#EC NOTEXT
           current = coll->get_current( ).
            try.
           lv_act_status = current->if_bol_bo_property_access~GET_PROPERTY_AS_STRING(  'ACT_STATUS' ).
             catch cx_crm_cic_parameter_error.
           endtry.
    Regards JP

  • How to read the attribute in another context node from setter method

    Hi,
    As part of the  requirement
    i need to read the STRUCT.E_MAIL ( attribute ) present  in  INDEPENDANTEMAIL context node  from  the SET_S_SRUCT method of the context node  HEADER.
    I tried th following but it didnt work out....
    Get the Custom Controller Path
    *lr_cuco ?= controller->get_custom_controller( controller_id = 'BP_HEAD/IndComm').
    *IF lr_cuco IS BOUND.
    Get the Entity
    *lr_entity ?= lr_cuco->typed_context->independantemail->collection_wrapper->get_current( ).
    *ENDIF.
    *CHECK lr_entity IS BOUND.
    Get the Trade Event Type.
    *lv_email  = lr_entity->get_property_as_string( 'E_MAIL' ).
    also i tried ...
    data:
    *lv_value type string,
    *lr_property type ref to if_bol_bo_property_access.
    *lr_property = collection_wrapper->get_current( ).
    *lv_value = lr_property->GET_PROPERTY_AS_STRING( importing iv_attr_name = 'E_MAIL'
                                                returining  ev_result    = lv_email ).
    but it didnt workout ......
    Any suggestions   ...................
    Regards,
    Sijo...

    Hi,
    Both Context node are available in view then refer this link.
    Reading Attributes from different context nodes in the same view
    Relationship name for context node INDEPENDENTMAIL is 'BuilIndependantEmailRel'
    Regards
    Gaurav

  • How to read the value from one context node in other in the same view.

    Hi,
    I am working on enhanced component ICCMP_BP_CP/BuPaContactPersonCreate ,  i need to read the partner_guid from Customer context node in  contactpersonaddress context node.
    Could you please guid me how to achieve this? if possible, please explain me with some sample code.
    i am trying this code in GET_FAXFAX method of contactpersonaddress-faxfax, but it is throwing me the type cast exception.
    data: lr_entity type ref to cl_crm_bol_entity.
    data: lv_test type string.
    lr_entity ?= collection_wrapper->get_current( ).
    lr_entity = lr_entity->get_related_entity( 'BuilContactPersonAddressRel' ).
    Thanks in advance.
    Regards,
    Kamesh Bathla
    Edited by: Kamesh Bathla on Jun 25, 2009 7:46 PM

    problem solved by writing the code in context node class CREATE_CONTPERSADDRESSVALNODE method
      coll_wrapper = customer->get_collection_wrapper( ).
      TRY.
          entity ?= coll_wrapper->get_current( ).
        CATCH cx_sy_move_cast_error.
      ENDTRY.
      IF entity IS BOUND.
    CONTPERSADDRESSVALNODE->on_new_focus( focus_bo = entity ).
        DATA: lr_collection TYPE REF TO cl_crm_bol_entity,
              lv_fax TYPE string,
              lv_fax_ext TYPE string,
              lv_tel TYPE string,
              lv_tel_ext TYPE string,
              entity_addr TYPE REF TO if_bol_bo_property_access, "#EC *
              coll_wrapper1 TYPE REF TO cl_bsp_wd_collection_wrapper.
         lr_parrent type
        lr_collection = entity->get_related_entity( 'BuilStandardAddressRel' )."'BuilContactPersonAddressRel' ).
        IF lr_collection IS BOUND.
          coll_wrapper1 = contpersaddressvalnode->get_collection_wrapper( ).
          TRY.
              entity_addr ?= coll_wrapper1->get_current( ).
            CATCH cx_sy_move_cast_error.
          ENDTRY.
    getting fax number
          CALL METHOD lr_collection->if_bol_bo_property_access~get_property_as_value
            EXPORTING
              iv_attr_name = 'FAXFAX'
            IMPORTING
              ev_result    = lv_fax.
    ***setting fax number
          CALL METHOD entity_addr->set_property
            EXPORTING
              iv_attr_name = 'FAXFAX'
              iv_value     = lv_fax.

  • How to read the details in the context node of the custom controller

    Hi friends,
        My requirement is i enhanced the component ICCMP_BP_DETAILS , now on EH_ONSAVE i want to read the details of the Context node in the Custom COntroller .
    In custom controller from ICCMP_BP_DETAIL/CuCoBPDuplicate  From this in context node CUSTOMER is there in that attributes first name last name is there i want to read those details
    so can u pls provide the logic for this how can i get the values.
      am very new to the BSP programming
    Regards
    Yogesh

    Hi Suchitha,
    when i am following the above code the lr_entity is not Bound, so can u pls suggest is there any thing is missing
    i used the below mention code but lr_entity is not bound
    DATA: lr_cuco type ref to CL_ICCMP_BP_CUCOBPDUPLICA_IMPL.
                lr_entity type ref to cl_crm_bol_entity.
    lr_cuco ?= me->get_custom_controller( 'ICCMP_BP_DETAIL/CuCoBPDuplicate') .
    CHECK lr_cuco IS BOUND.
    lr_entity ?= lr_cuco->typed_context->customer->collection_wrapper->get_current( ) .
    CHECK lr_entity IS BOUND .
    lr_entityIF_BOL_BO_PROPERTY_ACCESSGET_PROPERTY_AS_VALUE( iv_attibute =  'FIRST_NAME' ev_attribute = lv_firstname ) .
    Please correct the code if any thing is missing
    Regards,
    Yogesh

  • How to delete the context node in BSP Component?

    Hi,
    I have created a custom context node in one of the components : BP_BPBT.
    Now, I want to delete the context node..
    Could you please tel me, how can I do that?
    Thanks,
    Sandeep

    Hi Sandeep,
      Please check the below link.
    [How to delete Context Node;
    Regards,
    Lakshmi.Y

  • Is it possible to use two context nodes in a single table view?

    Hi all,
    I have a window context node which is mapped to a dictionary structure. I have created a second node which contains some texts. I've mapped both nodes with the context  of a view. In this view I have created a table which shows lines of the first node (the one mapped to a dictionary structure). What I want is to show some text from the second node in a column of the table.
    Both of the nodes are populated upon initialization of the window. And they have a 1:1 mapping. (i.e the first line of the second node has some text for the first line of the first node ) . When the table is displayed what I get is the first line of the second node for all the lines of the first node. How can I change that? How can I make the second (text) node show the relevant text of the relevant line?

    HI
    You can make it work by using the logic of populating the node itself with modified values.
    i.e. during the population of the first node populate the text with the text from the second node by looping through its elements
    one by one.
    node 1  -- during its population or may be after its population loop though its elements and modify the value of text
    with the proper value taken from the corresponding value of text from the corresponding element of node 2.
    thanks
    sarbjeet singh

  • How to add a field in the view not in context node

    Hi All,
            I want to add a new field in one of my views. The problem is that the field does not exist in the context node. I have checked in the BOL model there it comes under another root object. I would  like to know whether it is possible to add the field from another root object.
    can you please help to me to solve this issue.
    Advance Thanks & Regards
    Sujith

    Hi Ashish,
                  I will give a detailed explanation of my requirement. I am working in ICWEB client for utility services, In this case for a particular view in the bsp application CRM_IUFCS_IC/View1.htm i want to add a field but the field is not the context nodes, or any of the related entities in the BOl Model. But its in  another root object in the BOL Model. So i would like to know how can i add this field into my layout.
    e.g.:let context node in view to be modified is buag and the field to be added is under BuilHeader object. This is the scenario.
    Advance Thanks,
    Sujith

Maybe you are looking for

  • Set preferences to open a jpeg

    Hi My images open to "Preview" by fault.  I'd prefer to use an application called "Image Browser"  as my default to open jpegs. How do I change this setting? Thanks AS

  • Real problem after changing a setting (please read!!!)

    Hi all, This is the situation: A UBEE wifi modem from my cable provider. On the Ubee i connected my Airport Extreme Base Station (AEBS) via UTP, and have set it to bridge mode. On the AEBS I have an Airport Express connected (via UTP) to extend my Wi

  • I can't get 'new message' in imail....any ideas?

    I can't get 'new message' in imail....any ideas?

  • JWS NullPointerException

    Hello, I am getting following exception when launching application from jws. Any hints? Thanks in advance. Java 2 Runtime Environment: Version 1.3.1 by Sun Microsystems Inc. Logging to file: c:\jws.log java.lang.NullPointerException      at sun.misc.

  • Oracle 8i on FreeBSD? Will it work?

    Hi! I am about to install Oracle8i on a FreeBSD Server, but will it work? I have downloaded the version for Linux... Any suggestions? Thanks in advance! Thomas Rokamp