Accessing Element's name in Message mapping

Hi,
   I need to Access the Element's name in Message mapping (Using graphical tool or in user defined function).
For Example:
Element: <Company_Name>XYZ Co </Company_Name>
I need to access the Element's name(i.e.)<b>"Company_Name"</b>. So that I can map it as
<Element>Company_Name</Element>
<Element_Value>XYZ Co </Element_Value>
in the target message.
Kindly provide your inputs.

Hi Santhosh,
I am not sure if this can be done using your Graphical Mapping, but this is possible using JAVA mapping. Your SAX and DOM parsers for JAVA mapping provides methods like getChildNodes, getElementName using which you can get the name of the element.
Check this link for the methods available for Java Mapping,
http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/parsers/package-summary.html
I think the same can also be done using XSL mapping. Though, I am not sure what method should be used for the same.
Hope this helps,
Regards,
Bhavesh

Similar Messages

  • [RFC to File]Problem about Changing file name in message mapping.

    Hi,
    my problem:
        Type:RFC to File
        I change the file name in message mapping.
    when I call the RFC to send the data twice at the same time, both of the output file names are changed while I only want to change the second output file name.
        thanks
    Sam

    In my MM, the input values to these variables (var1, var2 and var3) are (<ZZCOMBI>array,G499999,END_FIFC0029) ,
    var1 is an array of input <ZZCOMBI> item list;
    var2 is get from a property file by call another UDF;
    var3 is constant value.
    the test input data :
    I send the data for the first time:
    - <rfc:Z_IFCFR821_ZIFCTT82100010 xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    - <T_ZIFCTS82100010>
    - <item>
    <ZZCOMBI>G000002G000002</ZZCOMBI>
    <ZZKYKBN>*</ZZKYKBN>
    <ENAME_VE />
    <ENAME_Z5 />
    </item>
    </T_ZIFCTS82100010>
    </rfc:Z_IFCFR821_ZIFCTT82100010>
    so the input values to these variables (var1, var2 and var3) are (G000002G000002,G499999,END_FIFC0029)
    the output file name(File1) :END_FIFC002920090413-171534-053.dat
    output record: G000002G000002
    because the data what I send is the last record, the system send the dummy data for the second time by program.
    - <rfc:Z_IFCFR821_ZIFCTT82100010 xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    - <T_ZIFCTS82100010>
    - <item>
    <ZZCOMBI>G499999</ZZCOMBI>
    <ZZKYKBN />
    <ENAME_VE />
    <ENAME_Z5 />
    </item>
    </T_ZIFCTS82100010>
    </rfc:Z_IFCFR821_ZIFCTT82100010>
    so the input values to these variables (var1, var2 and var3) are (G499999,G499999,END_FIFC0029)
    the output file name(File2) :END_FIFC002920090413-171533-928.dat
    output record: G499999
    I find that File2(20090413-171533-928) was ouput before File1(20090413-171534-053 ) from the time stamp.
    I am not sure about that "XI will create a message ID for each message and the messages are independent." as you mentioned above.
    Best regards
    Sam
    Edited by: YONGHE ZHOU on Apr 15, 2009 3:59 AM

  • How to find the name of message mapping

    Hi folks
    i want to check the name of message mapping  which is used at run time. i can find the name of Interface mapping name in trace of message in SXMB_MONI.
    but i am not able to find the MM name.
    can some one help me .....
    Regards
    Gagan

    > but i am not able to find the MM name.
    You will find your message mapping name as class name in the pipeline step Request Message Mapping.  Please search for interface mapping and below which you will find the mapping name as this format...
    <Trace level ='"3" type="T"> Mapping steps 1 JAVA_JDK 
    com/sap/xi/tf/_<your mapping name> </Trace>
    Example as similar below...

  • Change Queue name in Message mapping

    Hi
    We want to change the queue name dynamically in the message mapping.
    We refered the post
    Re: EOIO queue name change
    http://help.sap.com/saphelp_nw04/helpdata/en/6e/ff0bf75772457b863ef5d99bc92404/frameset.htm
    But as said in it, we are not able to access the parameter QUEUE_ID or QUALITY_OF_SERVICE.
    Other than these two parameters, we can access all parameters.
    Below is the code to access one of them.
    while compiling, the message mapping gives error as below.
    cannot find symbol
    symbol  : variable QUEUE_ID
    Any pointers.
    ///// CODE
    MappingTrace trace;
    String constant;
    java.util.Map map;
    trace = container.getTrace();
    // get constant map
    map = container.getTransformationParameters();
    constant = (String) map.get(
           StreamTransformationConstants.QUEUE_ID);
    trace.addInfo("QUEUE ID:" + constant);
    return constant;
    Regards
    Anandan

    Hi Anandan,
    As given in help you can only get queue Id if you have Quality of service as ExactlyOnceInOrder. So make sure you have selected that option.
    http://help.sap.com/saphelp_nw04/helpdata/en/6e/ff0bf75772457b863ef5d99bc92404/content.htm
    Regards,
    ---Satish

  • Communication channel name in message mapping ?!

    Hi,
    I have the problem that I have to know the sender channel name in a message mapping.
    The reason is, that I have to set a flag if the message comes via one sender channel.
    Of course a solution would be to use differnt Services but I won't do that. Is there any smart solution?
    Thank you for your help
    Thomas

    There are a few weblogs on gettign the filename. Check whether that would suffice for you.
    If you really need cc name try the following.
    Write a small module function for the adapter.
    (Check this note - 819761)
    See whether you can get the channel name using the object of type Channel (may be getName() or something similar, I'm not sure about this)
    If not,
    See whether you can define an additional parameter in the channel and access it in the adapter module and send it to the IE. Then make an additional parameter and set the value as cc name. (Here I'm not sure whether unrecognized additional parameter will affect the adapter functionality)
    Maybe you can give a try and let us know!
    Regards,
    kk

  • Element/ Node supression in message mapping

    Hi,
    Source Structure
    ID (Mandatory)
    FName (optional)
    Target Structure
    EmpID (mandatory)
    EmpName (optional)
    In my mapping, i mapped FName to EmpName. Since FName is optional,when i have an XML file that does not contain Name element my message mapping fails. So i used "if-then-else" and "exists" to make the mapping work.
    Name --> <b>"exists"</b> --><b>"if-then-else",</b>
         FName--> EmpName (then)
         Constant-->EmpName(else)
    But now i want that my o/p element (EmpName) should not get generated, if Name element does not exist. I mean the element Empname should be supressed in message mapping.
    I know that if a target field is mapped, it is bound to come in the target structure. But i want this target element to be supressed.
    Hope somebody can help me out...
    Cheers,
    Siva Maranani

    Hi Siva,
    If i understand u correctly you want to supress the target field if the mapped source field does not exist:
    Try using IF WITHOUT ELSE
    When the source field exists then you will have the value mapped to the target field and when the source field does not exist, the target field will not be created.
    Regards,
    Sridhar

  • Accessing XI logical system in message mapping

    Hi All,
    How can I retrieve the current PI logical system name in my mapping. I need to map it as part of the payload.
    Is there a java api that I can use?
    Thanks,
    Harsh

    Hi
      Glad to know that it helped you..
      we used this in one of our scenarios earlier.. but I dont know if there is any good doc on this.
    check if this helps
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/72e26432-0701-0010-19ba-abc05de7360b
    Our scenario was something like this.
    The customer had only Two systems (one Prod + other for dev/test/QA etc). since we cannot adjust mappings other than Dev, we used the above way & looked up values to generate the exact target location.
    I shall update this link for better doc, if I find any. (also for client info)
    - just try "SAPSYSTEM" if it works
    Cheers
    Regards
    Vishnu

  • Accessing container variables from ccBPM in Message Mapping?

    Hello Friends,
    I have created a ccBPM and require to send response messages to the sending system at different points as the message proceeds from one state to another. I do not want to create multiple message mapping stating different status in every message mapping. The message mapping remains the same only the status is changing. So I am thinking if I can access container elements in ccBPM at message mapping then I should be able to use only one message mapping.  Is it possible at all?
    Let me know if you have other solutions. Let me know if I am not clear?
    Thanks & Regards,
    Anand Patil

    Hi Abhishek,
    Your suggestion to use Parameterized Mapping did solve my issue. I was looking something like this. Thanks.
    Now I have only one Message Mapping and it is used in multiple places. Thanks a lot
    Best regards,
    Anand Patil

  • Accessing container variable of BPM in Message Mapping function

    Hi,
    I have a scenario in BPM where i have a container variable that is used as a loop counter.I want to access that counter defined , every time when i go around the loop and perform certain actions based on that counter. so how can i access that variable in my message Mapping function.

    Hi Sudharshan,
    check these links, hope they give you the required information (i think there is some problem with SDN site, check these links after a while)
    Re: How to use Container Variable across Maps
    Container object in Message Mapping
    Copy value of container (abstract interface) to an other container
    Regards
    Vishnu

  • How to access XML elements by name in Extendscript??

    I'm almost done the script that I've been working on, but something has been nagging me since I started. When I did start, I looked at the JS Tools Guide CS5 that comes with the extendscript ide to check how to access XML elements, children, attributes etc. It says this:
    The XML object represents an XML element node in an XML tree. The topmost XML object for an XML file
    represents the root node. It acts as a list, which contains additional XML objects for each element. These in
    turn contain XML objects for their own member elements, and so on.
    The child elements of an element tree are available as properties of the XML object for the parent. The
    name of the property corresponds to the name of the element. Each property contains an array of XML
    objects, each of which represents one element of the named type.
    So basically it converts the XML into JSON. And you can access the properties like so:
    <book category="COOKING">
         <title lang="en">The Boston Cooking-School Cookbook</title>
         <author>Fannie Merrit Farmer</author>
         <year>1896</year>
         <price>49.99</price>
    </book>
    The Javascript statement bookstoreXML.book; returns the entire list of books.
    The statement bookstoreXML.book[0]; returns the XML object for the first book.
    The statement bookstoreXML.book[0].author; returns all authors of the first book.
    A couple pages down it talks about Retrieving contained elements using children(), elements(), descendants().
    So now I look through the XML Object properties and I see that I can use:
    xmlObj.child (which) which A String, the element name, or a Number, a 0-based index into this node’s child array.
    or
    xmlObj.descendants ([name])
    name Optional. A String, the element name to match. If not provided, matches all
    elements.
    or
    xmlObj.elements (name);
    name Optional. A String, the element name to match. If not provided, matches all
    elements.
    This is an excerpt of an XML I was working with:
    <ROW xmlns="http://www.filemaker.com/fmpdsoresult"
         MODID="16"
         RECORDID="11128">
       <Sign_Type>251.dr</Sign_Type>
       <fm:Location xmlns:fm="http://www.filemaker.com/fmpdsoresult" xmlns="">5-5024</fm:Location>
       <Line1>Zone
    Floor
    3
    Patient Rooms
    R532 - R436 even
    Patient Rooms
    R522 - R446 even
    Xavier Elevators
    Zone
    Patient Rooms
    R537 - 5757 odd
    Main Elevators
    Zone</Line1>
    </ROW>
    Extendscript will not give me an anything when I try to access elements by name. Instead I have to access by index, which works, but I'd rather search for names!
    Actually the console log returns: <![CDATA[]]>
    What am I doing wrong!?

    First, those E4X XML objects are definitely no JSON (plain data) - they have a multitude of methods, even for tasks that would easily be implemented as property (e.g. the length() function), and they also bind xml element and attribute names onto the objects, allowing to target a multitude of XML nodes with a single statement. Or did you mean your script with that "it"?
    Anyway, as you found out the ExtendScript XML object handles namespaces mostly by hiding them from you.
    You could play around with global namespace settings, see the JavaScript tools guide.
    You could also explicitly specify a namespace. This works for me:
    $.writeln(myXML["fm:Location"]);
    For simple use I had most success with a brute force approach that just strips the namespaces.
    function removeAllNamespace(xml)
              var ns =new Namespace();
              var d=xml.descendants();
              for (var i=0;i<d.length();i++)
        d[i].setNamespace(ns);

  • Access current system or target system ID in message mapping

    Hi.
    I have a requirement to map three different constant values to Sales Org field, depending on whether the system is D, Q or Prod.
    This needs to be done in the message mapping section of the Interface along with all the other mapping logic.
    Is there any way how we can access the current system ID or the Target system ID (XI is communicating with target, in this case, ECC, using RFC receiver Communication channel)?
    Please help.
    Thanks.
    Anuradha.

    Hi,
    The key element would be :-
    System.getProperty("SAPSYSTEMNAME");
    Use this in UDF to get System Name ... and then on basis of systemname do whatever you want to perform.
    Regards
    Prabhat Sharma

  • Error in message mapping - Cannot produce target element

    As one step in my integration process, I am builing a very simple file to BPM integration (inbound MI async, outbound MI abstract).
    The source type and the target type are completely equal - I am only doing some modifications to some of the content.
    The type for both messages - source & target message - is an imported external definition (DTD), and hence no DT or MT are created.
    As a first step I am trying to fill the target message with the content from the source message (without any modifications to the content). However, when testing this in the message mapping area, I get an error message already when filling the first element, the 'root node'.
    The error message is as follows:
    Start of test
    Compilation of <MM name> successful
    Cannot produce target element <elementname>. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd Cannot produce target element <elementname>. . Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
    End of test
    Any suggestions?
    Thanks,
    C

    Thanks,
    when creating the source message manually in the MM it worked - so nothing wrong with the mapping.
    I saved this file and compared with the "original file" - containing the content which I wanted to upload, and on which the xsd (external definition) was based - and there where some inconsistancies.
    I changed some values in the source XML which made it work, also when uploading the file from a drive.
    So, I will go back to the source system and try to get a better XML.
    Thanks for now!

  • Changing datatype, afterwards Message-Mapping cannot produce target element

    Hi,
    we use PI/700.
    I changed a working system by changing a datatype of an existing message (adding a new element). My interface mapping contains two mappings: an XSL-Mapping and afterwards a Message-Mapping.
    My interface mapping looks like this:
    Message-Type A ->
          XSL-Mapping ->
    Message-Type B ->
          Message-Mapping ->
    Message-Type B
    When I test each mapping alone everything works fine (with the new element I added).
    But if I test my interface mapping in IBD with both mappings together, I'll get an error:
    "Cannot produce target element /MT_EDM_OUTBOUND_LASTGANG_TO_SAP/LASTGANG/MASSEINHEIT. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd".
    Is it possible that XI has problems in refreshing the XSDs?
    I tried this:
    (1) I changed my Message-Mapping and now all elements are mapped 1:1 -> no success!
    (2) Later I changed my Message-Mapping and build in "exists" with "if" to check whether the element "MASSEINHEIT" is generated by the XSL-Mapping -> It doesn't exists (??? - WHY? - when I test it, everything works fine)
    (2) Afterwards I changed my interface mapping and take only the XSL-Mapping (without the following Message-Mapping) -> the element "MASSEINHEIT" exists now!
    I'm totally confused!
    Any ideas?
    Regards
    Wolfgang Hummel

    Hi,
    If you have made structural changes to the data type..such as number of fields have decreased/increased..or some new fld altogether, then you have to activate the datatype..goto message mapping and then re-do the mapping...but if you have made "typo" changes like names have been changed, etc..then i think it should be alrite..i have sometimes made changes to my datatype, but after activating it, i had to redo the mapping..that was it!...the rest would fall into place:) No changes had to be made in the interface mapping..
    Regards,
    Sushumna

  • Message Mapping Field Name

    Hi!  I am trying to get the Field name of the XML element, when I am defining my own function.  Can someone please provide me some help!  Example:
    In the Graphical Editor, let's just say we drop the following fields:
    Source                                     Target
    City                 to                    City
    How can I grab the XML field name "City"?
    Thanks,
    Rob

    Hi Robert,
    In the Message Mapping, there is a button named 'Text Preview', just below the Tab names 'Design - Test - Messages'. If you click that, it displays the complete mapping in a text area. It conatins full paths of all mapped fields, similar to the XPath, which you can use in your function.
    If this helps you, please remember to award the points and close the post.
    Good luck,
    Bhanu

  • File-name not being fetched in a multi-message mapping by Dynamic Conf

    In a scenario, i have a BPM which has a transformation step which contains a mutimapping ...means 2 messages mapped to 1 messgaes, here in the mapping i m using an UDF and written code to extract the file name from dynamic configuration.....
    the problem is ...the same BPM contains another transformation step which contains a message mapping (which is not multi mapping), and here the code (UDF) works to fetch the file name...
    the code is all correct....and it looks like
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String sourceFileName = conf.get(key);
    if (sourceFileName == null ){
    sourceFileName = "ErrorFile.xml";}
    return sourceFileName;

    Hi,
    The scenario I am trying to test is a multi mapping scenario where I am trying to split one source message and create two target messages by using two different receiver interfaces, one for each message.
    I am on PI 7.1 and when I test message mapping and operation mapping using the payload from SXMB_MONI, it is successful. Whereas when I test the scenario end to end I am getting the following error messages:
    Operation Mapping
    Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
    Name
    Employee_Out_SI_To_Employee1_In_SI_AND_Employee2_In_SI_OM
    Namespace
    http://accenture.com/1:N_multi-mapping
    Runtime error
    Split mapping created no messages
    Start tag ns0:Messages Add raw attribute xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge" Start tag ns0:Message1 Close tag ns0:Message1 Start tag ns0:Message2 Close tag ns0:Message2 Close tag ns0:Messages
    Could someone please help
    Cheers,
    S

Maybe you are looking for