Sorting field from subordinate context node

Hi everybody,
I have a quite tricky problem:
I like to create a table view which displays attributes from BuilHeader and from BuilAddress.
I created therefore a context node BuildHeader in my view and BuilAddress as subordinate context node, linked together by BuilAddressRel in creation assistent von context node BuilAddress.
When I open the structures view of context nodes, then the parent- and child relationship of both context nodes is visible.
As it is not possible to insert attributes to a table view from no other context node than the directly assigned one (here BuilHeader), I created a new attribute for the address field, which I wanted do add to the table (the field "REGION"). I created the new field with assistant also and it seems to work.
Unfortunately the GET_* method of the new attribute was generated false so that I had to change the coding. I fetched the reason from the BuilAddress related entity and selected the region text for the region code. The region text has finally also been displayed but now I have the problem that I cannot sort this added atrribute column for REGION. All other columns can be sorted properly but only the one i need for sorting can't be :-(
Can anybody tell me if some kind of workarround exists to make this added column also sortable?
Thanks an best regards,
Markus

Hello Markus,
You might need to enhance the GET_P-method to make the field sortable end also eventually the EH_ONSORT-method as well.
I have created a thread about this in the past:
http://scn.sap.com/thread/3270416
Best regards,
Thomas Wagner

Similar Messages

  • Set value of zzidarea from another context node

    Hi is it possible to set the value of the zzidarea field of the context node header from the method  get_employeename of the context node employeename?
    Thanks!!

    Hi,
            Your question should be framed better. I suppose that you are trying to set the value of a header attribute from one of the child relations. Assuming that the relations are buffered, it is possible to reach the header entity by using the get_parent or get_root and using relations again. However it is not a good practice trying to set values in a getter method. You should find another proper approach to your problem.
    Regards,
    Arun Prakash

  • How to get value from one context node to otehr contect conde in diff views

    Hello Guru's
    We have a rek which is of getting the value from one context node to other context node,
    for example there is Total value in BT111H_OPPT/ITEMLIST (One context node) we need to have the same Total value in the in BT111H_OPPT/DETAILS (other context node) automatically
    Inputs are highly appricated.......

    Hello,
    Thanks for your Reply
    But my rek is i want to get value from different views
    eg BT111H_oppt/itemslist(contex node - BTADMINI) field net value to BT111h_opp/Details(Context node - BTopporth)
    for this which method should i use to chive this.
    Thanks..

  • 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 search data from a context node.

    Hi Friends,
    Thanks for ur help for previous problem . I am facing some other problem i.e how to
    search data from a context node.
    i have a context node :-
    Car(main node) which consist of details, owners, engine and Brand  as its sub node.
    the value attibutes of difft nodes are:-
    Car-  category
    Details-  Mileage, Price, registration_no, miles_used
    owner -  name, phnno,addrs
    Brand -  main_brand, co_brand
    Engine- Bhp,Rpm
    Now i have to apply a search criteria on the basis of price, miles_used .
    pls help to implement that .
    Thanks & regards
    Pravin jha

    Hi PRAVIN,
                       What I can understand from your problem is that, you have a list with various properties and you want to display them and search them in your WD App. If I am correct, use the following approach:
    Instead of using "details, owners, engine and Brand" Nodes, use the attributes inside the parent node. i.e in the node Car, add all the attributes viz. Mileage, Price, registration_no, miles_used, name, phnno,addr etc.
    Now you can create a table of this node "Car" and can easily search on the basis of any criteria.
    I hope this solves your issue. If you are looking for something else, please revert, I'll be happy to help you.
    Cheers!!!
    Umang

  • How to call a method in IMPL class from one context node

    Hi, I´ve been only study the posibility to access a method in the IMPL class  from one context node class...CN## without using events, is there a way to call it ??? I don´t have it as requierement just learning thanks !.

    Hi,
    Try this by following this you can get the custom controller instacne in the view context nodes, for your requirement you can keep the view implementation class instance instead of cuco..
    To get the custom controller instance in Context node getter/setter method:
    1. Declare Cuco instance reference variable in ctxt class..
    2. Set this cuco ref. in the Create context node method of ctxt class:
    try.
    gr_cucoadminh ?= owner->get_custom_controller( 'ICCMP_BTSHEAD/cucoadminh' ). "#EC NOTEXT
    catch cx_root.
    endtry.
    you can avoid this step as this is not needed in case of view isntance
    3. Assign this instance to the respective context node Create method using:
    BTStatusH->gr_cuco ?= gr_cucoadminh.  " here assign the view implementation ref. " me" instead of gr_cucoadminh
    Here gr_cuco is the ref. variable of custom controller in the respective context node for eg. BtstatusH
    Sample implementation of this can be found in
    ICCMP_BTSHEAD/BTSHeader ->context node BTACTIVITYH-> attr ->GR_CUCO(instance of cuco)
    Cheers,
    Sumit Mittal

  • Reading Attributes from same context node of different attributes

    Hi,
    I  want read Attributes from same context nodes of diifrent attributes.
    I have attribute A and B of same node, want to get read value from  atrribute A into B.
    Regards,
    Brahmaji

    solved
    DATA: lv_current TYPE REF TO if_bol_bo_property_access.
       DATA: lv_value type String.
       IF iterator IS BOUND.
        lv_current = iterator->get_current( ).
      ELSE.
        lv_current = collection_wrapper->get_current( ).
      ENDIF.
      CALL METHOD current->get_property_as_string
            EXPORTING
              iv_attr_name = 'ZZAFLD00004Y'
            RECEIVING
              rv_result    = lv_value .

  • Retrieve data from other context node within the same context

    Hi Experts,
    I want to redefine method BUILD_TABLE for a table context node and I need to access data from another context node within the same context. I have looked through the methods of class CL_BSP_WD_CONTEXT_NODE_TV but could not find a mean of retrieving the other context nodes.
    Any ideas?
    Thanks a lot. Your help is appreciated.
    Cheers,
    Jens

    Hi Jens,
    Check this [wiki|http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=201066680] it should be helpful.
    Regards,
    Shobhit

  • Need status from other Context-Node

    Hello,
    I need the status "STRUCT.ACT_STATUS" from context-node "BTSTATUS" to fill the value help of a new field "STRUCT.ZZORDERADM_H0121" in context-node "BTADMINH" in method "GET_V_ZZORDERADM_H0121". I don't know how to do this.
    Component: BT111H_OPPT
    View: BT111H_OPPT/Details
    Any ideas?
    Thank you,
    Ole.

    Hi,
    see the example code here:
    data: lr_adminh type ref to cl_crm_bol_entity,
          lr_currentstatus type ref to cl_crm_bol_entity,
          lr_btstatush type ref to cl_crm_bol_entity,
          lv_status type string.
         try.
            lr_adminh ?= collection_wrapper->get_current( ).
            lr_btstatush ?= lr_adminh->get_related_entity( 'BTHeaderStatusSet' ).
            lr_currentstatus ?= lr_btstatush->get_related_entity( 'BTStatusHCurrent' ).
            if lr_currentstatus is bound.
              lv_status = lr_currentstatus->get_property_as_string( 'ACT_STATUS' ).
            endif.
         catch cx_sy_ref_is_initial cx_sy_move_cast_error cx_crm_genil_model_error.
          endtry.
    regards
    Ismail

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

  • 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

  • Field Currency of Context Node BTADMINH - How to set default

    I've got a field called currency for context node BTADMINH for UI Component BT115QH_SLSQ.
    This component and view and context node are all enhanced.
    This currency field takes values such as USD, EUR, etc (currency values for dollar amount).
    How can I default this field for instance so that when a new sales quotation is created that this field
    is set to USD by default.
    It doesnt look like I can use the BADI : BADI_CRM_BP_UIU_DEFAULTS or can I ?

    Ok If I redefine GET_CURRENCY I can change this value but I would like to call the super class implementation before this:
    method GET_CURRENCY.
    *CALL METHOD SUPER->GET_CURRENCY.
    *  EXPORTING
    *    ATTRIBUTE_PATH =
    **    ITERATOR       =
    *  RECEIVING
    *    VALUE          =
      data: current type ref to if_bol_bo_property_access.
      data: dref    type ref to data.
      value = space.
      if iterator is bound.
        current = iterator->get_current( ).
      else.
        current = collection_wrapper->get_current( ).
      endif.
      try.
          data: coll   type ref to if_bol_entity_col.
          data: entity type ref to cl_crm_bol_entity.
          entity ?= current.
          coll = entity->get_related_entities(
                   iv_relation_name = 'BTHeaderPricingSet' ).   "#EC NOTEXT
          current = coll->get_current( ).
          if current is not bound.
            if entity->is_locked( ) eq abap_true.
              current = entity->create_related_entity(
             iv_relation_name = 'BTHeaderPricingSet' ).         "#EC NOTEXT
              if not current is bound.
                return.
              endif.
            endif.
          endif.
          try.
              dref = current->get_property( 'CURRENCY' ).       "#EC NOTEXT
            catch cx_crm_cic_parameter_error.
          endtry.
        catch cx_sy_ref_is_initial cx_sy_move_cast_error
              cx_crm_genil_model_error.
          return.
      endtry.
      if dref is not bound.
        value = space.
        return.
      endif.
      try.
          value = if_bsp_model_util~convert_to_string( data_ref = dref
                                      attribute_path = attribute_path ).
    "NOTE I ADDED THIS PART, IT WAS NOT PART OF THE SUPER CLASS....
          if value eq ''.
              VALUE = 'USD'.
          endif.
        catch cx_bsp_conv_illegal_ref.
          field-symbols: <l_data> type data.
          assign dref->* to <l_data>.
          concatenate <l_data> '-CURR/QUANT CONV FAILED-' into value
                      separated by space.                       "#EC NOTEXT
        catch cx_root.
          value = '-CONVERSION FAILED-'.                        "#EC NOTEXT
      endtry.
    endmethod.
    Notice I added the part at the bottom that says:
    if value eq ''.
              VALUE = 'USD'.
    endif.
    This works 100% BUT...it forces me to copy the SUPER class implementation and modify within this function, but I dont want to copy super class, I want to call super class then ADD my code....
    That way if SAP does perform any updates in the SUPER class it wont mess anything up.
    But as you see it says:
    *CALL METHOD SUPER->GET_CURRENCY.
    EXPORTING
       ATTRIBUTE_PATH =
       ITERATOR       =
    RECEIVING
       VALUE          =
    So what do I need to do to call SUPER->GET_CURRENCY.
    What value should I assign to attribute path ?
    iterator?
    and receiving value?
    Basically all I want to say in the redefintion of the GET_CURRENCY Method is like so:
    CALL METHOD SUPER->Get_Currency
    If Value = ' '.
    "no value so just assign it to USD
    Value = 'USD'
    End if.
    Edited by: Hermiz Jon on Jan 11, 2011 10:04 PM

  • Concatente field from table with node keys

    HI All
    I have table like the following
    and i need to concatenate all field names that releated to given
    nodekey until i will get to the root
    Field names             parent key       node key
    COMPLEXNODE1               1               4
    COMPLEXNODE2               4               5
    COMPLEXNODE3               5               6
    NODE1                       1               7
    NODE2                       7               8
    For instance if the node key that i provided is 6
    I will get in value field the following
    value_field = COMPLEXNODE1/COMPLEXNODE2/COMPLEXNODE3
    if the node key that was provided is 8
    i will get
    value_field = NODE1/NODE2
    The issue here is that the table can have more than 3 levls deep...
    Regards
    Alex
    Edited by: Alex Dean on Dec 1, 2010 1:15 PM

    HI Rajasekhar Dinavahi ,
    Thanks i try your code but there is a problem with your salution since i get the field route not in the order that i need
    /COMPLEXNODE3/ /COMPLEXNODE2/COMPLEXNODE1
    insted of
    /COMPLEXNODE1/ /COMPLEXNODE2/COMPLEXNODE3
    Regards
    Alex

  • Filling a dropdown from a context node in a adobe form.

    Hi All,
              I have a node 1:n node in context which has 4 set of values.I have created a adobe interactive from and given the node in my interface .For the same node i have created a table and which appears fine with the correct data .Now i want to fill a drop down with the same data can u tell me how to do the same ?
    Thanks & Regards
    Gaurav Jain

    Hi,
    first you need to create one drop down by list or list box as part of adobe form
    you need to provide the one field of you node that is the data source for the list
    may be helpfull to you
    Apparao Nakirikanti

  • Error while retrieving data from a context node

    Hello All,
    I am trying to get the value that will be slected in status field(drop down) of opportunity page.
    lr_bt ?= me->typed_context->BTSTATUSs->collection_wrapper->get_current( ).
    CHECK lr_bt is bound.
    CALL METHOD lr_ent->get_property_as_string(
        EXPORTING
          iv_attr_name = 'ACT_STATUS'
          RECEIVING
          rv_result     = lv_status ).
    On execution i am getting error in web ui. The error states that ACT_STATUS cannot be used. Is it because the status is a dropdown? Kindly help on this.
    Regards
    Chandrakant

    Hi,
    Thanks bhusan and Lakshmi.
    @bhushan : i had used STATUS in my code. But one s got added by mistake while copying and editing here.
    As suggested by Lakshmi the error was that. I could fix the issue. However i am not able to get any value in lv_status.
    I have defined lv_status as string. and i am coding in do_prepare_output.
    how could i know the type of values that status has?? Do i need to use get_property_text?
    Please help on this.
    Regards
    Chandrakant

Maybe you are looking for

  • Strange corruption problem with AVCHD

    This problem is so weird I can't even figure out how to explain it, but here goes: I have video taken in the AVCHD file structure (puts clip into a nesting of folders, the MTS files are playable by Windows Media Player/VLC). The problem I'm having is

  • COND_A01 IDOC

    Hello, I am trying to Load pricing conditions into VB23 using the IDOC COND_A01. It is working fine when I try to create a new record but when I tried to modify the dates on an existing record it is creating an additional entry in table Axxx, which i

  • Save weblog with source code

    Hi, Does anyone an easy way of downloading weblogs with source codes? If I select all/copy&paste into Microsoft Word 2000 (SP3), the source codes get this "nice" frame, where they are scrollable. When I save it and open it again, the source code is n

  • Scroll bars on a tab canvas

    Hi when I run my forms the scroll bar on the tab canvas is disabled. How can enable it?

  • Can't Purchase Unless Using iTunes v6.0??

    I just discovered I can no longer make an ITMS purchase unless I use "...at least iTunes version 6.0..." When (and why) did this absurd restriction get imposed? I'm especially upset because now the only version I apparently can get is 6.0.2, about wh