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

Similar Messages

  • 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 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?

  • 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 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

  • Values retrieved by OVS not binded to the context node

    Hi all gurus,
    In SRM 7 I'm working on an ABAP web dynpro (/SAPSRM/WDC_DODC_CT) which is intended to show a document's header custom table. In the unique view of this web dynpro, the user can see the table (made up by custom fields) and can add or remove a line.
    I created dinamically a pair of OVS search help for some of the fields of the table, in this way (method WDDOMODIFYVIEW):
    * insert: Object Value Selector for ZZ_PROLE_R3 and ZZ_LIFNR_R3
          DATA: lo_tabnode        TYPE REF TO IF_WD_CONTEXT_NODE.
          DATA: lo_tabnode_info   TYPE REF TO IF_WD_CONTEXT_NODE_INFO.
          lo_tabnode = wd_context->GET_CHILD_NODE( name = 'THCUS' ). "the custom table node
          lo_tabnode_info = lo_tabnode->get_node_info( ).
          CALL METHOD lo_tabnode_info->set_attribute_value_help
            EXPORTING
              name = 'ZZ_PROLE_R3'
              value_help_mode = 131 "ovs mode
              value_help = 'OVS'
          CALL METHOD lo_tabnode_info->set_attribute_value_help
            EXPORTING
              name = 'ZZ_LIFNR_R3'
              value_help_mode = 131 "ovs mode
              value_help = 'OVS'
    and these Object-value selectors seem to work properly: the user can trigger them and the selection populates correctly the related field, in the selected row, of the table.
    So we could say that apparently, everything seems ok. BUT...
    ...if I then SAVE the document, or simply change to another view and come back, the new entries added via search help disappear.
    It's like there's something missing (a binding?) on the "lower" level...But I don't understand what's the point.
    Otherwise, if a value is entered directly by hand by the user, the new row remains persistently (that is to say, direct fill by the user populated correctly the table view AND related fields in the buffer table). Is there something I'm missing?
    This is the third - and last - phase in my OVS method (ON_OVS_R3_ROLE):
    WHEN if_wd_ovs=>co_phase_3.
    *   apply result
            IF ovs_callback_object->selection IS NOT BOUND.
    ******** TODO exception handling
            ENDIF.
            ASSIGN ovs_callback_object->selection->* TO <ls_selection>.
            IF <ls_selection> IS ASSIGNED.
              ovs_callback_object->context_element->set_attribute(
                                     name  = `ZZ_PROLE_R3`
                                     value = <ls_selection>-zz_prole_r3 ).
            ENDIF.
    Help and suggestions are highly appreciated.
    M.
    Edited by: Matteo Montalto on Nov 12, 2010 4:14 PM

    HI,
    I found the clue, but basically I have no idea on why it happens
    This is the point: when I select a possible value from a select list in the OVS help, then the corresponding value(s) on the tables are filled BUT no CHANGE BADI is in this case triggered. Odd thing is that even if I select the field populated by the search help and press ENTER, the BADI isn't triggered.
    Standard behaviour, which happens anytime I enter a value "manually", triggers the CHANGE BADI automatically (I can see in debug that the stack of the calls contains a fire_event_update, that's probably the clue).
    So I guess the point is how to make a selection from a select list in OVS be equivalent to a value enter manually, so that we could generally say that anytime an input is filled  - no matter if by OVS or "by hand" - the underlying CHANGE BADI is triggered.
    Any help or suggestion is really appreciated,
    thanks.

  • Reading attributes of different context nodes

    Hello,
    I want to read attributes of BP_DATA/TaxNumberList Node: BUILHEADER from Node BUILTAXNUMBER.
    I have tried all without success. In GENIL Browser they are not related.
    What can i do?
    Best Regards
    JM

    Hi
    I checked in the Model Browser. Seems 'BuilTaxNumber' has 'BuilHeader' as parent.
    Can you validate once in TCODE GENIL_MODEL_BROWSER for ONEORDER Component set.
    Regards,
    Masood Imrani S.

  • Is it possible to bind the elments with context node dynamically?

    Hi All,
    Is it possible to dynamically bind elements with context nodes?
    In other words, at runtime, can we change the binding of an Inputfield to another context. Or a table to programmatically bind to another table?
    Regards,
    urbashi

    hi urbashi.......
          it is possible..
           you should first pass the id of he ui element and then bind it.
           for ex:
             if there is an input field, you can get the attribute that is bound, using cl_wd_input_field->bound_value.
             if you want to set an attribute, use cl_wd_input_field->bind_value.
             the first one will give an idea of how a valueshould be given.
    ---regards,
       alex b justin

  • Data transfer between 2 views with context nodes

    Hi all,
    I'm working for the moment in CRM 7 with the BSP WD Component Workbench.
    I have a small exercice (just to learn more about the webclient ect) and I have some problems.
    I created 2 views:
    - Worklist (List with all workflow items available for user)
    - Workflow (When choosing a workflow item in the worklist, the workflow will be executed, or whatever...)
    Now, I have a internal table with all workflow data and when I click on one workflow item, I want to give this data (from one record) from my internal table in a Context node tot the seconde view.
    But how?? I realy don't know.
    Can someone help me with this?
    I created a custom controller
    Should I use model nodes or value nodes?
    what next? How can I fill this nodes with the data?
    Any examples?
    Thx!
    Hans

    Hi Hans,
    Check out this link.
    [Reading Attributes from different context nodes in the same view;
    Regards,
    Sijo

  • 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

  • Reading the Context Node in the same Component

    Dear Gurus,
    I have made enhancement to standard view and functionality is working fine.
    Now i need to read the different context node (Different view) from the same component.
    I try to do the way Webdynrpo read the context node  but here there is Wizard and i stucked :-(.
    Can you plz suggest or post small code to read context node.
    Regards.
    ****Poorna****

    Hi,
    If those two views are assinged to one viewset in runtime repositoty, you can read the secod view by following code:
    lv_viewname = me->get_viewarea_content( 'Upper' ).      " here(me =view1)                               
      IF lv_viewname IS NOT INITIAL.
        lr_viewctrl = me->get_subcontroller_by_viewname( lv_viewname ).
        IF lr_viewctrl IS BOUND.
    from here you can read the context nodes.
    Regards,
    S Reddy

  • Unable to bind elements to context

    Hello all,
    As part of POC, I have created a table and have to push some dummy(hard-coded) data into the table. I have limited experience with ABAP OOPS.
    To implement the code, I have the reference to context node. But, there are methods to bind element/elements/structure to the node and not to add element to node.
    Now, i tried to populate the element and add it to internal tab and bind it to context node. It creates an entry in table but the data is not displayed.
    The code is given below:
    method WDDOINIT .
      DATA lo_nd_zviposhead TYPE REF TO if_wd_context_node.
      DATA lo_el_zviposhead TYPE REF TO if_wd_context_element.
      DATA ls_zviposhead TYPE wd_this->element_zviposhead.
      TYPES: BEGIN OF ty_itab,
              node_elements TYPE REF TO if_wd_context_element,
            END OF ty_itab.
      DATA: element_itab TYPE table of ty_itab,
            wa_element type ty_itab.
    navigate from <CONTEXT> to <ZVIPOSHEAD> via lead selection
      lo_nd_zviposhead = wd_context->get_child_node( name = wd_this->wdctx_zviposhead ).
    @TODO handle not set lead selection
        loel_zviposhead = lo_nd_zviposhead->create_element( )._
          loel_zviposhead->set_attribute( name = 'FIELD1' value = '0.601.010.005')._
          loel_zviposhead->set_attribute( name = 'FIELD2' value = 'Ordered')._
          loel_zviposhead->set_attribute( name = 'FIELD3' value = '4')._
          loel_zviposhead->set_attribute( name = 'FIELD4' value = '14')._
          loel_zviposhead->set_attribute( name = 'FIELD5' value = '0')._
          waelement-node_elements = lo_el_zviposhead._
        append waelement to element_itab._
    << the above code which is underlined is repeated to add 3 more sets of data >>
    lo_nd_zviposhead->BIND_ELEMENTS( new_items = element_itab SET_INITIAL_ELEMENTS = abap_true ).
    The result is a table with 4 elements but empty.
    Kindly help me to achieve the result. If any better alternative to push hard-coded data to table, do let me know.
    Thank you.
    regards,
    Sharath

    Hello,
    To add elements to the context, Please have a look at the following code:
    method WDDOINIT .
    " define a local structure type with all the attributes defined in the context
      types: begin of ty_element,
               category type string,
               tooltip  type string,
               date     type d,
               end of ty_element.
      data:
        node_datasource type ref to if_wd_context_node,
        element type ty_element,
        elements  type standard table of ty_element.
      node_datasource = wd_context->get_child_node( name = `DATASOURCE` ). "get the reference to the node
    element-tooltip  = 'Birth day'.
    element-date     = '20100627'.
    element-category = 'ONE'
    append element to elements. "add element to the internal table elements
    element-tooltip  = 'Birth day'.
    element-date     = '20100627'.
    element-category = 'ONE'
    append element to elements.  "add element to the internal table elements
      node_datasource->bind_table( elements ). "bind to the node
    endmethod.
    This works!
    above code is for adding several elements at once to the context node using bind_table.
    If you want to create one element and add it to the context, use the following code:
    lo_el_<node> =
    lo_nd_<node>->create_element( ).
    lo_el_<node>->set_attribute( name = 'attr_name' value = 'attr_value')
    lo_nd_<node>->bind_element(
    new_item = lo_el_<node>
    set_initial_elements = abap_false ).
    Hope this helps!
    Regards,
    Srilatha
    Edited by: Srilatha M on Jun 22, 2010 9:53 AM

  • Using One Context Node's Info in the Setter of Another

    I am very new to WebUI.
    I have a view.  In its context, it already uses context node BUILHeader .  I need to create a field based on BP_NUMBER info in BUILHeader and place the derived information on the screen.
    I created a new context node that has a field  DerivedValue in it. I think I am supposed to populate it in it's P_Setter.  How do I make he information from BUILHeader available to my setter.
    I think this is simple, but I'm new. so I need a good code example here.
    Thank you .
    ...Mike

    Hi
    Like Amar pointed out if it is possible pleae make sure that the field is also in BUILHeader context nide itself.
    If you want it to be in different context node then
    you can use me->typed_context -> "<context_node name >"
    create an attribute  "typed_context" pointing to the context class.
    "<context_node name >" --- Here you can replace the any of the context node which is present in your view!! you can use
    this anywhere inside the view. Hence you will be able to access other context nodes as well within the purview of the view.
    Thanks
    Abishek

  • 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.

  • How to bind UI Element with Context Node Attribute Element

    Hi,
    I'm building my view dynamically in the wdDoModifyView method.
    Is it possible to bind a "TextView" element to a specific element of an attribute node?
    Scenario:
    Node_Employees
    |
    +- Attribute_Code
    |
    +- Attribute_Name
    Node Contents:
    Employees
    |
    +- Code: 1, Name: Employee 1
    |
    +- Code: 2, Name: Employee 2
    |
    +- Code: 3, Name: Employee 3
    I need to do something like binding a TextView UI element to the "Name" attribute of the element #2, what would result to show "Employee 2" on my view.
    How can I do this?
    Thanks in advance,
    Geraldo.

    Hi Saravanan,
    First I populate the context node and it won't change during view's lifecycle.  After that, I build my view and bind the TextView UI elements to the node context attributes elements.
    If the node has 10 elements, I will build 10 TextView UI elements and bind them to each attribute element.
    Regards,
    Geraldo Brígido.

Maybe you are looking for

  • Import an application developed in apex 4.2 to apex 4.1

    I imported my application that i've been developing in 4.1 into 4.2 apex.oracle. I didn't realize it's only forward compatible so when I tried to import back to 4.1, i wasn't able to. Is there any way I can import the app back to apex 4.1? help is gr

  • How to determine page break in smartforms...

    hello, i have a problem in smartform... if my output exceeds more than one page...then i have to print CONTINUED in first page... how can i do that? pls help me.. thanx in advance.. regards, Maya.

  • Production Order confirmed finish date

    Good morning, I have a question concerning the confirmed finish date (GLTRI) on the general tab of the production order header. We have an order that a partial confirmation was done on the last operation with no yield. This was the first confirmation

  • I am trying to transfer my music from itunes to ipad mini.

    Tried sync-ing it many times, but the files just wouldnt move over. Am i doing something wrong? I got this mini last week and set it up from icloud from my iphone 5 back up. So what should i do now?

  • Batch Changing iPhoto File Formats

    I have scanned a few thousand photos and imported them to my iPhoto library. 90% of them are saved in Photoshop format. Most of these photos have comments, locations, and face IDs, The date has been changed to the date the photo was taken. How can I