How to remove target node if source field value is empty SAP PI Mapping

Hello,
how to remove target node if source field value is empty in graphical Mapping.
Like if
MIddle name in source filed is empty, I would like to eliminate target field from out put XML.
Thank you
John

Hi Jhon,
If you want to remove all empty tags and you dont to complicate your message mapping, you can use a XSL, after the message mapping,  to remove all the empty tags:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="*[not(@*|*|comment()|processing-instruction())
     and normalize-space()='' ]"/>
</xsl:stylesheet>
Regards

Similar Messages

  • How to remove a node from nlb at runtime?

    hello,
    i need to temporally exclude a node from an nlb.
    May happen that a server is up and working but the web application i'm balancing is out of sinch with the same application in the others nodes.
    Eg. some static variables are not the same of the same static variables of other nodes, because of a timeout, a write error and so on but the server is still working.
    in this case i need to stop the server from nlb because the information in the web application is not in sinch with other nodes.
    I need to prevent users from being serverd from this out to date server, untill it will became updated, but i need to do this programmatically
    how can i do it?

    "DuoMi" <[email protected]> wrote in message
    news:gnojbf$2sg$[email protected]..
    > How to remove a node from XMLList
    >
    > I want remove the first node from XMLList
    >
    >
    > and how to get the combobox all values string:
    >
    > <data>
    > <value>2</value>
    > </date>
    > <data>
    > <value>5</value>
    > </date>
    > <data>
    > <value>8</value>
    > </date>
    >
    > I need a string whit value "2,5,8"
    >
    > thkan you.~
    I think something like
    comboBox.dataProvider..value.toString()
    will work.

  • How to remove a node from 4 node sun cluster 3.1

    Dear All,
    We are having a four nodes in a cluster.
    Could any one please guide me, how to remove a single node from a 4 node cluster.
    what are the procedure and step's I have to follow.
    Thanks in advance.
    Veera.

    Google is pretty good at finding the right pages in our docs quickly. I tried >how to remove a node Solaris Cluster< and it came up with
    http://docs.sun.com/app/docs/doc/819-2971/gcfso?a=view
    Tim
    ---

  • How to remove a node from XMLList

    How to remove a node from XMLList
    I want remove the first node from XMLList
    and how to get the combobox all values string:
    <data>
    <value>2</value>
    </date>
    <data>
    <value>5</value>
    </date>
    <data>
    <value>8</value>
    </date>
    I need a string whit value "2,5,8"
    thkan you.~

    "DuoMi" <[email protected]> wrote in message
    news:gnojbf$2sg$[email protected]..
    > How to remove a node from XMLList
    >
    > I want remove the first node from XMLList
    >
    >
    > and how to get the combobox all values string:
    >
    > <data>
    > <value>2</value>
    > </date>
    > <data>
    > <value>5</value>
    > </date>
    > <data>
    > <value>8</value>
    > </date>
    >
    > I need a string whit value "2,5,8"
    >
    > thkan you.~
    I think something like
    comboBox.dataProvider..value.toString()
    will work.

  • How  to remove the check from ShpmntCostsRel. (field VTTK-    FRKRL)

    Hi Experts,
    Can you please tell me to how  to remove the check from ShpmntCostsRel. (field VTTK-    FRKRL) when saving of the shipment document.

    shipment cost calculation only on the Leg level and not on header level. Currently a lot of confusion happened after creating the shipment cost document and found that the status is u201CBu201D.
    now we intend to define detailed specifications to how to create this new user exit to update the shipment cost relevancy at shipment header.
    The main functionality of the user exit  to be created is to remove the check from ShpmntCostsRel. (field VTTK-    FRKRL).can u pls tell how to do this.

  • How to remove all nodes (except root node)from a Jtree?

    How to remove all nodes (except the root node)from a Jtree?

    Either:
    - remove all children of root.
    - save the root node, throws away the tree model, build a new TreeModel with the saved root, set the new TreeModel in the JTree.
    - implement your own TreeModel, which would support an emptyExceptRoot() method.
    IMHO, using the DefautlTreeModel and DefaultMutableTreeNode does lead to all sorts of small problems when the app evolves, and implementing your own TreeNode and TreeModel is not that hard and much more efficient.

  • How to Add/Concatenate to a text field, values selected in a combo box

    I have a combo box form field that allows the user to select a value from a list and click on an Add button. The Add button should add/concatenate the vaue selected to a text field in order to create a list of values selected. I'm not sure how to do this using Javascript in Acrobat? I know I need to add the javascript to the Add button's Mouse Up action. Any help would be greatly appreciated. Thanks!

    Thanks so much - it works!
    >>> "Gilad D (try67)" <[email protected]> 9/25/2013 9:16 AM >>>
    Re: How to Add/Concatenate to a text field, values selected in a combo box created by Gilad D (try67) ( http://forums.adobe.com/people/try67 ) in JavaScript - View the full discussion ( http://forums.adobe.com/message/5712118#5712118 )
    Let's say the text field's name is "Text1", and the combo is called "Combo1". You can then use this code as the MouseUp script of the Add button:
    var f1 = this.getField("Text1");
    var f2 = this.getField("Combo1");
    if (f1.value=="") f1.value = f2.value;
    else f1.value = f1.value + ", " + f2.value;
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5712118#5712118
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5712118#5712118
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5712118#5712118. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in JavaScript by email ( mailto:[email protected].com ) or at Adobe Community ( http://forums.adobe.com/choose-container!input.jspa?contentType=1&containerType=14&contain er=3286 )
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How to remove a node from a target xml payload in reciever file channel

    i have a scenario where i have to remove a node from my target xml file in receiver file channel and want xml as the output file. I don't want a fixed length file. How to do that in receiver channel? Do we need to use file content conversion for that?

    that will result in giving you a fixed file or a separator defined file.
    it will not give you an XML file.
    In case you want a XML file, instead of using variable substitution, use Dynamic configuration and adapter specific properties.
    Some ref:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

  • How to remove a node from a xml

    Hi All,
    I want to remove a node from my xml output. Can anyone suggest me how to get that? I want to implement this by using the ASSIGN activity.
    My sample output is
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
         <env:Header>
              <wsa:MessageID>urn:4EF1A350677C11E1BFA7794ED76B03EF</wsa:MessageID>
              <wsa:ReplyTo>
                   <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
              </wsa:ReplyTo>
         </env:Header>
         <env:Body>
              <SiebelOrderQueryByExample_Output xmlns="http://siebel.com/asi/">
                   <ListOfOrderInterface xmlns="http://www.siebel.com/xml/Siebel%20Order">
                        <Orders>
                             <Id>1-15IXJ</Id>
                             <AccountId>1-2EE</AccountId>
                             <OrderNumber>1012-1234</OrderNumber>
                             <ListOfLineItems>
                                  <LineItems>
                                       <Id>1-15IYN</Id>
                                       <LineNumber>303</LineNumber>
                                       <OrderNumber>1012-1234</OrderNumber>
                                       <OrderHeaderId>1-15IXJ</OrderHeaderId>
                             </LineItems>
                                  </ListOfLineItems>
                             </Orders>
    </ListOfOrderInterface>
              </SiebelOrderQueryByExample_Output>
         </env:Body>
    </env:Envelope>
    I want to delete the <ListOfLineItems>node from the xml above so that my resultant would be,
         <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
         <env:Header>
              <wsa:MessageID>urn:4EF1A350677C11E1BFA7794ED76B03EF</wsa:MessageID>
              <wsa:ReplyTo>
                   <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
              </wsa:ReplyTo>
         </env:Header>
         <env:Body>
              <SiebelOrderQueryByExample_Output xmlns="http://siebel.com/asi/">
                   <ListOfOrderInterface xmlns="http://www.siebel.com/xml/Siebel%20Order">
                        <Orders>
                             <Id>1-15IXJ</Id>
                             <AccountId>1-2EE</AccountId>
                             <OrderNumber>1012-1234</OrderNumber>
         </Orders>
    </ListOfOrderInterface>
              </SiebelOrderQueryByExample_Output>
         </env:Body>
    </env:Envelope>     
    Please suggest something Its urgent.
    Thanks in Advance.

    It goes something like this, taken from the above blog entry:
    Removing a node from node-list
    With the bpelx: extensions in BPEL you are able to insert and update nodes in a node list. A node-list is an XML message that contains a set of records. In this article I use the following example:
    <BookList xmlns="http://message.vijfhuizen.com">
    <Book>
    <title>The Lord Of The Rings</title>
    <author>J.R.R. Tolkien</author>
    </Book>
    <Book>
    <title>Harry Potter</title>
    <author>J.R.R. Tolkien</author>
    </Book>
    <Book>
    <title>The Hobbit</title>
    <author>J.R.R. Tolkien</author>
    </Book>
    <Book>
    <title>Storm; Chronicals of Pandarve</title>
    <author>Don Lawrence</author>
    </Book>
    </BookList>
    For creating and updating node lists the bpelx: functions are enough to handle this. But when you want to remove a particular node, you can use the bpelx:remove function. But this function can only remove a node from a particular position. For example removing the second node you code:
    <bpel:assign>
    <bpelx:remove>
    <bpelx:target variable="VarBookList" query="/Booklist/Book[2]" />
    </bpelx:append>
    </bpel:assign>
    It is hard to code the bpelx:remove to create a xpath to dynamicly remove node. You would like to remove the second node based on the xpath:
    /Booklist/Book[title="Harry Potter" and author="J.R.R. Tolkien"]
    You can add the above xpath in the bpelx:remove, but you are not able to make this dynamically.
    There is a solution. The trick is to create a stylesheet that copies the data into a new message, but removing that particular records. Create a stylesheet that does the normal copy of the XML message. Then add a <choose> element in the stylsheet to filter that particular record.
    <xsl:template match="/">
    <BookList>
    <xsl:for-each select="/BookList/Book">
    <xsl:choose>
    <xsl:when test="title='Harry Potter' and author='J.R.R. Tolkien'"/>
    <xsl:otherwise>
    <Book>
    <title>
    <xsl:value-of select="title"/>
    </title>
    <author>
    <xsl:value-of select="author"/>
    </author>
    </Book>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:for-each>
    </BookList>
    Now we have a XSL stylesheet that removes a particular record, but this is not variable. This can be done via XSLT parameters.
    <xsl:param name="pTitle"/>
    <xsl:param name="pAuthor"/>
    <xsl:template match="/">
    <BookList>
    <xsl:for-each select="/BookList/Book">
    <xsl:choose>
    <xsl:when test="title=$pTitle and author=$pAuthor"/>
    <xsl:otherwise>
    <Book>
    <title>
    <xsl:value-of select="title"/>
    </title>
    <author>
    <xsl:value-of select="author"/>
    </author>
    </Book>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:for-each>
    </BookList>
    </xsl:template>
    Now we are able to use this stylesheet in BPEL. In general BPEL create the following code:
    <assign name="Transform">
    <bpelx:annotation>
    <bpelx:pattern>transformation</bpelx:pattern>
    </bpelx:annotation>
    <copy>
    <from expression="ora:processXSLT('RemoveNode.xsl'
    , bpws:getVariableData('Variable_BookList','payload')" />
    <to variable="Variable_BookListTemp" part="payload"/>
    </copy>
    </assign>
    But this code does not pass parameters to the stylesheet. The ora:processXSLT() can do this it has an additional parameter in this function:
    <assign name="Transform">
    <bpelx:annotation>
    <bpelx:pattern>transformation</bpelx:pattern>
    </bpelx:annotation>
    <copy>
    <from expression="ora:processXSLT('RemoveNode.xsl'
    , bpws:getVariableData('Variable_BookList','payload')" />
    , bpws:getVariableData('BPELxslparameters'))"/>
    <to variable="Variable_BookListTemp" part="payload"/>
    </copy>
    </assign>
    Now only you have to create the BPELxslparameters variable and assign it with the correct name/value pairs. The structure of the this variable is as follows:
    <?xml version="1.0" encoding="windows-1252" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.oracle.com/service/bpel/common"
    targetNamespace="http://schemas.oracle.com/service/bpel/common"
    elementFormDefault="qualified">
    <xsd:element name="parameters">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="item" minOccurs="1" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="name" type="xsd:string"/>
    <xsd:element name="value" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    Create in BPEL the variable BPELxslparameters and let it point to this strucure:
    <process ....
    xmlns:common="http://schemas.oracle.com/service/bpel/common"
    .../>
    <variable name="BPELparameters" element="common:parameters"/>
    Now we can in BPEL create an empty XML message, based on this strcuture and assign the values to these parameters and then call the processXSLT function.
    <bpelx:assign name="Assign_GenerateEmptyParameterSet">
    <copy>
    <from>
    <parameters xmlns="http://schemas.oracle.com/service/bpel/common">
    <item>
    <name>pTitle</name>
    <value/>
    </item>
    <item>
    <name>pAutor</name>
    <value/>
    </item>
    </parameters>
    </from>
    <to variable="BPELparameters" query="/common:parameters"/>
    </copy>
    </bpelx:assign>
    <assign name="Assign_setXSLTParameters">
    <copy>
    <from expression="'Harry Potter'"/>
    <to variable="BPELparameters" query="/common:parameters/common:item[1]/common:value"/>
    </copy>
    <copy>
    <from expression="'J.R.R. Tolkien'"/>
    <to variable="BPELparameters" query="/common:parameters/common:item[1]/common:value"/>
    </copy>
    </assign>
    Posted by Marc Kelderman SOA Blog at 1/16/2008 09:20:00 PM

  • How to remove a node apps listener from CRS.

    We have a node apps in type of listener offline shown from crs_stat -t:
    ldctrdb01|PDAMLDV11|/u01/crs/product/10.2.0/bin $ crs_stat -t
    Name Type Target State Host
    ora....11.inst application ONLINE ONLINE ldctrdb01
    ora....12.inst application ONLINE ONLINE ldctrdb02
    ora....LDV1.db application ONLINE ONLINE ldctrdb02
    ora....SM1.asm application ONLINE ONLINE ldctrdb01
    ora....01.lsnr application ONLINE OFFLINE
    ora....01.lsnr application ONLINE ONLINE ldctrdb01
    ora....b01.gsd application ONLINE ONLINE ldctrdb01
    ora....b01.ons application ONLINE ONLINE ldctrdb01
    ora....b01.vip application ONLINE ONLINE ldctrdb01
    ora....SM2.asm application ONLINE ONLINE ldctrdb02
    ora....02.lsnr application ONLINE OFFLINE
    ora....02.lsnr application ONLINE ONLINE ldctrdb02
    ora....b02.gsd application ONLINE ONLINE ldctrdb02
    ora....b02.ons application ONLINE ONLINE ldctrdb02
    ora....b02.vip application ONLINE ONLINE ldctrdb02
    I want to delete it from the list by using netca. But this listener would not be able to show from netca. The netca can only show the other listener that is currently used and also shown in the crs_stat. How to remove the offline listener from crs_stat list?
    Thanks for advice!

    I run the netca from both $ORACLE_HOME and $ASM_HOME earlier. But now, none of the home can detect the listener to be deleted. However, if I try to add a listener with that name, the netca replied with " the listener already exist...".
    We have a symbolic link from $ORACLE_HOME/network/admin to $ASM_HOME/network/admin ($TNS_ADMIN) for the files tnsnames.ora and listener.ora.

  • Set target fileds from source fields using JDBC lookUp

    hello :
    advance thanks for reading below and i am new to java
    how to  to set the two taget fileds T1 and T2 from source field S1 using jdbc look up .Here is the code and its giving syntax error . set T1 to approver1 and T2 to approver2
    I copied the code from blog 2219 
    How to map to two target fileds ??
    Is something wrong with the query ?
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    >>>>>>>>I defined Argument a(i am passing S1)  Result result
    >>>Here is the code :
      //write your code here
    String Query = " ";
    Channel channel = null;
    DataBaseAccessor accessor = null;
    DataBaseResult resultSet = null;
    // Build the Query String
    Query = "Select (approver1,approver2)  from  Emp where loginid = ' " + a[0] + " ' '';
    try{
    //Determine a channel, as created in the Configuration
    channel = LookupService.getChannel("SQL99","jdbc_cc1");
    //Get a system accessor for the channel. As the call is being made to an DB, an //DatabaseAccessor is obtained.
    accessor = LookupService.getDataBaseAccessor(channel);
    //Execute Query and get the values in resultset
    resultSet = accessor.execute(Query);
    for(Iterator rows = resultSet.getRows();rows.hasNext();){
    Map rowMap = (Map)rows.next();
    result.addValue((String)rowMap.get("(approver1"));
    //result.addValue((String)rowMap.get("approver2"));
    catch(Exception ex){
    result.addValue(ex.getMessage())
    finally{
    try{
    if (accessor!=null) accessor.close();
    catch(Exception e){
    result.addValue(e.getMessage())
    thankyou sdn:

    hi kumar,
    every statment in java should end with a semicolon... and 2 catch statments in the code given in blog(that you mentioned) are with missing semicolons at the end of the statments... just include semicolons at the end of these 2 catch staments and your code should work properly without any syntax error...
    catch(Exception ex){
    result.addValue(ex.getMessage());
    finally{
    try{
    if (accessor!=null) accessor.close();
    catch(Exception e){
    result.addValue(e.getMessage());
    Regards,
    JP

  • How to remove the automatically generated text fields from the InfoSet

    I followed the procedure by SAP help.
    Automatically generated text fields are marked with a 'T' on the icon in the InfoSet. You can remove the automatically generated text fields from the InfoSet in the initial screen of the InfoSet maintenance under Further Functions -> Delete Text Fields. Cancel the DataSource creation on the next screen and delete the text fields in the InfoSet maintenance transaction.
    I know that there is an option "No automatic text recognition" when I create a new InfoSet, however, I couldn't find out how to change an existed InfoSet. I checked menu Goto->Global Properties, but that option is disabled. Is there a way to remove text fields from an existed InfoSet?

    Hi,
    In the initial screen (when you enter transaction code SQ02) type your infoset name and goto menu: Infoset -> More functions -> Delete text fields. this will delete all text fields.
    I hope this helps to resolve the issue.
    Ram

  • How to reduce the pdf version & how to remove all the pre-delivered field from a pdf file.

    Hi Team,
    1) Please help me to reduce the version of a pdf file which is v1.7 as my BI Publisher support only pdf version  upto Version1.5.
    2)This pdf file 1.7 contains some pre-delivered fields, i want to remove all the pre-delivered fields. Please suggest.
    PFA link:-
    http://www.uscis.gov/files/form/i-539.pdf
    Please guide to remove the pre-delivered fields from this pdf & how to reduce the version.

    A lot depends on what you want to do with the file. The encryption has limited most options on the form. If you are wanting to simply post a view of the form, then you might try a screen capture. Of course there is always the question of what you want to do with the form and any legal aspects related to that use. Other than answering potential legal questions of your use, we might be able to help more if we were aware of the desired use. At the moment, the screen capture is my only suggestion. There may be other work arounds, but probably not appropriate for discussion on this forum.
    If you are wanting the form for publication as an example in some document, I would strongly suggest you contact the gov't agency and discuss your intent and try to get a version you can use with their approval. Overall, that is the cleanest way to do whatever you are after for a legit purpose. Even a graphic version should have the permission of the government agency.

  • How to Remove a Node from JTree?

    I want to remove a node from a JTree but the node may or maynot be visible.
    My method takes a String which is the name of the node.
    The nodes im using are DefaultMutableTreeNode
    This is my code so far but it doesnt work.
    public void removePerson(String pName)
              TreePath node = tree.getNextMatch(pName,0,Position.Bias.Forward);
              tree.expandPath(node);
              tree.removeSelectionPath(node);
    }Any Suggestions or ways which i could achive this?
    Thank you,

    I don't think removeSelectionPath is what you want to use.
    These should help:
    [http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/tree/DefaultTreeModel.html#removeNodeFromParent(javax.swing.tree.MutableTreeNode)|http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/tree/DefaultTreeModel.html#removeNodeFromParent(javax.swing.tree.MutableTreeNode)]
    [http://www.roseindia.net/java/example/java/swing/RemoveNodes.shtml|http://www.roseindia.net/java/example/java/swing/RemoveNodes.shtml]

  • How to create xml nodes based on a value

    Dear friends,
    I've a question about graphical mapping in SAP PI...
    How can I create XML nodes on the target side based on a value in a XML field on the source side.
    For example:
    This XML field on the source:
    <NO_OF_LINES>4</NO_OF_LINES>
    Must result on 4 Lines on the Target:
    <LINE></LINES>
    <LINE></LINES>
    <LINE></LINES>
    <LINE></LINES>
    So it's actually the opposite of the Count function...
    I appreciate your help,
    Thank you in Advance,
    Kind regards,
    John

    Hi ,
    Try this
    NO_OF_LINES---> count---> UDF---> LINE
    example :
    UDF Code :
    for (int i=0;i<var1[0];i++)
    result.addValue("");

Maybe you are looking for

  • How do I find the owner of a folder/file and change it.

    Photoshop will not install license correctly and Adobe is not being much help. The problem seems to be that the Library/preferences/FLEXnet Publisher folder is locked and the Photoshop installer can not write to it. The get info box for the folder sa

  • RESULT RECORDING PROBLEM

    Dear Gurus, I am facing problem I have maintained formula for paricular MIC,e.g Zn-for this MIC i have to calculate the percantage as 100 minus balance of the remaining MICs eg i  have maintained in this form--1 100-(C9010C9020C9030C9040C9050C9060C90

  • *** es:preparedStatement TAG replacement in 3.5 ***????

    hi there. does anybody know what is the replacement for the tag <es:preparedStatement> in WLCS 3.5? nobody seems to be facing this problem. any help is appreciated. thanks, nadeem

  • Generate csv file

    How can I generate CSV file from a select query without having any loop .Is there any in build function which can directly generates trhe csv ? I am using oracle 10g .

  • Zen Agent 11.3 upgrade issue

    Hi All, So I just successfully migrated my entire company that I work for from a single ZCM11.2 Primary, to 2 ZCM11.3 Virtual Appliances and a remote sybase database server. Was fun, but now im trying to update all of our existing machines Zenworks A