Access to message payload at UDF

Hi,
I need to get the message payload at a User Defined Function. I found http://help.sap.com/javadocs/pi/pi711sp03/index.html which have many API class like http://help.sap.com/javadocs/pi/pi711sp03/com/sap/engine/interfaces/messaging/api/Message.html and http://help.sap.com/javadocs/pi/pi711sp03/com/sap/engine/interfaces/messaging/api/Payload.html . But i dont know how to get the message object from container. I checked the PI mapping blogs but couldnt find any clue about that. Any help would be appreciated.
Kind regards,
Altuğ Bayram

When you want to work with the whole payload, why don't you use a Java mapping?
The graphical mapping is made just to avoid that you have to deal with the XML structure.

Similar Messages

  • Function to get message payload by MESSAGE_ID

    Hello Experts,
    Can you please give me the name of the function to get message payload by MESSAGE_ID?
    I was trying to call SXMB_SELECT_MESSAGES, but it returnes just technical info about message (like sender, receiver, etc), but not the payload.
    Thanks in advance for your answers!

    Akshay, but the main (original) problem still remains: How I can get an access to System Error description (Connection timeout, Connction refused, etc)?
    If I will build a custom Alert in my UDF and then will call SALERT_CREATE to raise an Alert, than how will I fill the Alert Body with Alert Description?
    I can have either the "native" Alert, containing just the Alert Description or "custom" Alert, containing some business data. But I need both.
    So is there any way to access the System Error description in mapping?

  • How  we can mention varible substitution for diffrent message payloads

    Hi,
    How  we can mention varible substitution for diffrent message payloads,
    My sceanrio like following,
    According the Outbound idoc message,based on the condition the messages to be split into 9 diffrent files.The sender message may or may not satisfied the condition to one or two messages or  all messages.
    I done the mapping 1:N multimapping in messagemapping & Interface mapping too.
    In reciever file adapter i put the variable substiution like as fallows.
    Variable            Refrence
    Name--            -
    Filename -- payload:message_type_1,1,Segment1,1,Segment2,1,Field_1,1
    <b>How we can mention variable substitution for remaining messages in the same communication channel.my message type names are diffrent for all 9 messagetypes.</b> Any ideas pl forward..,
    When i am testing this scenario,able to processing a one file but the file is not placed in the specified target & gives the follwing error:
    'Conversion configuration error: Unknown structure 'ns1:message_type_2' found in document', probably configuration error in file adapter (XML parser error)'.The file is
    In this case Idoc data satisfied the one message condition only.
    If any ideas & suggestions ..?

    Hi Anjan
    You could always put the "FileName" and "Directory" names into the Dynamic Configuration using a UDF in the map - possibly using a value mapping table to determine the correct values. Then simply reference "%Directory%" and "%FileName%" in the file adapter.  This way you do not have to reference payload variables and you set the names in the map. You will need to tick the box for "use adapter specific message attributes" in the file adapter. you UDF code will look something like
    String dir = "/path";
    String fil = "filename.txt";
    DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    conf.put(key,dir);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(key,fil);
    - Stephen

  • Extracting Value from Message Payload of the Failed Messages

    Hi Experts,
    We are working on PI 7.0. We have an asynchronous scenario from JMS to IDOC. Vehicle related data is being sent to SAP.
    We have a requirement where in we have to extract the vehicle commission number (a field in message payload) of all the failed messages in sxmb_moni(mapping failure).
    Is there a way we can achieve this? Can we write some OS level script to the same.
    If yes please help me out here.
    This is a critical issue.
    Kindly advice.
    Regards,
    Pooja

    Hi Pooja,
    We have done something similar, but instead of the Vehicle Comm Num, we just retrieved our Transaction ID. Please see the links below. These will send out an email if there was an issue with the message mapping.
    Customize E-Mail Body and Subject in Alerts in SAP PI 7.31 – Java Stack Only – Part 1 – ESR
    Trigger customized email on error in PI
    XI Alerts from UDF using file adapter.
    Trigger one alert per failed message
    How to send variable data through alert mail without BPM
    Raise Alert and also Execute the message
    Regards,
    Jannus

  • Delete message payload

    Experts,
    I have a simple proxy to file interface, and since its  messages contains classified data, the message payload (or entire message) must be deleted (or encrypted). so it is not be available (for any user)  while using regular monitoring tools as sxmb_moni (ECC and PI), RWB-CC monitoring.
    how can this be done?
    Regards,
    Uri

    Hello,
    Here are two potential solutions:
    1.) Encrypt the payload so that it will be unintelligible when it is received in PI
    2.) Restrict the access of the users as shown by Michal's blog:
    /people/michal.krawczyk2/blog/2006/01/02/xi-sxmbmoni--controlling-access-to-message-display
    Regards,
    Mark
    Edited by: Mark Dihiansan on Apr 7, 2011 7:49 AM

  • Calculating No. of records XI message payload

    Hello,
    Can somebody help me out to calculate no.of records in terms of XML tags in XI message payload.
    I have a scenario File->XI->ABAP proxy. File content conversion is used in FTP adapter. So my requirement is to count no. of records come from to XML tags.
    Thanks in advance.
    Best regards,
    Jilan Bhasha
    Message was edited by:
            Jilan Bhasha.P

    Hi Jilan,
    Actually where do you want to get this count..
    In sender file adapter config , we have option counter..
    -- or you can have a UDF to count the no of msgs ..
    -- you can use count function to root. that can be assigned toone target field..
    Recordsets per Message see in the below link
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    Hope this helps. Do get back to me in case you need any more details...
    Regards
    Kiran..

  • How to access Parent Message ID

    Hi,
    I am having File – IDOC scenario and also we are having dynamic interface determination where base on some particular value in file we are generating two different IDOCs. The overall scenario is working fine.
    Now in SXMB_moni I am getting one parent node and under that there are two sub nodes.  Also for there are 3 different message ID (one for parent and 2 for sub node.) .
    If we scroll sxmb_moni screen (<b>in alv grid</b>) there we are finding Message ID and Parent Message ID for sub node.  I am able to access message id for subnode but <b>not able to access Parent Message ID</b>.
    To access message ID, I am using following UDF.
    String headerField="";
    java.util.Map map;
    // get constant map
    map = container.getTransformationParameters();
    headerField = (String) map.get(StreamTransformationConstants.MESSAGE_ID);
    return headerField;
    I have already tried all Runtime Constants in  <a href="http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/b3/9a2aeb24dc4ab6b1855c99157529e4/frameset.htm</a>
    If anyone guide me to access Parent message id then it would be really great….
    Thanks,
    Sunil

    Hi Bin,
    thanks for reply...
    I have tried this but there is blank output.
    Thanks,
    Sunil Bhavsar

  • TS4002 I bought iPad and I can not access, A message appears asking me account and password when i return to the person who I purchased it from him, he told me that he forgot the account and password I want a solution to the problem, because in this way I

    I bought iPad and I can not access, A message appears asking me account and password when i return to the person who I purchased it from him, he told me that he forgot the account and password
    I want a solution to the problem, because in this way I will not benefit from the iPad

    There is no solution.  You have to provide the ID and password.  There is no way around it.  If the person you bought it from can't provide it, return it and get your money back.

  • Error while processing message payload Element 'CategoryCode&#39

    Hi Experts,
    I am trying to integrate SAP ECC with TM. I have transferred the sales order from ECC to TM, but its not triggering order based transportation requirement (OTR) instead giving an error Error while processing message payload Element &#39;CategoryCode&#39 and all the xml messages are stuck in inbound queue. The screen shot of the issue is as appended herewith. Please advise.
    Thanks & Regards,
    Aunkur De

    Hi Aunkur,
    The issue will generally  come when a mandatory field in XML which you are not sending either or missed.
    Please check if all mandatory fields are mapped properly.
    Best regards,
    Rohit

  • Error while processing message payload Element PI SXMB_MONI (ECC to TM)

    Dear Experts,
    while processing an XML message in TM using receiver interface IntracompanyTransportationRequestRequest_In , we encounter an error message.
    <SAP:Stack>Error while processing message payload Element &#39;StockTransportOrderReferenceIndicator&#39; missing</SAP:Stack>  
    <SAP:Retry>M</SAP:Retry>
    ssee screenshot attached.
    The field StockTransportOrderReferenceIndicator cannot be located in ECC and I cannot find what the system is expecting to populate here.
    Can somebody propose an approach on how to investigate into this error message for the solution?
    thanks a lot
    Salvador

    Hi Salvador,
    Thanks for your reply. We were able to fix that issue. As of now we have managed to send sales order to TM but getting the following error. Messages are getting failed in SAP TM. Even if the product exists in the system (TM) still the error message persists. I have CIFed location, business partner, product from ECC and everything exists in SAP TM with the same business system group. Kindly advise. Did you happen to face any similar kind of issue during your implementation ?
    Thanks & Regards,
    Aunkur De

  • Why can't i access the messages in my ipod touch

    why cant i access the messages on my ipod touch can u pleaase Help me guys if someone who knows to connect into my ipod touch to chat with my Friends EAGRELY Waiting for Your Reply..

    See my reply on your other post

  • PI 7.1 SOAP Adapter - Message Payload for Failed Messages - Where to find

    We are exposing a webservice through SAP PI.  Occassionaly we have customers calling our webservice and some failure occurs.  The error is usually the way that the customer is calling the webservice (missing elements, misnamed tags, bad content in the WS payload..).  Generally in these cases we can see the error in communication channel monitoring. 
    Here is an example:
    12/12/11 4:39:07 PM   com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.interfaces.messaging.api.exception.MessageFormatException: cvc-complex-type.2.4.b: The content of element 'SupplierInvoice' is not complete. One of '{"":Invoice}' is expected. at line 1, column 227
      12/12/11 4:39:06 PM   request received for a channel
    I understand the issue, but it would be extremely helpful to have the full SOAP Envelope and Payload of a request when it fails.  The communication channel will show a SUCESSFUL message payload with a link to it.  But it does not show a failed one.
    Where can I find the FAILED payload that accompanies this message?  These failures occurs before any mapping or being seen in RTWB Adapter Engine message monitoring...  I did some searching around, but did not find anything offhand.  I would greatly appreciate any pointers from anyone who has crossed this bridge.

    Hi,
    When the web service is being called by external application, the first point of contact would be the sender communication channel which converts the SOAP message into XML message and pass to integration engine ( In case of success )
    But if the web service call fails due to WSDL validation, Authentication issue, Bad content, invalid content type, you would not see the payload in the sender communication channel or in Adapter engine. You can just see error message in the sender communication channel . I have experienced this many times and i always ask the web service team to provide the SOAP message for validation/investigation purpose.

  • Message payload?

    Hi,
    What is a message payload in XI?
    Thanks.

    Hi...
    Payload is nothing but the data(data type) provided by u
    and which is displayed in XML format...
    The payload is the actual contents (business data) of a message in the Exchange Infrastructure(this is from the help).
    Cheers,
    Raghavesh

  • Problem in Edit Message Payload in AE

    Hi all,
    actually we have a problem with editing the message payload of a failed message in the adapter engine.
    Messages Editor shows "The version you want to edit is locked"
    Log in NWA shows "EditorDynPage: loadMessage()
    Thrown:
    com.sap.aii.mdt.api.exceptions.OperationFailedException: VersionAlreadyLockedException in Method: AdapterFrameworkMonitoringBean: getTransferMessage( Query ). The version you want to edit is locked. Message: Version 1 of message 4eb86ecc-fb6b-0c10-e100-80000a93147c(INBOUND) is already locked for editing.; To-String: com.sap.engine.interfaces.messaging.api.version.VersionAlreadyLockedException: Version 1 of message 4eb86ecc-fb6b-0c10-e100-80000a93147c(INBOUND) is already locked for editing."
    How to delet te lock,  the nwa => problem management => locks shows no locks?
    regards Ralf

    Hi,
    In NWS, you should also have a tab "Database Locks". See detail in this [SAP help|http://help.sap.com/saphelp_nwpi711/helpdata/en/48/b2e0156b156ff4e10000000a42189b/content.htm].
    regards.
    Mickael

  • Accessing fault message data in cc BPM

    In a BPM process, when a step throws an exception, is there a means to read the data on that exception for further processing?
    For example, a synchronous send step (RFC call) throws a SOAP fault, or a transformation step throws an exception (custom Java mapping).
    Is it possible to map data from that exception/SOAP fault to a response message?  I don't see a way for exception branches to persist the exception or SOAP fault data that triggered the exception.
    --Dan King

    Hello,
    Perhaps this weblog can help you :
    /people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated
    Regards,
    Chris

Maybe you are looking for