How to pass GUID in message mapping

Hi ALL
I would like to populate one of the target fields with SAP PI GUID or Message ID.
Can you please let me know, how to get the GUID in my message mapping and map it to the target field.
Thank you,
Ritu

Hi Ritu ,
its simple you can pick the messageID from the streamtransformation constant and map it to ur target field .
use this UDF it does not taes any input and its output can be mapped to target field where you want to populate the messageid.
java.util.Map param = container.getTransformationParameters();
String MSGID = (String) param.get (StreamTransformationConstants.MESSAGE_ID);
return MSGID
Regards,
Saurabh

Similar Messages

  • How to do this with message mapping in PI  ?

    Hi All,
    Field 1 = 100 characters having values in  first fifty characters and last 50 characters blank . I need to remove all the first 50 characters with blank and pass 100 blank characters .How to do this with message mapping
    Thanks

    Adding to that, since usually a tab = 8 spaces. What you can do is to open notepad, press tab 4 times. Copy it and paste 3 times, afterwards press space 4 more times and you get 100 spaces.
    Regards,
    Mark

  • How to use functions in Message Mapping

    Hi All,
           I am new to SAP XI. I don't know how to use functions in message mapping.     Can any body tell me how to use IF condition in message mapping.
         Please provide me a good link where I can get the details how to use those functions.
    Thanks,
    Srinivas.

    HI Srinivas
    Please take a look at these links,
    http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
    /people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    This will help you
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/190eb190-0201-0010-0ab3-e69f70b6c257
    http://help.sap.com/saphelp_nw04/helpdata/en/55/7ef3003fc411d6b1f700508b5d5211/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/a8/bfc6373c8fea43bdb3541535bcbd43/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8a57d190-0201-0010-9e87-d8f327e1dba7
    This will give you a detailed Idea about Context
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db95f835c111d1829f0000e829fbfe/frameset.htm
    This will give more explanation on Queue
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/51a39490-0201-0010-5b9f-ae21e8b78195
    For understanding node functions this blog will help you
    /people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
    Not sure you can find a collection of all...
    Cheers..
    Vasu
    <i>** REward Points if found useful **</i>

  • How to remove nodes in Message mapping

    Hi XI friends,
    in my idoc to file..
    i have number of segments..all segments are optional...
    i want to remove in resultanat xml file..
    please tell me how to remove if the values are not exsisted for that Segment ..
    i think its possible in message mapping..
    please guide me..
    Munna

    Hi Munna,
    Try Creating a UDF in your mapping name it like: "Create"
    Paste the below mentioned code in it
    ========================
    String str = a;
    if(str != null && str.length()>0)
    return "true";
    else
    return "false";
    ========================
    2) Save this function .
    3) Now Map like this
    (Source Node->UDF Create)->Check if it returns a string "true"--> if yes Map it with source node->add this in the "then" of an "if with out else"---->Target node.
    4) Test now in testing tool in Message mapping.
    Try it.
    it will work
    regards
    Pl: reward points if it worked

  • How do I resolve error message "mapi was unable to load aplzod.dll"? Outlook2010 on Win7

    Attempts to open Outlook calendar files (apparently located) on iCloud result in the error message "MAPI was unable to load the information service C:\PROGRA~2\COMMON~1\Apple\Internet Services\APLZOD.dll". Be sure the service is correctly installed and configured."
    I am running Outlook 2010 on Windows 7. I have uninstalled and reinstalled iTunes with no apparent effect. Is this a problem with iTunes or Outlook, how do I resolve it?

    That's part of my problem - I was getting the error message when I tried to click on iCloud in the Calendar portion of Outlook 2010. I don't know where it was generated (iCloud, iTunes, or as an add-in to Outlook).
    After my original post I tried restoring my computer to a date when I knew this worked, the restoration worked, and I can access my calendar. So that problem resolved itself.
    I do have another question, but I'll post it separately. Thanks for your response.

  • How to implement validations in message mapping?

    Hi experts,
    I have a simple requirement:
    I have a simple synchronous scenario:
    SOAP -> XI -> RFC
    In a message mapping, one of the fields in the source message is of type String.
    However, the target application (RFC) does not expect a non-numeric characters in this string.
    My question is how can I perform the validation in XI and tell the sender that this field contains Non-numeric characters?
    Please help.
    Thanks.
    Ron

    > Ron,
    >
    > >>With a RunTime Exception thrown, how can I tell
    >  the sender an error has occured?
    >
    > Sure. You can do this with out a BPM. You need to
    > configure alerts for this. If you configure ALERTS
    > and SCOTT, this will send an email of the errors
    > occuring in your scenario.
    >
    > For configuring and trouble shooting alerts check
    > these
    >
    > https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/
    > 2327
    > https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/
    > 2328
    >
    > Regards,
    > Jai Shankar
    Hi Jai
    I already have alerts configured.
    But what I had in mind is to send a response to the sender (The sender is waiting for a reply since this is synchronous), instead of telling the sender through an alternative means such as email, sms, etc.
    Is this possible?

  • How to export parameters from Message Mapping

    You can make use of this export parameter only in transformation step of Integration Process. You may use the following "Parameterized Mapping Programs"
    http://help.sap.com/saphelp_nwpi71/helpdata/en/27/db283fd0ca8443e10000000a114084/content.htm
    Regards,
    Prateek

    If you have defined the signature of your UDF then the return value of the UDF must be assigned to the Export paramter of message mapping.
    Basically import parametrs represents the inputs to be passed for that function(message mapping here)
    and export represents the output of that function.
    so in your case if you want toassign the value to Export parameter (ERROR_TEXT) in UDF catch block
    assign the error returned to the ERROR_TEXT field
    http://help.sap.com/saphelp_nwpi71/helpdata/en/43/c3e1fa6c31599ee10000000a1553f6/frameset.htm
    Check this link
    Hope this is clear
    Rajesh
    Edited by: Rajesh on Mar 13, 2009 5:31 PM

  • How to pass soap request message to server?

    how i can pass soap request message to server using http request header? the soap
    message contains remote procedure call which invokes the method at serverside?
    and where i have to write that header request?
    so i dont know how to pass the request soap message document
    [addsoaprequest.xml]

    Hello,
    We have a diagnostic tool called Post [1] that will post the request
    directly to a SOAP server. You can also try the graphical tool WeX [2]
    so you can see what is happening at the wire level.
    I may have misunderstood your question and goal. The purpose of the
    JAX-RPC [3] API is to provide a high-level abstraction of SOAP
    communications such as you describe.
    What is your use case?
    Thanks,
    Bruce
    [1]
    http://edocs.bea.com/wls/docs81/webserv/trouble.html#1066132
    [2]
    http://webservice.bea.com/wex.zip
    [3]
    http://java.sun.com/xml/jaxrpc/index.html
    Nisha Kothari wrote:
    >
    how i can pass soap request message to server using http request header? the soap
    message contains remote procedure call which invokes the method at serverside?
    and where i have to write that header request?
    so i dont know how to pass the request soap message document
    Name: addsoaprequest.xml
    addsoaprequest.xml Type: ACT Project (text/xml)
    Encoding: base64

  • How to pass input parameter (parameterized mapping) to java mapping program

    Hello
    I have a question about the parameterized mapping with Java (PI 7.1).
    In the operation mapping (using Java-class) I defined a inputer parameter (string). I think I am supposed to retrieved the value using:
                    arg0.getInputParameters().getString("myInputParameterName");
    where arg0 is the TransformationInput object.
    However I am not able to get the value, I got runtime exception saying the inputer parameter doesn't exit.
    Then I figured out maybe I need to bind the OM input parameter to Java mapping parameter, just like in case of message mapping, you need to bind OM parameter to MM parameter. However there is no way to define input parameter for the java mapping program.
    Anybody has done java mapping with parameterized mapping?
    Anybody can give any hint for this?
    Thanks
    Jayson

    InputParameters params = container.getInputParameters();
    DynamicConfiguration conf = (DynamicConfiguration) params.getValue(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
    http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Edited by: Anand on Dec 10, 2008 4:13 PM

  • How to use Variable in message mapping

    Hi Experts,
    I have some problem using variable in message mapping.
    In one message mapping, since a block of logic is repeated for several fields, then i tried to use a variable instead.
    the repeated logic is: first if condition, then use a udf to form a queue which will be suppressed by its father node.
    i tried to assign the result queue to a variable after the UDF execution. (this variable is created after the father node)
    I am wondering is there any restriction of using variable?
    Can we assign the whole queue to a variable?
    Can we use UDF during the process of assigning value to variable?
    thanks in advance.

    I dont think you can assign a queue to a variable,I am not 100% sure, . and there is no restriction to useing a Zvariable, only u can use it after you declare at some parent level.
    Yes you can use a UDF in the process of assigning to a Zvariable.
    Check out this link and read the comments of the blog.
    SAP PI 7.1 Mapping Enhancements Series: Using Graphical Variable
    /people/william.li/blog/2008/02/13/sap-pi-71-mapping-enhancements-series-using-graphical-variable
    Edited by: Saiyog Gonsalves on Nov 6, 2010 6:40 PM

  • How to pass values into a map

    I can't find any obvious way of doing this.
    for example, i have a value sitting in a BPEL variable, how do i use that value inside an XSL transformation?
    in the BizTalk world, i could easily map two input schemas onto one output schema, so one of the input can contain any extra values i want to pass into the transformation.
    but BPEL doesn't allow that.
    the last resort i have now is use embeded java code to update the message after the transformation.
    but then when it comes to updating repeating nodes, the built-in getVariableData function doesn't return a NodeList, it only returns the first found Node...
    all in all, it's been very painful and hacky to get it to work.
    Anyone knows a better way to do this?
    Thanks!

    maybe this post will help:
    [http://blogs.oracle.com/rammenon/2007/05/07/] (+Passing BPEL Variable contents into XSLT as Parameters+)

  • How to filter data in message mapping?Kindly help! URGENT

    Hi Experts,
    I have a source XML as shown below:
    <Inventory>
    <InventoryItem>
    <InventoryQty>
    <MaterialNo>X001</MaterialNo>
    <ItemCode>InTransit</ItemCode>
    <Quantity>1000</Quantity>
    </InventoryQty>
    <InventoryQty>
    <ItemCode>Available</ItemCode>
    <Quantity>1500</Quantity>
    </InventoryQty>
    <InventoryQty>
    <ItemCode>UnRestricted</ItemCode>
    <Quantity>1250</Quantity>
    </InventoryQty>
    </InventoryItem>
    <InventoryItem>
    <InventoryQty>
    <MaterialNo>X002</MaterialNo>
    <ItemCode>InTransit</ItemCode>
    <Quantity>1500</Quantity>
    </InventoryQty>
    <InventoryQty>
    <ItemCode>Available</ItemCode>
    <Quantity>1600</Quantity>
    </InventoryQty>
    <InventoryQty>
    <ItemCode>UnRestricted</ItemCode>
    <Quantity>1200</Quantity>
    </InventoryQty>
    </InventoryItem>
    </Inventory>
    My Target XML is mapped to a RFC Fnction module (YGET_STOCK). The target function module has a internal table (ITAB_STOCK) as input:
    YGET_STOCK
    ITAB_STOCK
    item
               - <Material>X001</Material>
               - <AvailableStock>1500</AvailableStock>
               - <IntransitStock>1000</IntransitStock>
    item
               - <Material>X002</Material>
               - <AvailableStock>1600</AvailableStock>
               - <IntransitStock>1500</IntransitStock>
    </Inventory>
    So how to get the desired target XML using graphical XI mapping?
    I have tried using graphical mapping and I am getting the following:
    YGET_STOCK
    ITAB_STOCK
    item
               - <Material>X001</Material>
               - <IntransitStock>1000</IntransitStock>
               - <AvailableStock></AvailableStock>
    item
               - <Material>X001</Material>
               - <IntransitStock></IntransitStock>
               - <AvailableStock>1500</AvailableStock>
    </Inventory>
    As shown it is reading only the first <InventoryItem> and splitting the Available and InTransit quantity into two separate items of the internal tables instead of putting them into one item.
    Kindly help me! URGENT!
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga
    Message was edited by:
            gopalkrishna baliga
    Message was edited by:
            gopalkrishna baliga
    Message was edited by:
            gopalkrishna baliga
    Message was edited by:
            gopalkrishna baliga

    what is ur mapping def...did u map <InventoryItem> to -
    item in rfc?

  • How to pass values to messages dynamically

    Hi,
        I am facing an issue while passing dynamic values to message text. The message number and message text are stored in an itab.
    eg- lets say 001(which changes dynamically for every loop) has text 'Contract account &1 doesn't exist'. Now I need to pass the value of CA to it.the parameters and the message number will change with every loop.
    Can anybody help me?

    Hi,
    You can use the FM :
    CALL FUNCTION 'MESSAGE_TEXT_BUILD'
      EXPORTING
        msgid                     = Message ID
        msgnr                     = Message No.
        msgv1                     = 'Value '
      MSGV2                     = ' '
      MSGV3                     = ' '
      MSGV4                     = ' '
    IMPORTING
       MESSAGE_TEXT_OUTPUT       = Complete_Message.
    Regards,
    Deepa.

  • How to pass self-defined message to Monitor

    Hi all,
    i am asked to define several Exception situations and pass the message to monitor if any of the exception situation occurs. Can anyone give me a sample code?
    This is what I wrote, but it didnt work... please help! Thanks!
    Message Z***** (message ID)
              001  : *****. (message number and text)
              002  : *****
              003  : *****
              004  : *****
              005  : *****.

    Hi Linda..
    Use like this:
    Either declare the Message id at the top of the report:
    REPORT zxxxxx
    MESSAGE-ID <msg id name>.
    Else, you can use the message id in the message too..
    MESSAGE <message type> <message no> (<message id>) WITH text.
    Where, message type can be E, I, W or S.
    For ex. MESSAGE E999(ZZ) WITH 'Incorrect entry'.
    Thanks and Best Regards,
    Vikas Bittera.

  • How to pass a XML message as a string and to change the string back to XML

    Hi there,
    in our current application, we have to access a webservice with a message whose XML Schema Definition was provided by the service's provider. But when accessing the webservice's WSDL, it says that the service expects the message part as a string type.
    How can I accomplish to send this structured message (as defined by the .XSD) to the webservice as a string?
    Thanks in advance,

    Michal,
    thanks very much for your help!
    I've managed to correctly serialize a xml into a string with the tips in your blog. However, I've not managed to perform the string -> xml (unserialize) step (I'm using Udo's sugestion).
    The problem is that XI generates a namespace prefix in runtime (it can be ns0, ns1, ns2..., depending on the context), and so I need to reference this namespace into the unserializing XSLT. With XMLSpy, I've managed to correctly transform it using the XPath "//*:my_tag" to the string tag, but this approach didn't work in XI.
    If I try to use just "//my_tag" the transformation concludes successfully, but XI says that the generated XML is not well-formed (probably because it doesn't fits the Schema of the target message, but I'm just guessing here). If I try to use "//:*my_tag", it doesn't even performs the transformation, and gives a "Problem When Testing" error, which says "Transformer configuration exception occurred when loading XSLT ...".
    Any ideas on how to reference namespace prefixes in XSLTs in XI?
    The codes of my XSLT's are below:
    XML to string:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
    <my_tag>
    <xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>
    <xsl:copy-of select="/"/>
    <xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>
    <xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>
    </my_tag>
    </xsl:template>
    </xsl:stylesheet>
    String to XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my_prefix="http://my_namespace">
    <xsl:template match="/">
    <xsl:for-each select="//*:my_tag">
    <xsl:value-of select="." disable-output-escaping="yes"/>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>
    Thanks again!

Maybe you are looking for