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

Similar Messages

  • How to read the attribute in mapping..

    Hi,
    My source XML looks like this
    <GLDEBITACCT>
                <VALUE>0545-K-2006605-5500001</VALUE>
                <GLCOMP glorder="0">0545</GLCOMP>
                <GLCOMP glorder="1">K</GLCOMP>
                <GLCOMP glorder="2">2006605</GLCOMP>
                <GLCOMP glorder="3">5500001</GLCOMP>
      </GLDEBITACCT>
    Where glorder is the attribute of GLCOMP. Now I have requirement to read the attribute ( atleast 2 of them)
    I have to map to target field checking the value in glorder="1
    For e.g. with above XML, if the value in glorder="1 is K than map value from glorder="2 (2006605) to Target 1.
    IF the glorder="1 is P map the value in glorder="2 to Target 2 and goes on for another one
    How can i acheive this mapping. When I tried putting the value of glorder, i am not getting anything.
    Regards,

    Hi,
    You can use below UDF. Please make sure to select context parameter while creating UDF. There will be 3 input arguments for this function:
    1. GLCOMP (a)
    2 @glorder   (b)
    3 Constant   (c)  --depending upon the target node
    Also conext of attribute @glorder should be same as that of GLCOMP.
    //write your code here
    for(int i=0;i<a.length;i++)
        if(b<i>.equals("1")&&c[0].equals(a<i>))
        for(int j=0;j<a.length;j++)
              if(b[j].equals("2"))
         result.addValue(a[j].toString());
                            break;
    For target node target1 use K as 3rd argument, for target node target2 use P and so on.
    Let me know how it works.
    Regards,
    Anirudh.

  • How to read the attribute of the xml file using jaxb

    Thanks,
    Buddy as i have a issue i have to read the xml file using jaxb and xml file contains this data and i have read the attribute like name , desc and action for a particular menu name pls tell the code how to do this it will be a great favour to me
    thanx in advance
    Rasool
    <contextmenu>
    <menu name='Lead' >
    <menuitem name='newlead' desc='New Lead' action='/leads.do?dispatch=insert' />
    <menuitem name='editlead' desc='Edit Lead' action='' />
    <menuitem name='leadinfo' desc='Lead Information' action='' />
    </menu>
    <menu name='Cases' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    <menu name='Contact' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    </contextmenu>

    What my program do is to get the encoding of XML files and convert them to UTF-8 encoding files, while I need this "encoding" information of the original XML document thus I can convert...
    After reading specifications and JDOM docs, the truth turns to be disappointed, no function is provided to get this information in JDOM level 2(the current released one), while it's promissed that this function will be provided in JDOM level API....
    Thanx all for your help and attention!!!

  • Help on how to read the content of an XML file from the payload

    I have a receiver channel / mail adapter, that sends e-mails with a XML attachment.
    I’m trying to write a Bean, that should make it possible to rename the attached XML file dynamically.
    In the Bean I want to read the content of the attached XML file, it could be the “order number”.
    The filename should then be “Order number”.XML.
    <u><i>Can anyone help me with how to read the content of the XML file from the payload.</i></u>
    <i><b>Frank</b></i>

    hi,
    check this: http://jakarta.apache.org/poi/

  • Cannot read attribute of another context node in a context node

    Hello Sap gurus,
    such a long time that I do not post any issue. Now unfortunately time has come down.
    My functional requirement is that whenever the status of an opportunity is changed from "Won" to "Booked", then I have to retrieve the Status reason previously marked for the status "Won" and paste into the attribute Status_Reason (CON_KEY) for status "Won".
    In order to do that I need to read the context node BTADMINH or ZBTCUSTOMERH from the context node BTSUBJECT, in the method GET of attribute CON_KEY.
    I have implemented the following code in the method GET_CONC_KEY of the context node BTSUBJECT.
      DATA:
              lr_entity TYPE REF TO cl_crm_bol_entity,
            lr_comp TYPE REF TO ZL_BT111H_O_DETAILS_IMPL,
             lv_ref_guid     TYPE        crmt_object_guid,
             lr_collection TYPE REF TO cl_crm_bol_bo_col,
             lr_bdc type ref to  if_crm_ui_data_context.
        TRY.
    lr_entity ?= lr_comp->ZTYPED_CONTEXT->ZBTCUSTOMERH->collection_wrapper->get_current( ).
         lv_ref_guid = lr_entity->get_property_as_string( iv_attr_name = 'REF_GUID' ).
          CATCH cx_sy_ref_is_initial.
          ENDTRY.
    Whenever I try to read the context node BTADMINH or ZBTCUSTOMERH from BTSUBJECT  I got always the same dump:
    OBJECTS_OBJREF_NOT_ASSIGNED ZL_BT111H_O_DETAILS_CN06======CP CRM
    Somethins is defitenely wrong and I am at the moment stuck with this code.
    Please any help is really welcome.
    Thanks in advance,
    Andrea

    Hi Andrea,
    Sorry I got it wrong , for lr_comp you will have to take reference from controller IMPL class.
    DATA:
              lr_entity TYPE REF TO cl_crm_bol_entity,
            lr_comp TYPE REF TO ( component controller IMPL class),
             lv_ref_guid     TYPE        crmt_object_guid,
             lr_collection TYPE REF TO cl_crm_bol_bo_col,
             lr_bdc type ref to  if_crm_ui_data_context,
             comp_controller type cl_bsp_wd_component_controller.
    lr_comp  ?= me->comp_controller.
    IF lr_comp IS BOUND.
        TRY.
    lr_entity ?= lr_comp->ZTYPED_CONTEXT->ZBTCUSTOMERH->collection_wrapper->get_current( ).
         lv_ref_guid = lr_entity->get_property_as_string( iv_attr_name = 'REF_GUID' ).
          CATCH cx_sy_ref_is_initial.
          ENDTRY.
    ENDIF.
    Hope it helps.
    Regards,
    Manjeet Singh.

  • How to read the attributes of XML file

    Hi this is ant,
    I am new to java, XML, I have a senario
    1) I have to read all the href attributes for topicref child, and then read the corresponding xml file which is mapped in href="".
    First.xml
    <map>
    <topicref nav="garage" href="task/gar/view.xml" class="..">
    <linktext class="_map/linktext">Garage</linktext>
         <topicref nav="" href="task/gar/change.xml" ..>
    <linktext class="_map/linktext">Garage</linktext>
    </topicref>
    </linktext>
    </topicref>
    </map>
    2) task/gar/view.xml file , has id attribute & need to get the id values.
    Like this I have to get the id values for all the href attributes of first xml & read correspoding id values.
    I have just read some doc using XPATH we can do, please help me.
    Thanks.
    anto

    * Try this Link, there is solution
    http://forums.sun.com/thread.jspa?messageID=9665228
    Can...Can...If we try...!

  • How to read the attribute of a XML element? Please help!

    Hi experts,
            <Batch>
                  <BatchCode ID= AA>
                    <DeliveryNote>190098</DeliveryNote>
                    <LotQuantity>1560</LotQuantity>
                  </BatchCode>
                  <BatchCode ID= BB>
                    <DeliveryNote>190098</DeliveryNote>
                    <LotQuantity>1560</LotQuantity>
                  </BatchCode>
              </Batch>
            Target message:
                <BatchDelivery>
                  <DeliveryNote>190098</DeliveryNote>
                  <DNQuantity>1560</LotQuantity>
                </BatchDelivery>
           From the source message I want to pull only those batch details where ID is BB.
           How to handle thsi in mapping?
    Thanks
    Gopal

    Hi Prabhu,
             I ma sorry I have two levels of checks in my source XML.
    <Batch>
    <BatchCode ID= AA>
    <BatchLabel>Primary</BatchLabel>
    <DeliveryNote>190098</DeliveryNote>
    <LotQuantity>1560</LotQuantity>
    </BatchCode>
    <BatchCode ID= BB>
    <BatchLabel>Secondary</BatchLabel>
    <DeliveryNote>190098</DeliveryNote>
    <LotQuantity>1560</LotQuantity>
    </BatchCode>
    <BatchCode ID= BB>
    <BatchLabel>Primary</BatchLabel>
    <DeliveryNote>190098</DeliveryNote>
    <LotQuantity>1560</LotQuantity>
    </BatchCode>
    </Batch>
    So I need to pull batch details where first the BatchCode ID= AA and then where BatchLabel value is 'Primary'
    Target message:
    <BatchDelivery>
    <DeliveryNote>190098</DeliveryNote>
    <DNQuantity>1560</LotQuantity>
    </BatchDelivery>
    How to do the graphical mapping for this situation?
    Thanks
    Gopal

  • How to read the value of OLAPDataGrid cell/s from external object

    Hi,
    I have an OLAPDataGrid control in an Adobe flex application,
    and I am using the cutom renderer to render the cells of the
    OLAPDataGrid ,
    any Idea how I can read the value of each cell at the
    renderer , so I will be able to decide about the actions for each
    cell at the renderer?

    "j_shawqi" <[email protected]> wrote in
    message
    news:gkqgdl$539$[email protected]..
    > Hi,
    > I have an OLAPDataGrid control in an Adobe flex
    application,
    > and I am using the cutom renderer to render the cells of
    the OLAPDataGrid
    > ,
    > any Idea how I can read the value of each cell at the
    renderer , so I will
    > be
    > able to decide about the actions for each cell at the
    renderer?
    I'm thinking that you'll need to look at the listData
    property. I'm not
    sure what you get in an OLAP Grid that orients you to your
    cell position,
    but I'd set a break point in the listData override of your
    renderer and see
    what you actually have, or look at the docs for the data type
    of the
    listData object that the default renderer expects to get.
    HTH;
    Amy

  • How to read the column name of a table from sap system using C#?

    Hi!!
    I am using SAP .NET connector and creating a windows application.
    Now I wanna read the column name when a table name is given....
    Connection is done, but I don't know the code to read the column names alone...
    Can anyone help me with the code??

    fine!!
    So if i give the table name, which the RFC_READ_TABLE function module have, will it run properly? or i wanna change all the codes in order to support RFC_READ_TABLE function module?
    Because from the beginning I was using BAPI_CUSTOMER_GETLIST function, but my client requirement is to use ERP function module RFC_READ_TABLE, he didn't give any table name also..
    This is my code: What I have to change in this???
    ECCDestinationConfig ECCDestination = new ECCDestinationConfig();
                RfcDestinationManager.RegisterDestinationConfiguration(ECCDestination);
                RfcDestination rfcDest = null;
                rfcDest = RfcDestinationManager.GetDestination(a);
                    RfcRepository repo = rfcDest.Repository;
                    IRfcFunction customerList = repo.CreateFunction("BAPI_CUSTOMER_GETLIST");
                    IRfcTable addressData = customerList.GetTable("AddressTable"));
                    int j = addressData.Metadata.LineType.FieldCount;
                    for (int i = 0; i < j; i++)
                        RfcElementMetadata metadata = addressData.GetElementMetadata(i);
                        listallcolumn.Items.Add(metadata.Name);
    Message was edited by: Jeswin Rebil

  • Portal Development: How to get the attribute names of a node in view/page?

    I am not able to find any standard method or a way to find the number of attributes and names of those attributes of a node at runtime.
    is there any other way of doing it?
    if i am misssing something(quite possible as i am just 2 weeks old in ES) please let me know.
    regards
    Nitin

    Thanks Robin,
    i was able to get a work around for this. For the time being i am using the following code snippet, i will try using the one u sent an will see if this works too.
    // create nodeinfo object for the node that table will bind to
    final IWDNodeInfo nodeinfo = wdThis.wdGetContext().node<NODENAME>().getNodeInfo() ;
    //get the structure of the node
    final IStructure struct = nodeinfo.getStructureType() ;
    Iterator iter = nodeinfo.iterateAttributes() ;
    if (null != struct)
    totalFields = struct.getNumberOfFields();
    else
    for ( Iterator i = nodeinfo.iterateAttributes(); i.hasNext(); i.next() )
              totalFields++;
    for(count = 1; count <= totalFields; count++)
         fieldName = nodeinfo.getStructureType().getField(count).getName();

  • How to update a webdynpro context node from flex ?

    Hi
    I have an table in webdynpro and a datagrid in flex, both getting the value from the same context node. My requirement is to make the table fields editable and when I make changes in the datagrid, it should get reflected back in the webdynpro table.
    So how can I access the internal table's context node from flex ?
    Can anyone help me with this.

    Hi,
    As you are using a datasource, i assume you have set method in flex to read the datasource(context node). What you need to do is store the reference to this datasource in a local flex variable. Have a look at the below code:
    private var refreshFlexUINode:ArrayCollection;
    public function set refreshFlexUI(datasource:ArrayCollection):void
        refreshFlexUINode=datasource;
    and say you want to edit one row of the table, get that row from ArrayCollection and assign the new value.
    it would be like, if you want to save second row of the datagrid
    Object obj = refreshFlexUI.getItemAt(1)
    obj[<CONTEXT_ATTR_NAME>]=<new value>
    Hope this helps!
    Best Regards,
    Srilatha
    Edited by: Srilatha M on Jun 28, 2011 6:34 AM
    Edited by: Srilatha M on Jun 28, 2011 6:35 AM

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

  • BOL: How to read the value of an attribut

    Hiii experts,
    I'm new in ABAP programming.
    My intention is to read the value of a context attribut.
    This attribut ist not in form of a struct attribut. To read an struct attribut, I know to get the value, for example:
    value ?= me->typed_context->BP_ADDR->collection_wrapper->get_current( ).
      CHECK value IS BOUND.
      value->get_property_as_value(
        EXPORTING
          iv_attr_name = 'CITY'
        IMPORTING
          ev_result    = value_city).
    But my problem is, that I have an attribut, which you can not find in the BOL browser, because it is not in form of a struct.
    Can anybody help me, how to read the value of this kind of attributs.
    Thank you very much in advance fpr your help,
    John

    Hii Clemens,
    first of all, my concern deals with WebUI.
    I expect to read the value of an attribut. I know how to read the value of an attribut, which can be found with the same description in the bol browser, as you know you can read it with:
    value ?= me->typed_context->BP_ADDR->collection_wrapper->get_current( ).
      CHECK value IS BOUND.
      value->get_property_as_value(
        EXPORTING
          iv_attr_name = 'CITY'
        IMPORTING
          ev_result    = value_city).
    Now, I have an attribut of an context node which has a different name as in bol browser. If I want to read the value with the code above I get an error message. Thatswhy I referenced a collection of the context node to read this attribut.
    Can anybody say me how the value of the attribut, can I use the methode get_property ?
    greetings,
    J

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

Maybe you are looking for