Inserting an attribute to a specific node

Dear All,
am a bit new to xml and was hoping to get some help on this task am trying to complete.
Using PL/SQL am generating xml of a query through Dbms_Xmlgen.Getxml.
my returned result looks something like this
<?xml version="1.0"?>
<ROWSET>
<ROW>
  <SHUFFLER_ID>5</SHUFFLER_ID>
  <PARENT_ID>3</PARENT_ID>
  <SHUFFLER_STATUS>1</SHUFFLER_STATUS>
  <SHUFFLER_TYPE>Auto</SHUFFLER_TYPE>
  <SHUFFLER_NAME>It has a name</SHUFFLER_NAME>
  <SHUFFLER_START_DATE>27-AUG-10</SHUFFLER_START_DATE>
  <SHUFFLER_END_DATE>31-AUG-10</SHUFFLER_END_DATE>
  <SHUFFLER_SIMULATOR>0</SHUFFLER_SIMULATOR>
  <SHUFFLER_SMS_ENABLED>1</SHUFFLER_SMS_ENABLED>
  <SHUFFLER_MINIMUM_TRANS>5</SHUFFLER_MINIMUM_TRANS>
  <SHUFFLER_TICKETS_PER_TRANS>1</SHUFFLER_TICKETS_PER_TRANS>
  <SHUFFLER_ACCUMILATIVE>1</SHUFFLER_ACCUMILATIVE>
</ROW>
</ROWSET>I would like to somehow insert an attribute into ROWSET node to become something like this
<?xml version="1.0"?>
<ROWSET IS_SUCCESS="1">
<ROW>
  <SHUFFLER_ID>5</SHUFFLER_ID>
  <PARENT_ID>3</PARENT_ID>
  <SHUFFLER_STATUS>1</SHUFFLER_STATUS>
  <SHUFFLER_TYPE>Auto</SHUFFLER_TYPE>
  <SHUFFLER_NAME>It has a name</SHUFFLER_NAME>
  <SHUFFLER_START_DATE>27-AUG-10</SHUFFLER_START_DATE>
  <SHUFFLER_END_DATE>31-AUG-10</SHUFFLER_END_DATE>
  <SHUFFLER_SIMULATOR>0</SHUFFLER_SIMULATOR>
  <SHUFFLER_SMS_ENABLED>1</SHUFFLER_SMS_ENABLED>
  <SHUFFLER_MINIMUM_TRANS>5</SHUFFLER_MINIMUM_TRANS>
  <SHUFFLER_TICKETS_PER_TRANS>1</SHUFFLER_TICKETS_PER_TRANS>
  <SHUFFLER_ACCUMILATIVE>1</SHUFFLER_ACCUMILATIVE>
</ROW>
</ROWSET>Any idea how I can do something like this?

