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

Similar Messages

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

  • Error when I change the visibility of a context node

    Hi,
    I had to change the visibility of a context node (ZActivityH) to public (it was private) in the context to access it in the method DO_HANDLE_EVENT. I used transaction BSP_WD_WORKBENCH. I verify and activate it.
    As a result of changing the visibility, I have this error:
    Class      CX_SY_REF_IS_INITIAL
    Text:      Dereferencing of the NULL reference
    Program:      ZL_CRM_IC_IRECREASON_IMPL=====CP
    Include:      ZL_CRM_IC_IRECREASON_IMPL=====CM00C
    Source Text Row:      8
    The new source code in method DO_HANDLE_EVENT is:
    DATA category TYPE STRING.
    category = ztyped_context->ZActivityH->GET_CATEGORY( ATTRIBUTE_PATH = '' ).
    Any idea about the problem? Can I modify the visibility of a context node?
    Thank you very much for your help.
    María José

    Thanks a lot, Patrick,
    My context node is null, but I don´t know why.
    I have:
    In Class: ZL_CRM_IC_IRECREASON_IMPL
    Attribute ZTYPED_CONTEXT     type ref ZL_CRM_IC_IRECREASON_CTXT
    In class: ZL_CRM_IC_IRECREASON_CTXT
    Attribute ZACTIVITYH      type ref ZL_CRM_IC_IRECREASON_CN10
    In class: ZL_CRM_IC_IRECREASON_CN10
    Method GET_CATEGORY
    In method CREATE_CONTEXT_NODES:
    model = owner->create_model(
          class_name     = 'ZL_CRM_IC_IRECREASON_CN10'
          model_id       = 'ActivityH' ).                       "#EC NOTEXT
      activityh ?= model.
    In view I’m filling the context node:
    Regards,
    María.

  • 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

  • How to map XML to Web Dynpro context nodes?

    Hi All,
    Could anyone tell how xml string can be bound to context nodes ? In my requirement i need to serialize context nodes value to string and deserialize it back to nodes for implementing back naviagtion between views.
    I didnt see much threads achieving this giving details on class cl_wdr_xml_convert_util and methods if_wd_client_conversion_util~string_to_struct.
    I am using wd_context->to_xml to convert into xml.
    From this format, i want to bind it back to context  node.
    When i use this below approch i get short dumb.
    Serialization to xml:
    lv_data_string = wd_context->to_xml( ).
    Deserialization:
      DATA lv_typedescr           TYPE REF TO cl_abap_typedescr.
      FIELD-SYMBOLS:
                     <fs_data>    TYPE ANY TABLE.
      CALL METHOD cl_abap_typedescr=>describe_by_object_ref
        EXPORTING
          p_object_ref         = wd_context
        RECEIVING
          p_descr_ref          = lv_typedescr
        EXCEPTIONS
          reference_is_initial = 1
          OTHERS               = 2.
       try.
      CALL METHOD cl_wdr_xml_convert_util=>if_wd_client_conversion_util~string_to_struct
        EXPORTING
          in            = lv_data_string
          typedescr = lv_typedescr
        IMPORTING
          data      =  <fs_data>
      CATCH cx_wdr_conversion_exception into lo_err .
      lv_exp = lo_err->get_text( ).
    ENDTRY.
      wd_context->bind_table( values = <fs-data>.
    Using this way, i get a short dumb as assert statement is failed as value for  typedescr->type_kind is '*'.
    method if_wd_client_conversion_util~string_to_struct.
      assert typedescr->type_kind = cl_abap_typedescr=>typekind_struct1
          or typedescr->type_kind = cl_abap_typedescr=>typekind_struct2.
      raise exception type cx_wdr_conversion_exception
        exporting textid = cx_wdr_conversion_exception=>illegal_type.
    On debugging changing this value to required also made no difference, as no value could be assigned to the field symbol.
    Suggest a soution to do this.

    Hi Thomas,
    Thanks for your replies.
    I have corrected it, but the field symbol is empty and while debugging it says data type is incorrect.
    code:
      FIELD-SYMBOLS:
                     <fs_data>    TYPE ANY TABLE.
    data:       lsbp type ZXBPCENTRAL,
                   go_ref type ref to data.
    CALL METHOD cl_abap_typedescr=>describe_by_data " ( before it was describe_by_object_ref)
    EXPORTING
    p_data = lsbp
    receiving
    p_descr_ref = lv_typedescr.
    try.
    CALL METHOD cl_wdr_xml_convert_util=>if_wd_client_conversion_util~string_to_struct
    EXPORTING
    in = lv_data_string
    typedescr = lv_typedescr
    IMPORTING
    data = go_ref "<fs_data>
    CATCH cx_wdr_conversion_exception into lo_err .
    lv_exp = lo_err->get_text( ).------> Here the error says " Invalid data type and hence, there is no data.
    ENDTRY.
    assign go_ref->* to <fs_data>.
    I am still looking for solution and thanks a lot ....

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

  • How to populate a context node on the basis of the values in another node?

    Hi,
    I have a Webdynpro application which has to run on Portal as well as BlackBerry.
    In this application I have a scenario where I need to have a sub node inside a node but as Blackberry doesn't support sub nodes with Singleton value false, I have to use another node for storing the values which earlier wre present in the sub node.
    The actual scenario here is that we have two tables A & B. For each row of table A we have a no of rows in table B. This can be easily accomplished for Web Browser but we need to do this for Blackberry.
    My question here is that how can i populate the data in table B at runtime using the concept of onLeadSelect. I am not able to fully undersans this concept.
    According to my approach I have two a while loop which generates data for  table A and inside this while loop I have another while which generates data for table B corresponding to each iteration of the outer while loop. I create the node elements for the rows of the table B and store them in a list and then store this list in a HashMap corresponding to a key formed by combining the values of all the elements of the row of table A.
    Now I am not able to understand how can I display this data into table on user slecting a particular row.
    Please guide ASAP.
    It wille quite useful if you can provide me with some code snippets for the same.
    Thanks in advance!
    Manish

    Hi Manish,
             In WebDynpro u can use the onLeadSelect event of table A and do all the processing in that method.Like u can use this method to fill ur context node,which will be the source node for table B. So this way u need not to use any hash map.Fill the source node of table B with data corresponding to ur selected data of table A.
      I hope this solution wud help u in solving ur problem.
    Reena

  • 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

  • How to read value from Key flexfield added on to the newly created SIT

    Hi Experts,
    I have a requirrment to display a new structure in the Special Information Types (SIT) screen in SSHR. The data entered into the segment needs to be validated using PL/SQL function.
    I have performed below steps to display the structure/field on SIT Page
    1. Created new flexfield structure as XX_LEAVE_ENCASHMENT under the "HUMAN RESOURCE" Application (Application id- 800) and flexfield TITLE "Personal Analysis Flexfield" (PEA).
    2. Added a new segment "Encash Days" for the newly created flexfiled structure "XX_LEAVE_ENCASHMENT".
    3. Added this new structure in the Special Information Types form in HRMS responsibility
    4. The structure is enabled on the SIT screen.
    Now I want to validate the data entered in Encash Days field in this page by calling a PL/SQL function. This can be done by extending the SIT page Controller.
    But how should the ID of the newly enabled segment (in the new Flexfield strucuture) be retrieved in the controller inorder to read the user-entered value (to further call the validation program)? Or is there any other way of achieving this functionality in OAF?
    Please help.
    Thanks.

    Hi,
    Yes, u can get the value from the SIT and perform the relevant validation too.
    Refer http://apps2fusion.com/at/43-ss/453-oaf-extension-case-study
    Regards,
    Gyan

  • How to read two files (one is updating every second, the other is constant) simoltaneously

    Dear All,
    I will appreciate if somebody help me.
    I want to read two files, one is temperature wich is updating every second, and the other is hysteresis energy which has specific rows and is constant.
    I got a program in discussion forum which read a file as it is updating. I checked this program in my case and it works.
    Then I added reading hysteresis energy file to the existing file. But while i am running the program, the hysteresis energy file is read with all rows.
    But the aim is that everytime which temperature updates, I need to read just one row of the hysteresis energy file.
    so, in this way in every second i have a new temperature data and one row of the other file.
    I tried to used "for loop" inside the program, but it did not work, becuase reading temperature will be stopped untill for loop ends.
    I attached the program.
    Could somebody help me how to read just one row of hysteresis energy file everytime temperature updates?
    Solved!
    Go to Solution.
    Attachments:
    Readfiles.vi ‏23 KB

    I do not understand relationship between your two files.
    You have another VI or app that is writing data to both files and when new temperature data added you wish just to read the new data and then read one new line of the hysteresis file?????
    But is one is constant, why do you need to keep reading it?
    Anyway…
    The “Read From Spreadsheet File.vi” preformed an Open and a Close for each time it is called (if you will open the VI up and drill down and you will see). So that resets the file pointer back to the beginning and there for will read in the whole file from the first to the last each time if you do not set the start of read offset or number of rows.
    Now the Read from Binary File does not reset the file pointer and leaves the file pointer just past the last byte read so it will start with any new bytes automaicly only giving you the new data.
    I do not think you need to do the math with the Previous EOF=0 and the File size to get what I think you are trying to do.
    Plus use shift reg for the Data string instead of local var
    Set the mechinacl action of the stop botton to Latched
    So you do not need to init the two controls
    Also, I do not get the End of file encountered error (4) from the Read from Binary file if I attempt to read past. It just returns and empty string.
    Omar
    Attachments:
    Readfiles.vi ‏22 KB

  • How to read an article from aol finance news and the insert in mail to other aol user.

    I open up aol personal finance thru firefox. When I used aol as my provider I used to be able to send the article to another aol user by just hitting a forward tab and applying the address. Now that I dont use aol I dont have the tab and dont know how to send the article. There are a few articles that have a tab that says e mail a friend but not all of the articles.

    Hi Marc,
    Thanks for u r reply. But i am not using any java mail api to send the email. The Oracle BPEL provides an email activity for this and i am using the same to send the email. But when i include the <img> tag with "src= filename" i am unable to display the image. I think there is a ptoblem in passing the exact address of the image file. Do you have any idea abt where to place the image in order to use it in the bple process.
    -Abhi

  • Not able to set the value in marketing context node for BP_HEAD

    Hi,
    I am trying to set the value in marketing node of BP_HEAD from bp_addr component. i am calling the set_property method but it is not changing the value, when i debugg the code, it actually changing the value in bol structure but it is not calling the get/set method of bp head.
    i am working on BP corporate person  creation i.e. in bp_head component and account details view. I added the marketing attributes in UI configuration and also the address attributes.
    this is what i coded in get method of country in standardaddress context node of BP_ADDR
    lv_entity ?= current.
        IF lv_entity IS BOUND.
          lv_parent = lv_entity->get_parent( ).
          IF lv_parent IS BOUND.
            lv_entity_mkt = lv_parent->get_related_entity( iv_relation_name = 'BuilMarketingRel' ).
            IF lv_entity_mkt IS BOUND.
              CALL METHOD lv_entity_mkt->set_property
                EXPORTING
                  iv_attr_name = 'ATTRIBUTE'
                  iv_value     = attribute1.
    Can anyone please guide me on how to set the value cross component and can we call the get/set method of that attribute which is not in same component?
    Regards,
    Kamesh Bathla

    Sorry, what I said was rubbish, because the LSMW and the session run in different external sessions.
    I have searched forum for these terms: "company BUK parameter BDC background"
    These threads Is it possible to set default company code in SM35? and Release BDC in SM35 in background, How to set defaul company code? seem promising, but I'm not sure they really solve.
    In case these threads don't help you, I think you can create your own Z transaction which sets the BUK parameter id and then does a LEAVE TO TRANSACTION 'ABAON'. Then create again the recording on the Z transaction.
    If you are using ECC6, then you may also enhance the standard to reset BUK parameter id at the very beginning of ABAON, in case it's run in batch input (sy-binpt = 'X'). Be careful as sometimes SAP does batch input on some transactions, so that could make the standard fail.
    Last thing, you can contact SAP support, though it might probably be considered as consulting.

  • Access attribute of a context node in another context node of the same view

    Hi all,
    I want to acess value of an attribute PERNR of context node CUSTOMERS in another context node AUTHENTICATION of the same view. A sample syntax would be helpful .
    Thanks,

    You didn't specify your version of Oracle so here are two options. If 10.2 or greater, use XMLTable, else use the ExtractValue option.
    -- The WITH simply simulates your existing table that I do not have.
    WITH fake_tab AS
    (SELECT XMLTYPE('<?xml version="1.0" encoding="ISO-8859-1"?>
    <Settings>
      <Setting Name="A1" Value="N"/>
      <Setting Name="A2" Value="N"/>
      <Setting Name="A3" Value="SOMEVALUE"/>
      <Setting Name="A4" Value="N"/>
      <Setting Name="A5" Value="Y"/>
      <Setting Name="A6" Value="N"/>
    </Settings>
    ') tab_col
      FROM dual)
    -- For 10.2 and higher use this SELECT
    SELECT a5
      FROM fake_tab,
           XMLTABLE('/Settings'
                    PASSING fake_tab.tab_col
                    COLUMNS
                    a5   VARCHAR2(10)  PATH 'Setting[@Name="A5"]/@Value');
    -- For 10.1 and before
    SELECT ExtractValue(tab_col, '/Settings/Setting[@Name="A5"]/@Value')
      FROM fake_tab;

Maybe you are looking for