Hi,
Assuming "doc" is an XMLType variable containing your XML document, you can do :
SELECT insertchildxml(doc, 'ROWSET', '@IS_SUCCESS', '1') INTO doc FROM dual;Slightly off-topic, but to add attributes to ROW elements, DBMS_XMLGEN can handle it for us provided we prefix column aliases with "@".
For example :
SQL> SELECT dbms_xmlgen.getXML('SELECT ''Hello!'' as "@msg" FROM dual') FROM dual;
DBMS_XMLGEN.GETXML('SELECT''HE
<?xml version="1.0"?>
<ROWSET>
<ROW msg = "Hello!">
</ROW>
</ROWSET>
Edited by: odie_63 on 2 nov. 2010 12:50 - added remark on ROW attributes

Similar Messages

  • XSLT Mapping - replacing attribute value of a specific node

    Hi,
    I want to replace the value of an attribute for a specific node. Can you please tell me how this can be achieved using XSLT coding?
    The input file is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <GovTalkMessage xmlns="http://www.govtalk.gov.uk/CM/envelope">
         <EnvelopeVersion>2.0</EnvelopeVersion>
         <Header>
              <MessageDetails>
                   <Class>IR-PAYE-MOV</Class>
                   <Qualifier>request</Qualifier>
                   <Function>submit</Function>
                   <CorrelationID/>
                   <Transformation>XML</Transformation>
                   <GatewayTimestamp/>
              </MessageDetails>
              <SenderDetails>
                   <IDAuthentication>
                        <SenderID>isv142</SenderID>
                        <Authentication>
                             <Method>MD5</Method>
                             <Value>1L2xFE8WqHHI5iVMGhixAg==</Value>
                        </Authentication>
                   </IDAuthentication>
              </SenderDetails>
         </Header>
         <GovTalkDetails>
              <Keys>
                   <Key Type="TaxOfficeNumber">123</Key>
                   <Key Type="TaxOfficeReference">MD345</Key>
              </Keys>
              <ChannelRouting>
                   <Channel>
                        <URI>0142</URI>
                   </Channel>
              </ChannelRouting>
         </GovTalkDetails>
         <Body>
              <IRenvelope xmlns="http://www.govtalk.gov.uk/taxation/PAYE/MOV/09-10/1">
                   <IRheader>
                        <Keys>
                             <Key Type="TaxOfficeNumber">123</Key>
                             <Key Type="TaxOfficeReference">MD345</Key>
                        </Keys>
                        <PeriodEnd>2009-09-29</PeriodEnd>
                        <DefaultCurrency>GBP</DefaultCurrency>
                        <IRmark Type="generic">03Bfkipk6UDWSXLj77ObBVoK894=</IRmark>
                        <Sender>Company</Sender>
                   </IRheader>
                   <InYearMovements>
                        <EmployerName>form p60</EmployerName>
                        <P46 Statement="A">
                             <Name>
                                  <Fore>Smith</Fore>
                                  <Sur>John</Sur>
                             </Name>
                             <Address>
                                  <Line>Sterling Residency</Line>
                                  <Line>Gehde</Line>
                                  <Line>Hedge End</Line>
                                  <Line>Southampton</Line>
                                  <PostCode>12345678</PostCode>
                             </Address>
                             <WorksNumber>20090030</WorksNumber>
                             <NINO>NP258719D</NINO>
                             <BirthDate>1985-07-11</BirthDate>
                             <Gender>male</Gender>
                             <StartDate>2009-04-20</StartDate>
                             <TaxCodeInUse>647L</TaxCodeInUse>
                        </P46>
                   </InYearMovements>
              </IRenvelope>
         </Body>
    </GovTalkMessage>
    I want to replace the value 'http://www.govtalk.gov.uk/taxation/PAYE/MOV/09-10/1' of attribute xmlns belonging to the node 'IRenvelope' with the value 'http://www.govtalk.gov.uk/taxation/PAYE/MOV/10-11/1'
    So the output of the mapping should be:
    <?xml version="1.0" encoding="UTF-8"?>
    <GovTalkMessage xmlns="http://www.govtalk.gov.uk/CM/envelope">
         <EnvelopeVersion>2.0</EnvelopeVersion>
         <Header>
              <MessageDetails>
                   <Class>IR-PAYE-MOV</Class>
                   <Qualifier>request</Qualifier>
                   <Function>submit</Function>
                   <CorrelationID/>
                   <Transformation>XML</Transformation>
                   <GatewayTimestamp/>
              </MessageDetails>
              <SenderDetails>
                   <IDAuthentication>
                        <SenderID>isv142</SenderID>
                        <Authentication>
                             <Method>MD5</Method>
                             <Value>1L2xFE8WqHHI5iVMGhixAg==</Value>
                        </Authentication>
                   </IDAuthentication>
              </SenderDetails>
         </Header>
         <GovTalkDetails>
              <Keys>
                   <Key Type="TaxOfficeNumber">123</Key>
                   <Key Type="TaxOfficeReference">MD345</Key>
              </Keys>
              <ChannelRouting>
                   <Channel>
                        <URI>0142</URI>
                   </Channel>
              </ChannelRouting>
         </GovTalkDetails>
         <Body>
              <IRenvelope xmlns="http://www.govtalk.gov.uk/taxation/PAYE/MOV/10-11/1">
                   <IRheader>
                        <Keys>
                             <Key Type="TaxOfficeNumber">123</Key>
                             <Key Type="TaxOfficeReference">MD345</Key>
                        </Keys>
                        <PeriodEnd>2009-09-29</PeriodEnd>
                        <DefaultCurrency>GBP</DefaultCurrency>
                        <IRmark Type="generic">03Bfkipk6UDWSXLj77ObBVoK894=</IRmark>
                        <Sender>Company</Sender>
                   </IRheader>
                   <InYearMovements>
                        <EmployerName>form p60</EmployerName>
                        <P46 Statement="A">
                             <Name>
                                  <Fore>Smith</Fore>
                                  <Sur>John</Sur>
                             </Name>
                             <Address>
                                  <Line>Sterling Residency</Line>
                                  <Line>Gehde</Line>
                                  <Line>Hedge End</Line>
                                  <Line>Southampton</Line>
                                  <PostCode>12345678</PostCode>
                             </Address>
                             <WorksNumber>20090030</WorksNumber>
                             <NINO>NP258719D</NINO>
                             <BirthDate>1985-07-11</BirthDate>
                             <Gender>male</Gender>
                             <StartDate>2009-04-20</StartDate>
                             <TaxCodeInUse>647L</TaxCodeInUse>
                        </P46>
                   </InYearMovements>
              </IRenvelope>
         </Body>
    </GovTalkMessage>
    Thanks & Regards,
    Aditi Naik

    Hi,
    You get name of an attribute by this code
    <xsl:for-each select="@*">
        <xsl:text>Value of </xsl:text>
               <xsl:value-of select="name(.)"/>
        <xsl:text> is </xsl:text><xsl:value-of select="."/>
    </xsl:for-each>
    Change value by providing new value in <xsl:value-of select="."/>
    Regards
    suraj

  • Xml search for specific node/attribute

    Hi,
    I load an xml in as3 and need to find and output (as an
    XMLList) a specific node with a specific attribute (example:
    <xs:element name="abcd"> ), or at least find out its path
    (after, I would know what to do to get the XMLList). I looked at
    the XPath classes for Actionscript but the documentation is very
    poor and I did not see any method doing this. Could someone help me
    please? If no method exists, how can I loop through all the xml and
    test each node to see if it is the proper node I am looking for?
    thanks so much in advance for your help
    Pierrot

    You could do it this way, using the descendant accessor:
    var xml:XML =
    <data xmlns:xs="
    http://www.w3.org/2001/XMLSchema">
    <xs:element name="abcd">
    <tagA>hjfhsldf</tagA>
    <tagB>dummy stuff</tagB>
    </xs:element>
    <xs:sequence>
    <xs:element name="dd">
    <tagA>words</tagA>
    <tagB>dummy stuff too</tagB>
    </xs:element>
    </xs:sequence>
    </data>;
    var xs:Namespace = xml.namespaceDeclarations()[0];
    var nodelist:XMLList = xml..xs::element.(@name=="dd");
    trace(nodelist)
    If you need generic code that accounts for no namespaces, you
    can use
    something like this:
    var xs:Namespace = xml.namespaceDeclarations()[0];
    var nodelist:XMLList =
    (xs == null || xs == undefined)
    ? xml..element.(@name=="dd");
    : xml..xs::element.(@name=="dd");
    trace(nodelist)

  • IXML - Checking if a specific node exists in XML data

    Hi,
    I´m reading XML data by using iXML classes. One XML file I´m reading contains header and
    item data.
    Right now I´m starting with reading the header attributes and then read all nested nodes and their attribute data. That works all fine, but now I had the error, that the XML file wrongly didn´t contain the items.
    My XML reading method then ended up in a dump because the node was null:
    l_node = l_iterator->get_next( ).
    Can anybody give me an advice, how to check at the beginning of reading my xml data, if a specific node (in my case the node for items) exists in the XML data? If not, I want to stop with an error message. I want to check that at the beginning, before reading all element data, to keep my method structured.
    Thank you very much!

    Hi,
    You can create a filter and set that filter to the iterator. If this is done the iterator returns you only the node with a specific node name or node ID.
    You can also check the parsing in the following WIKI code gallery
    https://wiki.sdn.sap.com/wiki/x/JoDmAQ
    Subroutines create_set_filter_attribute and parse_xml_file would be helpful.

  • JBoss cluster - call to a specific node

    Hi!
    is it possible to send a remotecall only to a specific node in the cluster?
    Simple example:
    I have three nodes in my cluster (A, B, C) and i want to send a call only to an object on node C. Node A and B shouldn't be involved in this call.
    Best Regards
    Hendrik

    Hi,
    Assuming "doc" is an XMLType variable containing your XML document, you can do :
    SELECT insertchildxml(doc, 'ROWSET', '@IS_SUCCESS', '1') INTO doc FROM dual;Slightly off-topic, but to add attributes to ROW elements, DBMS_XMLGEN can handle it for us provided we prefix column aliases with "@".
    For example :
    SQL> SELECT dbms_xmlgen.getXML('SELECT ''Hello!'' as "@msg" FROM dual') FROM dual;
    DBMS_XMLGEN.GETXML('SELECT''HE
    <?xml version="1.0"?>
    <ROWSET>
    <ROW msg = "Hello!">
    </ROW>
    </ROWSET>
    Edited by: odie_63 on 2 nov. 2010 12:50 - added remark on ROW attributes

  • Xsl for removing specific nodes and modifying one node.

    Hello,
    i have the urgent need to remove specific nodes
    and modify one node in my XML.
    the xml as input :
    <?xml version="1.0" encoding="utf-8"?>
    <PLOT>
      <REQUEST>
        <GET_LAYOUT>
          <PROPERTIES>
            <MAPNAME name="xxxx" />
           </PROPERTIES>
          <DATAFRAME id="MAIN">
            <LAYERLIST>
              <LAYERDEF id="0" visible="false" query="" />
              <LAYERDEF id="1" visible="false" query="" />
              <LAYERDEF id="2" visible="false" query="" />
              <LAYERDEF id="3" visible="false" query="" />
              <LAYERDEF id="4" visible="false" query="" />
              <LAYERDEF id="5" visible="false" query="" />
              <LAYERDEF id="6" visible="false" query="" />
              <LAYERDEF id="7" visible="false" query="" />
              <LAYERDEF id="8" visible="false" query="" />
              <LAYERDEF id="9" visible="false" query="" />
              <LAYERDEF id="10" visible="false" query="" />     
            </LAYERLIST>
            <MAPSERVICELIST>   
              <MAPSERVICEDEF  service="BASEMAP" >
                <LAYERLIST>
                  <LAYERDEF id="2" visible="True" query="" />
                  <LAYERDEF id="1" visible="False" query="" />
                </LAYERLIST>
              </MAPSERVICEDEF>
              <MAPSERVICEDEF service="MAP1">
                <LAYERLIST>
                  <LAYERDEF id="4" visible="True" query="" />
                  <LAYERDEF id="3" visible="True" query="" />
                  <LAYERDEF id="2" visible="True" query="" />
                  <LAYERDEF id="1" visible="False" query="" />
                </LAYERLIST>
              </MAPSERVICEDEF>
            </MAPSERVICELIST>
          </DATAFRAME>
        </GET_LAYOUT>
      </REQUEST>
    </PLOT>
    what i want to have is:
    <?xml version="1.0" encoding="utf-8"?>
    <PLOT>
      <REQUEST>
        <GET_LAYOUT>
          <PROPERTIES>
            <MAPNAME name="xxxx" />
          </PROPERTIES>
          <DATAFRAME id="MAIN">
            <LAYERLIST>
       <LAYERDEF id="6" visible="True" query="" />
                <LAYERDEF id="5" visible="True" query="" />
                <LAYERDEF id="4" visible="True" query="" />
                <LAYERDEF id="3" visible="False" query="" />
    <LAYERDEF id="2" visible="True" query="" />
    <LAYERDEF id="1" visible="False" query="" />       
            </LAYERLIST>
            <MAPSERVICELIST/>   
          </DATAFRAME>
        </GET_LAYOUT>
      </REQUEST>
    </PLOT>
    as you see, <MAPSERVICELIST/>   is empty and <LAYERLIST> contains all <LAYERDEF> of <MAPSERVICEDEF>/<LAYERLIST> 
     The ones  of BASEMAP  are kept unchanged  but the ones of MAP1 are having a new attribute value for id.
    Thanks four your help.
    Regards.

    You can implement very straightforward map in BizTalk like below:
    If you are interested in XSLT of this map, I copied below which visual studio gave me when i validated the map:
    <?xml version="1.0" encoding="UTF-16"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var" version="1.0">
    <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    <xsl:template match="/">
    <xsl:apply-templates select="/PLOT" />
    </xsl:template>
    <xsl:template match="/PLOT">
    <PLOT>
    <REQUEST>
    <GET_LAYOUT>
    <PROPERTIES>
    <MAPNAME>
    <xsl:if test="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/@name">
    <xsl:attribute name="name">
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/@name" />
    </xsl:attribute>
    </xsl:if>
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/MAPNAME/text()" />
    </MAPNAME>
    <xsl:value-of select="REQUEST/GET_LAYOUT/PROPERTIES/text()" />
    </PROPERTIES>
    <DATAFRAME>
    <xsl:if test="REQUEST/GET_LAYOUT/DATAFRAME/@id">
    <xsl:attribute name="id">
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/@id" />
    </xsl:attribute>
    </xsl:if>
    <LAYERLIST>
    <xsl:for-each select="REQUEST/GET_LAYOUT/DATAFRAME/MAPSERVICELIST/MAPSERVICEDEF">
    <xsl:for-each select="LAYERLIST/LAYERDEF">
    <LAYERDEF>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@id">
    <xsl:attribute name="id">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@id" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@id">
    <xsl:attribute name="id">
    <xsl:value-of select="@id" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@visible">
    <xsl:attribute name="visible">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@visible" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@visible">
    <xsl:attribute name="visible">
    <xsl:value-of select="@visible" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="../../../../LAYERLIST/LAYERDEF/@query">
    <xsl:attribute name="query">
    <xsl:value-of select="../../../../LAYERLIST/LAYERDEF/@query" />
    </xsl:attribute>
    </xsl:if>
    <xsl:if test="@query">
    <xsl:attribute name="query">
    <xsl:value-of select="@query" />
    </xsl:attribute>
    </xsl:if>
    </LAYERDEF>
    </xsl:for-each>
    </xsl:for-each>
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/LAYERLIST/text()" />
    </LAYERLIST>
    <MAPSERVICELIST>
    <xsl:text> </xsl:text>
    </MAPSERVICELIST>
    <xsl:value-of select="REQUEST/GET_LAYOUT/DATAFRAME/text()" />
    </DATAFRAME>
    <xsl:value-of select="REQUEST/GET_LAYOUT/text()" />
    </GET_LAYOUT>
    <xsl:value-of select="REQUEST/text()" />
    </REQUEST>
    </PLOT>
    </xsl:template>
    </xsl:stylesheet>
    You can highlight the issue if you have any specific one.
    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    The contents I write here is my personal views, not the view of my employer and anyone else.

  • How to blick tree view few specific nodes

    here i got a code which show how to blink tree view node but i am confuse that how to blink few node.
    Answered by:
    Avatar of Tamer Oz
    20,185
    Points
    Top 0.5
    Tamer Oz
    Partner Joined Sep 2009
    2
    8
    17
    Tamer Oz's threads
    Show activity
    Treeview control - How to make a node blink?
    Visual Studio Languages
    .NET Framework
    >
    Visual C#
    Question
    Alert me
    Question
    Vote as helpful
    0
    Vote
    Hi,
    Is there a "elegant" way to make blink a treeview node?
    I am thinking to use a timer with the collection of nodes that I want to make the blink effect, and update the icon ...
    Friday, November 06, 2009 6:19 PM
    Reply
    |
    Quote
    |
    Report as abuse
    Avatar of Kikeman
    Kikeman
    R. BOSCH
    105 Points
    All replies
    Question
    Vote as helpful
    0
    Vote
    Hi,
    You can develop your custom control for this purpose. The logic you mentioned was correct. Here is a sample control that I developed by the logic you mentioned.
    public class BlinkingTreeView : TreeView
    private Timer t = new Timer();
    private List<TreeNode> blinkingNodes = new List<TreeNode>();
    public BlinkingTreeView()
    t.Interval = 1000;
    t.Tick += new EventHandler(t_Tick);
    bool isNodeBlinked = false;
    void t_Tick(object sender, EventArgs e)
    foreach (TreeNode tn in blinkingNodes)
    if (isNodeBlinked)
    //update Icon
    tn.Text = tn.Text.Substring(0, tn.Text.Length - 1);//to test
    isNodeBlinked = false;
    else
    //update Icon
    tn.Text = tn.Text + "*";//to test
    isNodeBlinked = true;
    public void AddBlinkNode(TreeNode n)
    blinkingNodes.Add(n);
    public void RemoveBlinkNode(TreeNode n)
    blinkingNodes.Remove(n);
    public void ClearBlinkNodes()
    blinkingNodes.Clear();
    public List<TreeNode> BlinkingNodes
    get { return blinkingNodes; }
    public int BlinkInterval
    get { return t.Interval; }
    set { t.Interval = value; }
    public void StartBlinking()
    isNodeBlinked = false;
    t.Enabled = true;
    public void StopBlinking()
    t.Enabled = false;
    just show me how to use BlinkingTreeView class. i will have tree view which will have few node and few nodes may have few child nodes. now how to achieve by this class BlinkingTreeView and show me how to blink few specific node not all. thanks

    better to come with code. first populate tree view with some dummy node this way
    Root
           Child1
                    Child1-sub1
                    Child1-sub2
           Child2
                    Child2-sub1
                    Child2-sub2
    now blink Child1-sub2 & Child2-sub1. please come with code. thanks

  • How to expand a tree at a specific node/item?

    Hi,
    we have a tree and the nodes/items were binded to context with this code
    lo_nd_nvccmp = wd_context->get_child_node( name = wd_this->wdctx_nvccmp ).
    lo_nd_tree = lo_nd_nvccmp->get_child_node( name = wd_this->wdctx_tree ).
    lo_el_tree = lo_nd_tree->bind_structure( new_item = ls_tree set_initial_elements = abap_false ).
    We want that the tree is expanded at a specific node/item?
    The structure has the field is_expanded of type WDY_BOOLEAN. I think that if the field of the right structure is 'X' then the tree should expanded. How can we find the right structure in the context and change this field to 'X'?
    Code is appreciated.
    Thanks, regards
    Susanne

    Oh, apparently if you try that call right after you create
    the Tree, it will throw a null reference exception. That might
    count as a bug in the flex api...
    If you create a Tree, and give it's dataProvider some xml
    data, and then add it to the stage (addChild), and then you call
    expandItem or expandChildrenOf() right after, you will get a null
    object exception. You have to wait... for something. I don't know
    what.
    I even tried calling _tree.invalidateList() before the
    expandItem, but it will still throw the error...
    I wonder what the Tree needs to wait for? Is this a bug for
    Adobe to fix?

  • 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

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

  • 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 do I insert multiple pages in a specific order?

    I create reports in Word and convert them to Adobe before sending them out to customers. I often need to insert additional (Adobe) pages into the report before sending it out; sometimes I need to insert mulitple (20 or 30) pages. Does anyone know how I can insert these pages in a specific order? A few times in the past, Adobe gave me the option to select the order, but lately that option has not come up. HELP!

    Hello Try67,
    I go to Document>Insert Pages then select the files I need to insert. The order in which the pages are inserted is important because they are results of pressure tests (e.g. Sample 1 thru sample 10). I just ran a trial; I tried to select them from top to bottom and bottom to top and it did not seem to make a difference...they went into the document in reverse order. As I mentioned earlier I used to get a pop-up screen that would ask what order I wanted the inserted pages in...I don't get that pop-up anymore.

  • How to make visible value attributes of a Search Node

    Hi All,
    We have a requirement to enhance the search context node SEARCH ( Dynamic Query Object SVYQ ) of component SVY_S.
    But the enhancement category of Attribute Structure CRMST_QUERY_SVYIL is 'Can't be enhanced'.
    So we are adding value attributes to this context node. How to make this value attributes available in view configuration tab?
    Please suggest a better approach if there is any.
    Thanks in adv.

    Hi  Suchindra,
       You assign these  enhanced  attributes to design layer. so you can see these fields in Config tab.
    How to do:
    IMG->Customer Relationship Management -> UI Framework -> UI Framework definition -> Maintain
    design layer
    Here include the enhanced attributes and then go to component work bench and in context attributes right click assign the desing layer, selct your attribute and  in the bottom click on SAVE button.
    Then check it in configuration tab your attributes will available in show available fields.
    I hope this will solve your problem
    Regards,
    Sagar

  • Access to an attribute of a value node of a component controller

    Hello experts,
    I'm new to the area of SAP CRM Web Client UI development. My problem is probably very simple and you will surely smile about it.
    I have created my own component with the value node FILE (that consists of five atributes) in the component controller. Unfortunately I have not figured out yet how I can access the value of an attribute.
    The first thing I do not know is where I can find the controller-ID.
    In addition, I get an syntax error Field "TYPED_CONTEXT->FILE->COLLECTION_WRAPPER->GET_FIRST(" unknown in the line with "lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).".
    Currently no functionality is included in my code, because firstly I want to understand the basics.
    method OP_FILEUPLOAD.
      data lo_entity       type ref to if_bol_bo_property_access.
      data lv_file_name    type string.
      data lr_file_content type ref to data.
      field-symbols <lv_file_name> type string.
      IF ( comp_controller is INITIAL ).
        get_controller( 'xxxx' ).
      ENDIF.
      lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).
      while lo_entity is bound.
        lv_file_name = lo_entity->get_property_as_string( 'FILE_NAME' ).
        lr_file_content = lo_entity->get_property( 'FILE_CONTENT_STRING' ).
        assign lr_file_content->* to <lv_file_content>.
        lo_entity = me->typed_context->file->collection_wrapper->get_next( ).
      endwhile.
    endmethod.
    I hope that I will manage my "problem" with your help!
    Sebastian
    Edited by: Sebastian Lenz on Jun 27, 2011 2:35 PM

    Hi Sebastian,
    The issue is in the following line of your code:
    lo_entity = me->comp_controller->typed_context->file->collection_wrapper->get_first( ).
    The 'typed_context' belongs to your own component controller class and not the standard framework superclass. So, you need to replace this single line of code with something as follows (assuming that your component controller class is ZCL_CUSTOM_BSPWDCOMPONENT_IMPL):
    DATA lr_coco TYPE REF TO ZCL_CUSTOM_BSPWDCOMPONENT_IMPL.
    lr_coco ?= me->comp_controller.
    lo_entity = lr_coco->typed_context->file->collection_wrapper->get_first( ).
    The me->comp_controller reference will refer to the standard framework superclass of all component controllers and this does not have any typed_context attribute with it. The real component controller that gets created when you create a BSP component will have this attribute. That is why you need to first cast it to your own reference type before trying to access its typed_context.
    And if your value node will have only single values, then you can as well do the following to access the attribute ATTRIB1 of context node node1:
    DATA lv_value TYPE string.
    lv_value = lr_coco->typed_context->node1->get_attrib1( attribute path = '' ).
    Basically all attributes can be accessed by above code by using the right getter method.
    Regards,
    Shiromani

  • Using XSLT to empty nodes with the exception of  specific node.

    I have XSLT code working which will remove all the empty elements. My user wishes to exempt a specific node, <BypassDateEdits>. I can not figure out the correct syntax to do this.
    Source XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <IMDSCDB xmlns="http://xml.dod.mil/log/maint/fs/main/4.0.0">
    <EndItemTCTOReporting originator="EMOC">
    <PartialJobDataDocumentationData/>
    <JobControlNumber>
    <EventId>052790038</EventId>
    <WorkcenterEvent>001</WorkcenterEvent>
    </JobControlNumber>
    <End/>
    <HomeEnterpriseLocationCode>7494</HomeEnterpriseLocationCode>
    <CurrentEnterpriseLocationCode>7494</CurrentEnterpriseLocationCode>
    <HostUnitDateAndTime>2006-02-23T19:29:37</HostUnitDateAndTime>
    <TransactionOrdinalDate>06054</TransactionOrdinalDate>
    <ComponentPosition>0</ComponentPosition>
    <HowMalfunctionCode>802</HowMalfunctionCode>
    <UnitsProduced>01</UnitsProduced>
    <StartTime>0800</StartTime>
    <StopDate>05200</StopDate>
    <StopTime>0805</StopTime>
    <CrewSize>6</CrewSize>
    <CategoryOfLaborCode>1</CategoryOfLaborCode>
    <ActivityIdentifierCode>02</ActivityIdentifierCode>
    <CorrectedByIMDSCDBUserId>GU03CW</CorrectedByIMDSCDBUserId>
    <CorrectiveActionNarrative>Test Test</CorrectiveActionNarrative>
    <InspectedByIMDSCDBUserId>GU03CW</InspectedByIMDSCDBUserId>
    <DocumentMoreTCTOThisJobControlNumber/>
    <InspectionPassed>Y</InspectionPassed>
    <BypassDateEdits/>
    </EndItemTCTOReporting>
    </IMDSCDB>
    Desired output is:
    <?xml version="1.0" encoding="UTF-8"?>
    <IMDSCDB xmlns="http://xml.dod.mil/log/maint/fs/main/4.0.0">
    <EndItemTCTOReporting originator="EMOC">
    <PartialJobDataDocumentationData/>
    <JobControlNumber>
    <EventId>052790038</EventId>
    <WorkcenterEvent>001</WorkcenterEvent>
    </JobControlNumber>
    <HomeEnterpriseLocationCode>7494</HomeEnterpriseLocationCode>
    <CurrentEnterpriseLocationCode>7494</CurrentEnterpriseLocationCode>
    <HostUnitDateAndTime>2006-02-23T19:29:37</HostUnitDateAndTime>
    <TransactionOrdinalDate>06054</TransactionOrdinalDate>
    <ComponentPosition>0</ComponentPosition>
    <HowMalfunctionCode>802</HowMalfunctionCode>
    <UnitsProduced>01</UnitsProduced>
    <StartTime>0800</StartTime>
    <StopDate>05200</StopDate>
    <StopTime>0805</StopTime>
    <CrewSize>6</CrewSize>
    <CategoryOfLaborCode>1</CategoryOfLaborCode>
    <ActivityIdentifierCode>02</ActivityIdentifierCode>
    <CorrectedByIMDSCDBUserId>GU03CW</CorrectedByIMDSCDBUserId>
    <CorrectiveActionNarrative>Test Test</CorrectiveActionNarrative>
    <InspectedByIMDSCDBUserId>GU03CW</InspectedByIMDSCDBUserId>
    <InspectionPassed>Y</InspectionPassed>
    <BypassDateEdits/>
    </EndItemTCTOReporting>
    </IMDSCDB>
    XSLT to remove all empty nodes is:
    <?xml version="1.0"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match="@* | node()">
    <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="*[not(descendant::text()[normalize-space()])]" >
    </xsl:template>
    </xsl:stylesheet>
    I believe I need to use the | operator to select the additional node set of just the <BypassDateEdits> node, but repeated attempt and research on the web has enabled me to find a solution.
    Any assistance would be appreciated.
    Bill

    having gotten a big clue from tsuji, I finally achieved the correct XSLT.
    This XSLT:
    <?xml version="1.0"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match="@* | node()">
    <xsl:copy>
    <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
    </xsl:template>
    <xsl:template match="*[not(local-name()='BypassDateEdits') and namespace-uri()='http://xml.dod.mil/log/maint/fs/main/4.0.0'][not(descendant::text()[normalize-space()])]" >
    </xsl:template>
    </xsl:stylesheet>
    Yields the desired results:
    <?xml version="1.0" encoding="UTF-8"?><IMDSCDB xmlns="http://xml.dod.mil/log/maint/fs/main/4.0.0">
    <EndItemTCTOReporting originator="EMOC">
    <JobControlNumber>
    <EventId>052790038</EventId>
    <WorkcenterEvent>001</WorkcenterEvent>
    </JobControlNumber>
    <HomeEnterpriseLocationCode>7494</HomeEnterpriseLocationCode>
    <CurrentEnterpriseLocationCode>7494</CurrentEnterpriseLocationCode>
    <HostUnitDateAndTime>2006-02-23T19:29:37</HostUnitDateAndTime>
    <TransactionOrdinalDate>06054</TransactionOrdinalDate>
    <ComponentPosition>0</ComponentPosition>
    <HowMalfunctionCode>802</HowMalfunctionCode>
    <UnitsProduced>01</UnitsProduced>
    <StartTime>0800</StartTime>
    <StopDate>05200</StopDate>
    <StopTime>0805</StopTime>
    <CrewSize>6</CrewSize>
    <CategoryOfLaborCode>1</CategoryOfLaborCode>
    <ActivityIdentifierCode>02</ActivityIdentifierCode>
    <CorrectedByIMDSCDBUserId>GU03CW</CorrectedByIMDSCDBUserId>
    <CorrectiveActionNarrative>Test Test</CorrectiveActionNarrative>
    <InspectedByIMDSCDBUserId>GU03CW</InspectedByIMDSCDBUserId>
    <InspectionPassed>Y</InspectionPassed>
    <BypassDateEdits/>
    </EndItemTCTOReporting>
    </IMDSCDB>
    Thank you tsuji,
    Bill

Maybe you are looking for

  • Domain controller 2008 Server with SP2

    Here is a real issue which i cannot track down what is causing it. It appears that in windows 2008 Server running DHCP, DNS and AD i am getting some weird errors on the clients. The client machines are all Windows 7 Professional x64. The Issue is tha

  • Battery life good or bad, confused

    is this good battery life or not? .... my friends tell me its bad ive been using my phone for 2 hours and 24 min and its at 64% with 4 hours and 7 min of standby is this good or bad or is it normal usage?

  • Is Location services available in the Philippines?

    Hi guys... ive been trying to use my Map app in my iPod touch 4th gen but it keeps saying "Cannot Determine Location" but all the Location Services are turned on and my wifi signal is excellent.   Is there a restriction of this service in the Philipp

  • A problem about incorrect return value

    Hi,expert:    we have a scenario ECC(Proxy)->PI->P6(soap),  request and response message use the xslt mapping.    The response message contains chinese characters,but when the message come to PI,the chinese charater is garble.    The xml encoding is

  • Sharing the Metadata Repository (SAP Java Connector)

    Is it possible to share the metadata repository across multiple client processes in the context of the SAP Java Connector?  If so, can someone point me to the technique that I have to implement? Each client process creates its own JCO.Pool (with a un